1. What is the primary purpose of a Database Management System (DBMS)?
A. To store data in a file system
B. To retrieve data from the database
C. To provide an interface between the user and the data
D. To ensure data security
Answer: C) To provide an interface between the user and the data
Rationale: A DBMS provides an interface between users and the database to manage, store, and
retrieve data efficiently.
2. Which of the following is an example of a non-relational DBMS?
A. PostgreSQL
B. SQLite
C. MongoDB
D. Oracle
Answer: C) MongoDB
Rationale: MongoDB is a non-relational (NoSQL) DBMS, which stores data in a flexible,
document-based format.
3. What does the SQL keyword LIMIT do?
,A. Restricts the number of records returned
B. Limits the columns selected
C. Restricts the amount of data in each column
D. Specifies the sorting order of the result set
Answer: A) Restricts the number of records returned
Rationale: The LIMIT keyword restricts the number of rows returned by a query.
4. Which of the following is the correct syntax to retrieve all records from a table called
Students?
A. SELECT * FROM Students;
B. SELECT Students FROM *;
C. RETRIEVE * FROM Students;
D. GET * FROM Students;
Answer: A) SELECT * FROM Students;
Rationale: The correct SQL syntax to select all records from the Students table is SELECT *
FROM Students;.
5. What is a composite key?
A. A key consisting of two or more columns used to uniquely identify a record
B. A key used to join multiple tables
C. A foreign key
, D. A key that is automatically generated by the DBMS
Answer: A) A key consisting of two or more columns used to uniquely identify a record
Rationale: A composite key is formed by combining two or more columns to uniquely identify
records in a table.
6. What is the purpose of the GROUP BY clause in SQL?
A. To group rows that have the same values in specified columns
B. To sort records in ascending order
C. To filter records based on a condition
D. To perform calculations on data
Answer: A) To group rows that have the same values in specified columns
Rationale: The GROUP BY clause groups rows that have the same values in specified columns,
often used in conjunction with aggregate functions.
7. What is the purpose of the EXPLAIN keyword in SQL?
A. To display the execution plan for a query
B. To explain the database schema
C. To summarize the table structure
D. To explain error messages
Answer: A) To display the execution plan for a query
A. To store data in a file system
B. To retrieve data from the database
C. To provide an interface between the user and the data
D. To ensure data security
Answer: C) To provide an interface between the user and the data
Rationale: A DBMS provides an interface between users and the database to manage, store, and
retrieve data efficiently.
2. Which of the following is an example of a non-relational DBMS?
A. PostgreSQL
B. SQLite
C. MongoDB
D. Oracle
Answer: C) MongoDB
Rationale: MongoDB is a non-relational (NoSQL) DBMS, which stores data in a flexible,
document-based format.
3. What does the SQL keyword LIMIT do?
,A. Restricts the number of records returned
B. Limits the columns selected
C. Restricts the amount of data in each column
D. Specifies the sorting order of the result set
Answer: A) Restricts the number of records returned
Rationale: The LIMIT keyword restricts the number of rows returned by a query.
4. Which of the following is the correct syntax to retrieve all records from a table called
Students?
A. SELECT * FROM Students;
B. SELECT Students FROM *;
C. RETRIEVE * FROM Students;
D. GET * FROM Students;
Answer: A) SELECT * FROM Students;
Rationale: The correct SQL syntax to select all records from the Students table is SELECT *
FROM Students;.
5. What is a composite key?
A. A key consisting of two or more columns used to uniquely identify a record
B. A key used to join multiple tables
C. A foreign key
, D. A key that is automatically generated by the DBMS
Answer: A) A key consisting of two or more columns used to uniquely identify a record
Rationale: A composite key is formed by combining two or more columns to uniquely identify
records in a table.
6. What is the purpose of the GROUP BY clause in SQL?
A. To group rows that have the same values in specified columns
B. To sort records in ascending order
C. To filter records based on a condition
D. To perform calculations on data
Answer: A) To group rows that have the same values in specified columns
Rationale: The GROUP BY clause groups rows that have the same values in specified columns,
often used in conjunction with aggregate functions.
7. What is the purpose of the EXPLAIN keyword in SQL?
A. To display the execution plan for a query
B. To explain the database schema
C. To summarize the table structure
D. To explain error messages
Answer: A) To display the execution plan for a query