Database Questions Answers
Q1. What does SQL stand for
(a) Structured Query Language
(b) Structured Quality Language
(c) Structured Question Language
(d) Structured Querying Language
Answer: (a) Structured Query Language
Q2. What is a primary key in SQL
(a) A column that can have multiple values for each row in a table
(b) A column that is used to join two or more tables together
(c) A column that is unique for each row in a table
(d) A column that stores the current date and time
Answer: (c) A column that is unique for each row in a table
Q3. What is the command to create a new database in SQL
(a) NEW DATABASE
(b) CREATE DATABASE
(c) MAKE DATABASE
(d) ADD DATABASE
Answer: (b) CREATE DATABASE
Q4. What is the command to select all columns from a table in SQL
(a) SELECT *
(b) SELECT ALL
(c) SELECT TABLE
(d) SELECT COLUMNS
Answer: (a) SELECT *
Q5. Which SQL keyword is used to retrieve data from multiple tables
(a) WHERE
(b) FROM
(c) SELECT
(d) JOIN
Answer: (d) JOIN
Q6. What is the purpose of the WHERE clause in SQL
(a) To join multiple tables together
(b) To group the data by certain criteria
(c) To order the data in a specific way
(d) To filter data based on certain conditions
Answer: (d) To filter data based on certain conditions
Q7. What is a foreign key in SQL
(a) A column in a table that is unique for each row in that table
(b) A column in a table that references the primary key of another table
(c) A column in a table that is used to join two or more tables together
(d) A column in a table that stores the current date and time
Answer: (b) A column in a table that references the primary key of another table
Q8. What is the purpose of the GROUP BY clause in SQL
(a) To group the data by certain criteria
(b) To filter data based on certain conditions
(c) To order the data in a specific way
(d) To join multiple tables together
Answer: (a) To group the data by certain criteria
Q9. What is the command to delete a table in SQL
(a) DELETE TABLE
(b) REMOVE TABLE
(c) DROP TABLE
(d) ERASE TABLE
Answer: (c) DROP TABLE
Q10. What is the command to insert data into a table in SQL
(a) INSERT DATA
(b) ADD DATA
(c) INSERT INTO
(d) ADD INTO
Answer: (c) INSERT INTO
Q11. What is the command to update data in a table in SQL
(a) UPDATE DATA
(b) MODIFY DATA
(c) UPDATE TABLE
(d) MODIFY TABLE
Answer: (c) UPDATE TABLE
Q12. What is the purpose of the TRUNCATE TABLE command in SQL
(a) To delete a table
(b) To update records in a table
(c) To remove a column from a table
(d) To delete all records from a table
Answer: (d) To delete all records from a table
Q13. What is the command to create a new index in SQL
(a) CREATE INDEX
(b) NEW INDEX
(c) MAKE INDEX
(d) ADD INDEX
Answer: (a) CREATE INDEX
Q14. What is the purpose of the DISTINCT keyword in SQL
(a) To join multiple tables together
(b) To group the data by certain criteria
(c) To filter data based on certain conditions
(d) To remove duplicate records from the query result
Answer: (d) To remove duplicate records from the query result
Q15. What is the command to create a new user in SQL
(a) CREATE USER
(b) NEW USER
(c) MAKE USER
(d) ADD USER
Answer: (a) CREATE USER
Practice Test Exam