1. Which of the following statements is used to insert new data into a table?
A. INSERT INTO
B. INSERT INTO VALUES
C. ADD INTO
D. NEW INTO
Answer: B) INSERT INTO VALUES
Rationale: The INSERT INTO VALUES statement is used to insert new records into a table.
2. Which SQL command is used to add a new record into a table?
A. INSERT
B. UPDATE
C. SELECT
D. DELETE
Answer: A) INSERT
Rationale: The INSERT command is used to add a new record into a table.
3. Which SQL statement is used to return the number of rows in a table?
A. SELECT COUNT()
B. SELECT SUM()
,C. SELECT MAX()
D. SELECT MIN()
Answer: A) SELECT COUNT()
Rationale: The COUNT() function is used to return the number of rows in a table.
4. What type of relationship is represented by a many-to-many relationship in a relational
database?
A. Direct relationship between two tables
B. Indirect relationship through a junction table
C. Single relationship with multiple values
D. No relationship exists
Answer: B) Indirect relationship through a junction table
Rationale: A many-to-many relationship is usually implemented by creating a junction table that
contains foreign keys referencing the related tables.
5. In SQL, which command is used to remove a table from a database?
A. DELETE
B. DROP
C. REMOVE
D. TRUNCATE
Answer: B) DROP
, Rationale: The DROP command is used to delete a table and its structure from a database.
6. What is the function of the HAVING clause in SQL?
A. To filter records before grouping
B. To sort the result set
C. To filter records after grouping
D. To join multiple tables
Answer: C) To filter records after grouping
Rationale: The HAVING clause is used to filter records after the GROUP BY operation has been
performed.
7. 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.
8. What does ACID stand for in database systems?
A. INSERT INTO
B. INSERT INTO VALUES
C. ADD INTO
D. NEW INTO
Answer: B) INSERT INTO VALUES
Rationale: The INSERT INTO VALUES statement is used to insert new records into a table.
2. Which SQL command is used to add a new record into a table?
A. INSERT
B. UPDATE
C. SELECT
D. DELETE
Answer: A) INSERT
Rationale: The INSERT command is used to add a new record into a table.
3. Which SQL statement is used to return the number of rows in a table?
A. SELECT COUNT()
B. SELECT SUM()
,C. SELECT MAX()
D. SELECT MIN()
Answer: A) SELECT COUNT()
Rationale: The COUNT() function is used to return the number of rows in a table.
4. What type of relationship is represented by a many-to-many relationship in a relational
database?
A. Direct relationship between two tables
B. Indirect relationship through a junction table
C. Single relationship with multiple values
D. No relationship exists
Answer: B) Indirect relationship through a junction table
Rationale: A many-to-many relationship is usually implemented by creating a junction table that
contains foreign keys referencing the related tables.
5. In SQL, which command is used to remove a table from a database?
A. DELETE
B. DROP
C. REMOVE
D. TRUNCATE
Answer: B) DROP
, Rationale: The DROP command is used to delete a table and its structure from a database.
6. What is the function of the HAVING clause in SQL?
A. To filter records before grouping
B. To sort the result set
C. To filter records after grouping
D. To join multiple tables
Answer: C) To filter records after grouping
Rationale: The HAVING clause is used to filter records after the GROUP BY operation has been
performed.
7. 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.
8. What does ACID stand for in database systems?