NEW
Font size
WorksheetsDataBase Quiz - CME Workshop
Total questions: 20
Worksheet time: 10mins
What is a primary key in a relational database?
A unique identifier for a table
A foreign key in another table
A field that can have duplicate values
An index on all columns
Which SQL statement is used to retrieve data from a database?
GET
SELECT
FETCH
QUERY
What is the purpose of the SQL JOIN operation?
To insert data into a table
To delete data from a table
To combine rows from two or more tables based on a related column
To update data in a table
In a relational database, what is normalization?
The process of removing duplicate rows from a table
The process of organizing data in a structured format
The process of optimizing query performance
The process of reducing data redundancy by dividing tables into smaller, related tables
Which SQL clause is used to filter rows in a SELECT statement?
FROM
WHERE
HAVING
GROUP BY
. What is an index in a database?
A list of all the tables in the database
A unique identifier for a database
A data structure that improves the speed of data retrieval
A column that can have duplicate values
Which of the following is an example of a non-relational database?
MySQL
PostgreSQL
MongoDB
Oracle
What is the purpose of the SQL GROUP BY clause?
To filter rows in a SELECT statement
To join two or more tables
To group rows with the same values in specified columns
To order the result set in ascending or descending order
What is a foreign key in a relational database?
A key that uniquely identifies each row in a table
A key that is not used as a primary key
A key that references the primary key of another table
A key that contains only numeric values
Which SQL statement is used to add new rows to a table?
INSERT INTO
UPDATE
DELETE FROM
ALTER TABLE
What is SQL injection?
A method of injecting SQL code into a database to retrieve data
A way to prevent SQL queries from executing
A technique to hide sensitive data in a database
A method to improve SQL query performance
What does the acronym ACID stand for in the context of database transactions?
Atomicity, Consistency, Isolation, Durability
Association, Complexity, Isolation, Data
. Authentication, Compatibility, Integrity, Deployment
Availability, Compression, Indexing, Decryption
In SQL, what is the purpose of the UNION operator?
To combine the results of two or more SELECT statements into a single result set
To filter rows based on a condition
. To perform a cross join between two tables
To delete duplicate rows from a table
What is a stored procedure in a database?
A type of primary key
A predefined set of SQL statements that can be executed as a single unit
A virtual table used for reporting
A temporary table used for data storage
Which SQL statement is used to modify existing data in a table?
INSERT INTO
SELECT
UPDATE
DELETE FROM
What is the purpose of the SQL ORDER BY clause?
To group rows with the same values
To filter rows based on a condition
To sort the result set in ascending or descending order
To combine rows from two or more tables
What is the difference between a primary key and a unique key?
A primary key allows duplicate values, while a unique key does not.
A primary key can consist of multiple columns, while a unique key cannot.
A primary key enforces both uniqueness and NOT NULL constraint, while a unique key enforces only uniqueness.
A primary key is used for indexing, while a unique key is not.
What is the purpose of the SQL LIMIT clause?
To limit the number of rows returned in a result set
To specify the maximum length of text fields
To define the precision of a numeric column
To filter rows based on a condition
Which of the following is NOT a valid data type in SQL?
INTEGER
BOOLEAN
DECIMAL
STRING
What is a view in a database?
A virtual table that is based on the result of a SELECT query
A physical table that stores temporary data
A type of primary key
A unique identifier for a database
