50mcq Test SQL
50mcq Test SQL
1. What is a database?
- a) A collection of tables
- b) A collection of related data
- c) A type of software
- d) A programming language
10. Which SQL category includes commands like SELECT, INSERT, UPDATE, and DELETE?
- a) DDL
- b) DML
- c) DCL
- d) TCL
16. Which SQL constraint ensures that all values in a column are unique?
- a) CHECK
- b) UNIQUE
- c) NOT NULL
- d) PRIMARY KEY
26. Which SQL function is used to calculate the sum of a numeric column?
- a) COUNT()
- b) AVG()
- c) SUM()
- d) MAX()
27. What SQL command is used to insert new data into a table?
- a) SELECT
- b) UPDATE
- c) INSERT INTO
- d) ALTER TABLE
29. Which SQL operator is used to filter data based on multiple conditions?
- a) AND
- b) OR
- c) IN
- d) NOT
34. What SQL clause is used to group rows that have the same values in specified
columns?
- a) ORDER BY
- b) GROUP BY
- c) WHERE
- d) HAVING
37. Which type of JOIN returns all records from the left table and the matched
records from the right table?
- a) INNER JOIN
- b) RIGHT JOIN
- c) LEFT JOIN
- d) FULL JOIN
44. Which type of index allows for faster retrieval of unique values in a column?
- a) Foreign Index
- b) Primary Index
- c) Composite Index
- d) Unique Index