Foundations Flashcards

1
Q

A ______ in a database occurs when an attribute is dependent on itself or a subset of the given attributes.

Example:
If A → A or AB → A, these are ______ because the dependent attribute is already part of the determinant.

  1. Trivial Dependency
  2. Transitive Dependency
  3. Partial Dependency
  4. Non-Trivial Dependency
A

Trivial Dependency

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
2
Q

The process of ______ involves combining tables or adding redundancy to improve read performance at the cost of increased storage and potential anomalies.

Example:
Storing customer and order details in the same table instead of separate ______ tables.

  1. Partitioning
  2. Denormalization
  3. Indexing
  4. Normalization
A

Denormalization

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
3
Q

______ ______ is optimal for frequent inserts, updates, and deletes because it eliminates redundancy and dependency issues while maintaining data integrity.

Example:
Ensuring that every determinant is a candidate key helps maintain - ______ ______ and prevents anomalies.

  1. Boyce-Codd Normal Form
  2. First Normal Form
  3. Third Normal Form
  4. Fourth Normal Form
A

Boyce-Codd Normal Form (BCNF)

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
4
Q

A(n) ______ in an ER diagram is used to represent an entity.

Example:
In a database for a school, “Student” and “Course” would be ______ symbols.

  1. Rectangle
  2. Diamond
  3. Oval
  4. Triangle
A

Rectangle

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
5
Q

An Attribute Symbol in an ER diagram is represented by a(n) ______

Example:
In a database for employees, “Name” and “Salary” would be ______ symbols.

  1. Rectangle
  2. Diamond
  3. Circle
  4. Triangle
A

Circle

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
6
Q

Before defining supertype and subtype entities, you must ______ ______.

Example:
In a university database, identifying “Person” before creating “Student” and “Professor” as subtypes ensures proper hierarchy.

  1. Define relationships
  2. Normalize tables
  3. Identify entities
  4. Assign attributes
A

Identify entities

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
7
Q

The ______ strategy is used to determine primary keys when analyzing data relationships.

Example:
Examining Social Security Numbers or Employee IDs helps with ______ to ensure uniqueness.

  1. Foreign key mapping
  2. Attribute clustering
  3. Unique identifier analysis
  4. Entity normalization
A

Unique identifier analysis

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
8
Q

An ER phrase should be read ______ to understand how one entity relates to another.

Example:
In an ER diagram, “Employee manages Department” should be read ______ to interpret the relationship correctly.

  1. From top to bottom
  2. In the direction the relationship verb is facing
  3. From left to right
  4. In the direction the entity box is facing
A

In the direction the relationship verb is facing

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
9
Q

______ are logical constraints that ensure the data is valid.

Example:
Primary keys enforcing uniqueness and foreign keys maintaining referential integrity are examples of ______.

  1. They are logical constraints that ensure the data is valid.
  2. They are based on business policy and specific databases.
  3. They represent data volumes and rapidly changing data structures.
  4. They embody the theoretical foundation of the SQL language.
A

They are logical constraints that ensure the data is valid.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
10
Q

______ includes the World database during its installation.

Example:
After installing ______, users can access the World database to explore country, city, and language data.

  1. MySQL
  2. MongoDB
  3. Oracle
  4. PostgreSQL
A

MySQL

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
11
Q

______ is the SQL sublanguage used to roll back database changes.

Example:
Using the ROLLBACK command in ______ allows reversing uncommitted transactions.

  1. Data Transaction Language (DTL)
  2. Data Manipulation Language (DML)
  3. Data Query Language (DQL)
  4. Data Control Language (DCL)
A

Data Transaction Language (DTL)

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
12
Q

______ is the format used by the TIME data type in MySQL.

Example:
A column with the TIME data type storing “14:30:15” follows the ______ format.

  1. YYYY-MM-DD
  2. YYYY-MM-DD hh:mm:ss
  3. hh:mm:ss
  4. hh:mm:ss YYYY-MM-DD
A

hh:mm:ss

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
13
Q

______ is the last operator in MySQL’s order of precedence.

Example:
In the expression TRUE OR FALSE AND FALSE, the AND operator is evaluated before ______.

  1. -
  2. OR
  3. NOT
  4. =
A

OR

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
14
Q

______ is the operator used to compare columns from the left and right tables in MySQL.

Example:
In a JOIN operation, table1.column ______ table2.column ensures matching rows.

  1. <=
  2. +
  3. =
  4. *
A

=

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
15
Q

______ is the type of join that combines two tables without comparing columns.

Example:
Using SELECT * FROM table1, table2; performs a ______, creating a Cartesian product.

  1. SELF
  2. EQUIJOIN
  3. OUTER
  4. CROSS
A

CROSS

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
16
Q

______ is the type of join that compares columns using only the = operator.

Example:
SELECT * FROM table1 INNER JOIN table2 ON table1.id ______ table2.id;

  1. Equijoin
  2. Non-equijoin
  3. Outer join
  4. Inner join
A

Equijoin

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
17
Q

______ is the operator used to compare against a list of values in a WHERE clause.

Example:
SELECT * FROM users WHERE role ______ (‘Admin’, ‘Editor’, ‘Viewer’);

  1. IN
  2. BETWEEN
  3. LIKE
  4. OR
A

IN

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
18
Q

______ is considered an aggregating function in SQL.

Example:
SELECT ______(salary) FROM employees; returns the lowest salary in the table.

  1. TRIM
  2. REPLACE
  3. MIN
  4. SUBSTRING
A

MIN

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
19
Q

______ is used with aggregate functions to produce summary rows.

Example:
SELECT department, COUNT(*) FROM employees ______ department; groups employees by department.

  1. TRIM
  2. REPLACE
  3. ORDER BY
  4. GROUP BY
A

GROUP BY

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
20
Q

______ returns only the matching values when selecting rows from two or more tables.

Example:
SELECT * FROM table1 ______ table2 ON table1.id = table2.id;

  1. Full Join
  2. Outer Join
  3. Equijoin
  4. Inner Join
A

Inner Join

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
21
Q

______ refers to the view in which data is persisted and is automatically changed as the underlying data is changed.

Example:
A ______ stores query results and updates them periodically rather than dynamically.

  1. Virtual View
  2. Snapshot View
  3. Denormalized View
  4. Materialized View
A

Materialized View

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
22
Q

______ describes elements such as column name and data type.

Example:
Database ______ includes information like table structure and constraints.

  1. Alter
  2. Table
  3. Metadata
  4. CRUD
A

Metadata

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
23
Q

______ identifies an ordered collection of elements enclosed in parentheses in a tablespace.

Example:
A row in a relational database table is also called a ______.

  1. Cell
  2. Field
  3. Column
  4. Tuple
A

Tuple

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
24
Q

______ demonstrates valid syntax in SQL for an INSERT statement.

Example:
______ table_name (column1, column2) ______ (value1, value2); correctly inserts data.

  1. INSERT INTO table_name (column1, column2) SET value1, value2;
  2. INSERT INTO table_name VALUES (value1, value2);
  3. INSERT INTO table_name (column1, column2) VALUES (value1, value2);
  4. INSERT INTO table_name SET column1 = value1, column2 = value2;
A

INSERT INTO table_name (column1, column2) VALUES (value1, value2);

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
25
Q

______ is a DDL (Data Definition Language) keyword in SQL.

Example:
______ TABLE employees (id INT, name VARCHAR(50)); defines a new table.

  1. INSERT
  2. UPDATE
  3. DELETE
  4. CREATE
A

CREATE

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
26
Q

______ allows SQL to insert a field value automatically.

Example:
id INT PRIMARY KEY ______; ensures unique ID values are generated.

  1. Composite
  2. Simple
  3. Auto-increment
  4. Numeric
A

Auto-increment

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
27
Q

______ ensures users have limited access to the database in large, complex systems.

Example:
User roles and permissions are managed through ______ to restrict access.

  1. Recovery
  2. Performance
  3. Authorization
  4. Confidentiality
A

Authorization

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
28
Q

______ specifies database requirements without regard to a specific database system.

Example:
A ______ focuses on high-level structure, entities, and relationships.

  1. Physical design
  2. Conceptual design
  3. Logical design
  4. Abstract design
A

Conceptual design

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
29
Q

______ will result in an error code and error description when using MySQL Server.

Example:
Executing an SQL statement with incorrect syntax will trigger a ______.

  1. When the server or updates are incorrectly installed
  2. When an SQL statement is entered to locate errors in the database
  3. When an SQL statement is syntactically incorrect
  4. When a Mac OS shortcut code is used on a Windows OS
A

When an SQL statement is syntactically incorrect

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
30
Q

______ should be used to store whole integer values, such as age.

Example:
age ______ NOT NULL; ensures only whole numbers are stored.

  1. NUM
  2. VARCHAR
  3. DATE
  4. INT
A

INT

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
31
Q

______ is the text-based interface included in the MySQL Server Download.

Example:
Developers use the ______ to execute SQL commands directly.

  1. MySQL Command-Line Client
  2. MySQL Workbench
  3. MySQL Enterprise
  4. MySQL Community
A

MySQL Command-Line Client

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
32
Q

______ is the standardized language of relational database systems.

Example:
Most relational databases use ______ to manage and query data.

  1. Contextual Query Language
  2. Structured Query Language
  3. Select Query Language
  4. Object Query Language
A

Structured Query Language

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
33
Q

______ is the SQL sublanguage used to manage database access.

Example:
GRANT SELECT ON employees TO user1; is an example of ______.

  1. Data Definition Language (DDL)
  2. Data Query Language (DQL)
  3. Data Manipulation Language (DML)
  4. Data Control Language (DCL)
A

Data Control Language (DCL)

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
34
Q

Which type of join is demonstrated by the following query?

> SELECT Dog.Nickname, Kennel.Address
FROM Dog, Kennel
WHERE Dog.KennelID = Kennel.ID

Example:
The condition WHERE Dog.KennelID = Kennel.ID indicates an ______.

  1. NON-EQUIJOIN
  2. SELF JOIN
  3. CROSS JOIN
  4. EQUIJOIN
A

EQUIJOIN

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
35
Q

______ is another name for a subquery.

Example:
A query inside another query is called a ______.

  1. Outer query
  2. Nested query
  3. Correlated query
  4. Search query
A

Nested query

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
36
Q

______ is the wildcard character used to represent zero or more characters when searching for a specified pattern using a LIKE operator.

Example:
SELECT * FROM customers WHERE name LIKE ‘A______’; matches any name starting with “A”.

  1. %
  2. _
  3. <
  4. >
A

%

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
37
Q

______ is the join type that selects only matching left and right table rows.

Example:
A query using ______ will return only rows where there is a match in both tables.

  1. Full Join
  2. Left Join
  3. Right Join
  4. Inner Join
A

Inner Join

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
38
Q

______ is the SQL command that uses the correct syntax to update the salary of an employee in the Employee table.

Example:
To update an employee’s salary, use:
______ Employee SET Salary = 50000 WHERE ID = 1;

  1. CHANGE Employee Salary = 50000 WHERE ID = 1;
  2. UPDATE Employee SET Salary = 50000 WHERE ID = 1;
  3. ALTER Employee SET Salary = 50000 WHERE ID = 1;
  4. UPDATE Employee (Salary) = (50000) WHERE ID = 1;
A

UPDATE Employee SET Salary = 50000 WHERE ID = 1;

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
39
Q

______ is the SQL command that uses the correct syntax to select the name and salary columns from the Employee table, where the salary is greater than 50000, and sort the results by salary in descending order.

Example:
To retrieve and sort employee data, use:
______ name, salary FROM Employee WHERE salary > 50000 ORDER BY salary DESC;

  1. SELECT name, salary FROM Employee WHERE salary > 50000 ORDER BY salary DESC;
  2. SELECT Employee.name, Employee.salary WHERE Employee.salary > 50000 SORT BY Employee.salary DESC;
  3. SELECT name, salary FROM Employee SORT BY salary DESC WHERE salary > 50000;
  4. SELECT name, salary FROM Employee WHERE salary > 50000 SORT BY salary ASC;
A

SELECT name, salary FROM Employee WHERE salary > 50000 ORDER BY salary DESC;

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
40
Q

______ is the UPDATE statement that uses valid syntax in SQL.

Example:
To update values in a table, use:
______ table_name SET column1 = value1, column2 = value2 WHERE condition;

  1. UPDATE table_name column_name= value1 WHERE condition
  2. UPDATE table_name SET column1 = value1, column2 = value2 WHERE condition;
  3. UPDATE SET column1 = value1, column2 = value2 WHERE condition IN table_name;
  4. UPDATE table_name SET column_name = value1
A

UPDATE table_name SET column1 = value1, column2 = value2 WHERE condition;

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
41
Q

______ is the statement used to remove data from temporary tables.

Example:
To remove all rows from a table without logging individual row deletions, use:
______ table_name;

  1. DROP
  2. DELETE
  3. DEFAULT
  4. TRUNCATE
42
Q

______ is the property enforced by a primary key field.

Example:
A primary key ensures that each record in a table is unique and cannot be ______.

  1. Null
  2. Duplicate
  3. Not Null
  4. Numeric
43
Q

______ is the property that specifies an expression on one or more columns of a table.

Example:
A table can use the ______ constraint to enforce conditions like ensuring an age column only contains values greater than 18.

  1. CHECK
  2. RESTRICT
  3. CASCADE
  4. UNIQUE
44
Q

______ is a single column in a table used to identify a row.

Example:
In an Employee table, the EmployeeID column serves as a ______, uniquely identifying each employee.

  1. Super key
  2. Simple primary key
  3. Foreign key
  4. Composite primary key
A

Simple primary key

45
Q

______ is often represented by parentheses to show multiple columns.

Example:
In an OrderDetails table, (OrderID, ProductID) together form a ______, uniquely identifying each row.

  1. Composite
  2. Simple
  3. Unique
  4. Foreign
46
Q

______ means a primary key includes information that is easy to type and store.

Example:
Using an auto-incremented number as a primary key ensures it is ______ and easy to manage.

  1. Non-null
  2. Meaningless
  3. Stable
  4. Simple
47
Q

______ is the type of relationship established by a foreign key in a relational database.

Example:
A customer can place multiple orders, but each order is linked to only one customer, demonstrating a ______ relationship.

  1. Aggregation
  2. Composition
  3. One-to-many
  4. Many-to-many
A

One-to-many

48
Q

______ statements may be rejected when a foreign key constraint is specified.

Example:
Attempting to add a record with a non-existent foreign key value in a referenced table will cause a ______ statement to be rejected.

  1. INSERT
  2. CHECK
  3. SELECT
  4. ORDER BY
49
Q

______ key describes the unique columns in a table that do not contain a primary key.

Example:
If a table has multiple unique columns, any of them could be a ______ key before selecting the primary key.

  1. Foreign key
  2. Simple key
  3. Candidate key
  4. Composite key
A

Candidate key

50
Q

______ development activity is used to convert an entity-relationship model (ERM) into tables, columns, and keys.

Example:
In database design, ______ is the process where conceptual models are refined into relational schemas.

  1. Execution
  2. Physical design
  3. Analysis
  4. Logical design
A

Logical design

51
Q

A database designer is working with a table that has a primary key and no duplicate rows.

Example:
Since the table has a primary key and no duplicate rows, it satisfies at least the requirements for ______.

  1. It is a Boyce-Codd table.
  2. It contains trivial dependency.
  3. The table contains a non-key column.
  4. It is a first normal form table.
A

It is a first normal form table.

52
Q

Which process eliminates redundancy by decomposing a table into two or more tables in a higher normal form?

Example:
The process of ______ reduces redundancy by breaking a table into multiple related tables while preserving dependencies.

  1. Merging
  2. Creation of a candidate key
  3. Evaluation of trivial dependency
  4. Normalization
A

Normalization

53
Q

Which relationship is depicted in the following entity-relationship (ER) diagram?

Example:
An ER diagram represents how entities relate to one another in a database. A ______ relationship occurs when a single record in one entity corresponds to multiple records in another entity.

  1. Ternary
  2. Many-to-many
  3. One-to-one
  4. One-to-many
A

One-to-many

54
Q

Which relationship or association exists between a supertype entity and its subtype entities?

Example:
In an entity-relationship model, a ______ relationship represents a hierarchy where a general entity (supertype) is divided into more specific entities (subtypes).

  1. IsA relationship
  2. Weak entity
  3. Associative entity
  4. Unary relationship
A

IsA relationship

55
Q

Which real-world object can be distinctly identified and grouped, such as all employees in a company?

Example:
In a company’s database, each employee is recorded with unique details like Employee ID, Name, and Department. All employees together form a group that can be represented as an “Employee” entity in the database.

  1. Entity-relationship (ER) diagram
  2. Glossary
  3. Entity
  4. Attribute type
56
Q

Which item in an entity-relationship (ER) diagram follows the attribute name and is placed outside of parentheses?

Example:
In an entity-relationship diagram, the ______ is noted outside of parentheses to indicate a constraint on the attribute.

  1. Weak entity
  2. Attribute maximum
  3. Attribute minimum
  4. Physical design
A

Attribute maximum

57
Q

Which index stores column values and row pointers in a hierarchy?

Example:
A ______ index organizes column values and row pointers in multiple levels, improving search efficiency.

  1. Dense index
  2. Sparse index
  3. Multi-level index
  4. Secondary index
A

Multi-level index

58
Q

Which type of index refers to entries that are assigned to buckets?

Example:
A ______ index distributes entries into predefined storage locations (buckets) based on a hash function.

  1. Bitmap index
  2. Logical index
  3. Hash index
  4. Secondary index
A

Hash index

59
Q

Which type of index is a grid of bits where each index row corresponds to a unique row in a table?

Example:
A ______ index represents data using a matrix of bits, allowing efficient querying for multiple conditions by performing bitwise operations.

  1. Multi-level index
  2. Logical index
  3. Hash index
  4. Bitmap index
A

Bitmap index

60
Q

Which SQL keyword is used to remove a table from the database permanently?

Example:
To delete a table and its structure permanently, use the ______ keyword.

  1. DELETE
  2. DROP
  3. TRUNCATE
  4. REMOVE
61
Q

Which SQL function returns the smallest value in a column?

Example:
To find the lowest value in a numeric column, use the ______ function.

  1. MAX()
  2. MIN()
  3. COUNT()
  4. AVG()
62
Q

Which SQL constraint ensures a column does not contain NULL values?

Example:
To enforce that a column must always have a value, apply the ______ constraint.

  1. UNIQUE
  2. FOREIGN KEY
  3. NOT NULL
  4. DEFAULT
63
Q

Which SQL function calculates the average value of a numeric column?

Example:
To find the mean of all values in a column, use the ______ function.

  1. SUM()
  2. AVG()
  3. COUNT()
  4. MIN()
64
Q

Which type of join only returns matching rows between two tables?

Example:
To retrieve only records that exist in both tables, use an ______ join.

  1. LEFT
  2. RIGHT
  3. FULL
  4. INNER
65
Q

Which SQL keyword is used to create a new table in a database?

Example:
To define a new table structure, use the ______ keyword.

  1. NEW
  2. DEFINE
  3. CREATE
  4. INSERT
66
Q

Which SQL clause is used to specify conditions for rows returned by a query?

Example:
To filter records based on a condition, use the ______ clause.

  1. HAVING
  2. GROUP BY
  3. WHERE
  4. ORDER BY
67
Q

Which SQL keyword is used to update a table’s structure?

Example:
To add, remove, or modify columns in an existing table, use the ______ keyword.

  1. MODIFY
  2. CHANGE
  3. ALTER
  4. UPDATE
68
Q

Which SQL function returns the number of rows that match a condition?

Example:
To count the number of rows in a query result, use the ______ function.

  1. SUM()
  2. COUNT()
  3. AVG()
  4. MIN()
69
Q

Which SQL statement is used to remove specific rows from a table?

Example:
To delete certain rows from a table, use the ______ statement.

  1. REMOVE
  2. DELETE
  3. DROP
  4. TRUNCATE
70
Q

Which SQL operator is used to search for a pattern in text data?

Example:
To find rows where a column contains a certain pattern, use the ______ operator.

  1. IN
  2. LIKE
  3. BETWEEN
  4. EXISTS
71
Q

Which SQL constraint is a combination of two or more columns to uniquely identify a record?

Example:
To enforce uniqueness across multiple columns, use a ______ key.

  1. Foreign
  2. Candidate
  3. Composite
  4. Primary
72
Q

Which SQL keyword is used to ensure a column has a default value?

Example:
To set a predefined value for a column, use the ______ keyword.

  1. DEFAULT
  2. SET
  3. AUTO
  4. INIT
73
Q

Which SQL command creates an index to improve query performance?

Example:
To speed up searches on a column, use the ______ command.

  1. ALTER
  2. CREATE INDEX
  3. UNIQUE
  4. HASH
A

CREATE INDEX

74
Q

Which SQL clause is used to combine rows from two or more tables based on a related column?

Example:
To retrieve data from multiple tables using relationships, use the ______ clause.

  1. UNION
  2. JOIN
  3. CONNECT
  4. MERGE
75
Q

Which SQL function finds the remainder of division between two numbers?

Example:
To compute the remainder of a division, use the ______ function.

  1. MOD()
  2. DIV()
  3. REMAINDER()
  4. FLOOR()
76
Q

Which SQL operator returns true if a subquery returns any rows?

Example:
To check if a subquery returns any results, use the ______ operator.

  1. EXISTS
  2. IN
  3. BETWEEN
  4. LIKE
77
Q

Which SQL keyword is used to specify that a column should automatically generate a value?

Example:
To create a column that auto-increments, use the ______ keyword.

  1. AUTO_INCREMENT
  2. DEFAULT
  3. UNIQUE
  4. GENERATE
A

AUTO_INCREMENT

78
Q

Which SQL clause is used to rename a table?

Example:
To change the name of an existing table, use the ______ clause.

  1. MODIFY
  2. RENAME
  3. ALTER
  4. CHANGE
79
Q

Which SQL operator checks whether a value is null?

Example:
To filter rows where a column is empty, use the ______ operator.

  1. = NULL
  2. IS NULL
  3. NULLABLE
  4. EMPTY
80
Q

Which SQL statement is used to grant user permissions on a table?

Example:
To assign specific privileges to a user, use the ______ statement.

  1. GRANT
  2. PERMIT
  3. 1ALLOW
  4. AUTHORIZE
81
Q

Which SQL function is used to return the total number of rows in a result set?

Example:
To count the number of employees in a table, you can use the ______ function.

  1. SUM
  2. COUNT
  3. AVG
  4. MAX
82
Q

Which SQL function is used to find the highest value in a column?

Example:
To find the highest salary in an Employee table, use the ______ function.

  1. SUM
  2. COUNT
  3. MAX
  4. MIN
83
Q

Which SQL keyword is used to remove duplicate rows from a result set?

Example:
To ensure that only unique values appear in the results, use the ______ keyword.

  1. UNIQUE
  2. DISTINCT
  3. REMOVE
  4. FILTER
84
Q

Which SQL function is used to find the lowest value in a column?

Example:
To find the lowest price in a Product table, use the ______ function.

  1. SUM
  2. COUNT
  3. MAX
  4. MIN
85
Q

Which SQL statement is used to remove all records from a table while keeping the table structure?

Example:
To delete all data but retain the table definition, use the ______ statement.

  1. DELETE
  2. DROP
  3. TRUNCATE
  4. REMOVE
86
Q

Which SQL clause is used to filter results based on aggregate functions?

Example:
To filter groups of results after applying an aggregate function, use the ______ clause.

  1. WHERE
  2. HAVING
  3. GROUP BY
  4. ORDER BY
87
Q

Which SQL operator is used to combine the results of two SELECT statements while removing duplicates?

Example:
To merge two result sets into one without duplicates, use the ______ operator.

  1. UNION
  2. JOIN
  3. INTERSECT
  4. MERGE
88
Q

Which SQL constraint ensures that a column cannot have NULL values?

Example:
To ensure that a column always has a value, use the ______ constraint.

  1. UNIQUE
  2. NOT NULL
  3. DEFAULT
  4. FOREIGN KEY
89
Q

Which SQL function is used to calculate the average value of a numeric column?

Example:
To find the average price of products, use the ______ function.

  1. SUM
  2. AVG
  3. COUNT
  4. MAX
90
Q

Which SQL keyword is used to change an existing table structure?

Example:
To add or remove a column from a table, use the ______ statement.

  1. MODIFY
  2. UPDATE
  3. ALTER
  4. CHANGE
91
Q

Which SQL operator is used to check if a value falls within a specified range?

Example:
To find employees with salaries between 40,000 and 60,000, use the ______ operator.

  1. IN
  2. BETWEEN
  3. LIKE
  4. CASE
92
Q

Which SQL keyword is used to retrieve a specified number of records from a result set?

Example:
To return only the first 10 rows of a query, use the ______ keyword.

  1. LIMIT
  2. FETCH
  3. RESTRICT
  4. RANGE
93
Q

Which SQL statement is used to remove a specific record from a table?

Example:
To delete a customer with ID = 5, use the ______ statement.

  1. REMOVE
  2. DELETE
  3. DROP
  4. TRUNCATE
94
Q

Which SQL statement is used to rename an existing table?

Example:
To change the name of the “Users” table to “Customers,” use the ______ statement.

  1. RENAME TABLE
  2. ALTER TABLE
  3. MODIFY TABLE
  4. CHANGE TABLE
A

RENAME TABLE

95
Q

Which SQL statement is used to insert new records into a table?

Example:
To add a new employee to the Employee table, use the ______ statement.

  1. ADD
  2. INSERT INTO
  3. UPDATE
  4. CREATE
A

INSERT INTO

96
Q

Which SQL clause is used to define a condition for grouped records?

Example:
To filter grouped sales data where total sales exceed 10,000, use the ______ clause.

  1. WHERE
  2. HAVING
  3. GROUP BY
  4. ORDER BY
97
Q

Which SQL constraint ensures that a column contains only unique values?

Example:
To prevent duplicate values in an email column, use the ______ constraint.

  1. NOT NULL
  2. PRIMARY KEY
  3. UNIQUE
  4. FOREIGN KEY
98
Q

Which SQL operator is used to search for a specific pattern in a text column?

Example:
To find all customer names that start with “J,” use the ______ operator.

  1. LIKE
  2. IN
  3. BETWEEN
  4. REGEXP
99
Q

Which SQL clause is used to group records that have the same values in specified columns?

Example:
To group sales data by region, use the ______ clause.

  1. GROUP BY
  2. ORDER BY
  3. WHERE
  4. HAVING
100
Q

Which SQL statement is used to modify existing records in a table?

Example:
To change an employee’s salary in the Employee table, use the ______ statement.

  1. MODIFY
  2. CHANGE
  3. UPDATE
  4. ALTER