T4Tutorials .PK

NSCT – Structured Query Language (SQL) MCQs

1. . SQL stands for:

(A) Standard Query Link


(B) Structured Query Language


(C) Simple Query Language


(D) System Query Logic




2. . Which SQL command is used to retrieve data from a database?

(A) UPDATE


(B) INSERT


(C) SELECT


(D) DELETE




3. . To add a new row in a table, which SQL command is used?

(A) DELETE


(B) SELECT


(C) UPDATE


(D) INSERT INTO




4. . Which SQL command is used to modify existing data in a table?

(A) SELECT


(B) UPDATE


(C) INSERT


(D) DELETE




5. . To remove rows from a table, which SQL command is used?

(A) TRUNCATE


(B) DROP


(C) DELETE


(D) UPDATE




6. . The SQL command to permanently remove a table is:

(A) TRUNCATE TABLE


(B) DELETE TABLE


(C) DROP TABLE


(D) REMOVE TABLE




7. . TRUNCATE TABLE is used to:

(A) Modify table structure


(B) Delete a table permanently


(C) Remove a column


(D) Remove all rows from a table without logging individual row deletions




8. . Which clause is used in SQL to filter records based on a condition?

(A) FROM


(B) WHERE


(C) ORDER BY


(D) GROUP BY




9. . The ORDER BY clause is used to:

(A) Delete records


(B) Filter records


(C) Group records


(D) Sort the result set in ascending or descending order




10. . GROUP BY in SQL is used to:

(A) Sort data


(B) Arrange identical data into groups


(C) Filter data


(D) Delete groups




11. . HAVING clause in SQL is used to:

(A) Filter individual rows


(B) Filter records after aggregation


(C) Sort data


(D) Delete data




12. . The SQL keyword DISTINCT is used to:

(A) Group rows


(B) Count rows


(C) Return only unique values


(D) Sort data




13. . Which SQL function returns the number of rows?

(A) AVG()


(B) SUM()


(C) COUNT()


(D) MAX()




14. . Which SQL function returns the highest value in a column?

(A) COUNT()


(B) MIN()


(C) MAX()


(D) AVG()




15. . Which SQL function returns the average of a column?

(A) COUNT()


(B) SUM()


(C) AVG()


(D) MAX()




16. . To combine rows from two or more tables based on a related column, which SQL clause is used?

(A) JOIN


(B) UNION


(C) GROUP BY


(D) ORDER BY




17. . INNER JOIN returns:

(A) All rows from the left table


(B) Only matching rows from both tables


(C) All rows from the right table


(D) All rows from both tables




18. . LEFT JOIN returns:

(A) None of the above


(B) Only matching rows


(C) Only right table rows


(D) All rows from the left table and matching rows from the right table




19. . UNION in SQL is used to:

(A) Sort results


(B) Combine queries and keep duplicates


(C) Combine result sets of two queries and remove duplicates


(D) Filter data




20. . The main purpose of SQL is to:

(A) Compress tables


(B) Store, manipulate, and retrieve data from relational databases


(C) Encrypt files


(D) Delete old records automatically




Exit mobile version