MCQ Database set 1

1. Which of the following is a type of database model?

A. Hierarchical
B. Relational
C. Network
D. All of the above


2. What does SQL stand for?

A. Simple Query Language
B. Structured Query Language
C. Sequential Query Language
D. Standard Query Language


3. Which of the following is not a database object?

A. Table
B. View
C. Index
D. HTML


4. What is the primary key?

A. A unique identifier for each row in a table
B. A key that links two tables
C. A foreign key
D. A key that contains duplicate values


5. What is a foreign key?

A. A primary key in another table
B. A unique identifier in a table
C. A key used for indexing
D. None of the above


6. Which SQL clause is used to filter rows based on a condition?

A. SELECT
B. FROM
C. WHERE
D. GROUP BY


7. Which SQL statement is used to update data in a table?

A. UPDATE
B. MODIFY
C. CHANGE
D. ALTER


8. Which SQL function is used to count the number of rows in a table?

A. COUNT()
B. SUM()
C. TOTAL()
D. AVG()


9. What does ACID stand for in the context of databases?

A. Atomicity, Consistency, Isolation, Durability
B. Access, Control, Integrity, Durability
C. Accuracy, Consistency, Integration, Durability
D. Atomicity, Control, Isolation, Data


10. Which of the following is an example of a NoSQL database?

A. Oracle
B. MySQL
C. MongoDB
D. PostgreSQL


11. What is the purpose of an index in a database?

A. To store data
B. To speed up queries
C. To connect tables
D. To enforce referential integrity


12. Which of the following is a DDL command?

A. SELECT
B. INSERT
C. UPDATE
D. CREATE


13. Which normal form eliminates transitive dependencies?

A. 1NF
B. 2NF
C. 3NF
D. BCNF


14. What is the default port number for MySQL?

A. 3306
B. 5432
C. 1521
D. 1433


15. Which SQL keyword is used to sort the result set?

A. SORT
B. ORDER BY
C. GROUP BY
D. FILTER


16. What type of JOIN returns all rows from the left table, even if there are no matches in the right table?

A. INNER JOIN
B. RIGHT JOIN
C. LEFT JOIN
D. FULL JOIN


17. What does the DROP command do in SQL?

A. Deletes rows from a table
B. Removes a table or database
C. Modifies the structure of a table
D. Creates a new table


18. Which of the following is an aggregate function in SQL?

A. SELECT
B. AVG()
C. INSERT
D. WHERE


19. What is the purpose of a database schema?

A. To store data
B. To define the structure of a database
C. To query data
D. To secure data


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

A. DELETE
B. DROP
C. REMOVE
D. CLEAR


21. In relational databases, what is a tuple?

A. A column in a table
B. A row in a table
C. A table
D. A database


22. What does the SELECT DISTINCT statement do?

A. Selects all rows in a table
B. Selects unique rows in a table
C. Selects all columns in a table
D. Selects rows that meet a condition


23. What is a view in a database?

A. A temporary table
B. A virtual table based on the result of a query
C. A physical copy of a table
D. A schema


24. Which of the following is a key-value store database?

A. MongoDB
B. Cassandra
C. Redis
D. All of the above


25. Which SQL command is used to create a new table?

A. CREATE TABLE
B. NEW TABLE
C. INSERT TABLE
D. MAKE TABLE


Correct Answers:

  1. D
  2. B
  3. D
  4. A
  5. A
  6. C
  7. A
  8. A
  9. A
  10. C
  11. B
  12. D
  13. C
  14. A
  15. B
  16. C
  17. B
  18. B
  19. B
  20. A
  21. B
  22. B
  23. B
  24. D
  25. A
Previous Post Next Post

نموذج الاتصال