InfoTechSite|IT Tutorials, MCQs, and Quizzes

CS/IT MCQ Collections

40 Essential MCQ of Structured Query Language for SQL Certification Exam Set -2

Pinterest LinkedIn Tumblr Reddit WhatsApp
Structured Query Language (SQL) is the backbone of managing and querying data in relational databases, making it a critical skill for anyone pursuing a career in database management or development. If you’re preparing for an SQL certification exam, mastering the core concepts through multiple-choice questions (MCQs) is an excellent way to test your knowledge and identify areas for improvement. In this blog post, we’ve curated 40 essential MCQ of Structured Query Language —including topics like SELECT statements, constraints, joins, aggregate functions, and more—to help you gain confidence and ace your certification exam. Dive in, challenge yourself, and solidify your understanding of SQL fundamentals!

1.What SQL statement is used to fetch data from a database?
A) INSERT
B) SELECT
C) UPDATE
D) DELETE

2. What does the WHERE keyword do in SQL in a query?
A) It defines what columns to return.
B) It filters rows on a condition.
C) It sorts the result set.
D) It joins more tables.

3. How would you select all the columns, i.e., all the columns from the “employees” table?
A) SELECT columns FROM employees;
B) SELECT * FROM employees;
C) SELECT ALL FROM employees;
D) SELECT ALL COLUMNS FROM employees;

4. What would the given SQL produce for you? SELECT name FROM customers WHERE age BETWEEN 30 AND 50;
A) Select names of customers under 30 years of age
B) Select the names of customers who are between the ages of 30 and 50.
C) Select all columns of customers aged between 30 and 50
D) None of the above

5. Which of the following operators in SQL are used to check for null values?
A) = NULL
B) IS NULL
C) NULL
D) EXISTS

6. How to avoid duplicate value repeats in query results?
A) UNIQUE keyword
B) DISTINCT keyword
C) FILTER keyword
D) EXCLUDE keyword

7. Which clause in SQL is used to sort data in Ascending/Descending order?
A) GROUP BY
B) ORDER BY
C) SORT BY
D) ARRANGE BY

8. Which of the following syntaxes is correct to insert a new record in the “products” table?
A) INSERT INTO products VALUES (101, ‘Laptop’, 750);
B) INSERT products (101, ‘Laptop’, 750);
C) ADD RECORD TO products (101, ‘Laptop’, 750);
D) INSERT TO products (101, ‘Laptop’, 750);

9. How would you raise all employees’ salaries in the “staff” table by 10%?
A) UPDATE staff SET salary = salary * 1.1;
B) MODIFY staff SET salary = salary * 1.1;
C) CHANGE staff salary TO salary * 1.1;
D) ALTER staff ADD 10 TO salary;

10. Which of the following SQL functions returns the total of a numeric column?
A) COUNT()
B) SUM()
C) AVERAGE()
D) TOTAL()

11. Which of the following is the correct syntax for a query to delete all rows where “status” is ‘inactive’?
A) REMOVE FROM table WHERE status = ‘inactive’;
B) DELETE FROM table WHERE status = ‘inactive’;
C) ERASE FROM table WHERE status = ‘inactive’;
D) DELETE ROWS FROM table WHERE status = ‘inactive’;

12. Which SQL keyword is used to group rows that have a common property?
A) GROUP BY
B) ORDER BY
C) HAVING
D) PARTITION BY

13. What does HAVING do?
A) It filters rows after it has grouped them.
B) It sorts rows in the result.
C. Group rows having similar values.
D) Joins Tables

14. Which of the following selects distinct job titles from the “employees” table?
A) SELECT ALL job_title FROM employees;
B) SELECT DISTINCT job_title FROM employees;
C) SELECT job_title FROM employees WHERE UNIQUE;
D) SELECT DISTINCT job_title FROM employees;

15. Which SQL statement below would create a table?
A) CREATE employees;
B) CREATE TABLE employees;
C) ADD TABLE employees;
D) MAKE TABLE employees;

16. What does the use of a foreign key in SQL do?
A) Uniquely identifies every record in the table
B) Relate tables on their relationships to one another
C) Stores data that is encrypted
D) Defines the default value of a column

17. When combining rows from two or more tables, which SQL term is used?
A) UNION
B) MERGE
C) COMBINE
D) LINK

18. What does the following query accomplish? SELECT COUNT(*) FROM orders;
A) The total number of columns in a table
B) The total number of rows in the table
C) The total number of orders beyond a certain value
D) None of the above

19. When creating a database, which SQL statement is used?
A) CREATE DATABASE database_name;
B) NEW DATABASE database_name;
C) ADD DATABASE database_name;
D) INSERT DATABASE database_name;

20. What does the LIMIT clause do in SQL?
A) It groups rows according to a condition
B) It limits the number of rows in the result set
C) It filters rows by a range of values
D) It orders rows by a condition

21. In SQL, which operator is used to match patterns?
A) LIKE
B) MATCH
C) PATTERN
D) SEARCH

22. How will you select the first 5 rows from any table?
A) SELECT * FROM table FETCH 5;
B) SELECT TOP 5 * FROM table;
C) SELECT * FROM table LIMIT 5;
D) Both B and C

23. Which SQL statement is used to alter the structure of an already existing table?
A) MODIFY TABLE
B) ALTER TABLE
C) UPDATE TABLE
D) CHANGE TABLE

24. What is the default sort order in SQL?
A) Ascending
B) Descending
C) Random
D) None

25. How will you join two tables if they share something in common?
A) CROSS JOIN
B) INNER JOIN
C) SELF JOIN
D) OUTER JOIN

26. What is the action of SELECT AVG(salary) FROM employees;?
A) Gives the sum of salaries of employees
B) Gives average salary of employees
C) Gives the minimum salary of employees
D) Gives the maximum salary of employees

27. Which SQL statement deletes duplicate records in a result set?
A) SELECT DISTINCT
B) SELECT UNIQUE
C) SELECT EXCLUSIVE
D) SELECT FILTER

28. What does TRUNCATE TABLE table_name do?
A) Deletes all records and resets the structure of the table
B) Deletes all records but saves the structure of the table
C) Deletes some records of the table
D) Completely delete the table

29. Which of the following is NOT a legitimate SQL constraint?
A) UNIQUE
B) INDEX
C) SORT
D) LINK

30. What does an index serve for in SQL?
A) A way to implement a foreign key
B) It increases the speed of a query
C) A column by default
D) To create a new table

31. Which of the following query is correct for using comparison operators in SQL?
A) SELECT sname, coursename FROM studentinfo WHERE age>50 and <80;
B) SELECT sname, coursename FROM studentinfo WHERE age>50 and age <80;
C) SELECT sname, coursename FROM studentinfo WHERE age>50 and WHERE age<80;
D) None of the above

32.How to select all data from studentinfo table starting the name from letter ‘r’?
A) SELECT * FROM studentinfo WHERE sname LIKE ‘r%’;
B) SELECT * FROM studentinfo WHERE sname LIKE ‘%r%’;
C) SELECT * FROM studentinfo WHERE sname LIKE ‘%r’;
D) SELECT * FROM studentinfo WHERE sname LIKE ‘_r%’;

33. Which of the following SQL query is correct for selecting the name of staffs from ‘tblstaff’ table where salary is 15,000 or 25,000?
A) SELECT sname from tblstaff WHERE salary IN (15000, 25000);
B) SELECT sname from tblstaff WHERE salary BETWEEN 15000 AND 25000;
C) Both A and B
D) None of the above

34. The SELECT statement, that retrieves all the columns from empinfo table name starting with d to p is ……………………..
A) SELECT ALL FROM empinfo WHERE ename like ‘[d-p]%’;
B) SELECT * FROM empinfo WHERE ename is ‘[d-p]%’;
C) SELECT * FROM empinfo WHERE ename like ‘[p-d]%’;
D) SELECT * FROM empinfo WHERE ename like ‘[d-p]%’;

35. Select a query that retrieves all of the unique countries from the student table?
A) SELECT DISTINCT coursename FROM studentinfo;
B) SELECT UNIQUE coursename FROM studentinfo;
C) SELECT DISTINCT coursename FROM TABLE studentinfo;
D) SELECT INDIVIDUAL coursename FROM studentinfo;

36. Which query is used for sorting data that retrieves the all the fields from empinfo table and listed them in the ascending order?
A) SELECT * FROM empinfo ORDER BY age;
B) SELECT * FROM empinfo ORDER age;
C) SELECT * FROM empinfo ORDER BY COLUMN age;
D) SELECT * FROM empinfo SORT BY age;

37. Select the right statement to insert values to the stdinfo table.
A) INSERT VALUES (“15”, “Hari Thapa”, 45, 5000) INTO stdinfo;
B) INSERT VALUES INTO stdinfo (“15”, “Hari Thapa”, 45, 5000);
C) INSERT stdinfo VALUES (“15”, “Hari Thapa”, 45, 5000);
D) INSERT INTO stdinfo VALUES (“15”, “Hari Thapa”, 45, 5000);

38. How to Delete records from studentinfo table with name of student ‘Hari Prasad’?
A) DELETE FROM TABLE studentinfo WHERE sname=’Hari Prasad’;
B) DELETE FROM studentinfo WHERE sname=’Hari Prasad’;
C) DELETE FROM studentinfo WHERE COLUMN sname=’Hari Prasad’;
D) DELETE FROM studentinfo WHERE sname LIKE ‘Hari Prasad’;

39. Constraint checking can be disabled in existing …………. and ………….. constraints so that any data you modify or add to the table is not checked against the constraint.
A) CHECK, FOREIGN KEY
B) DELETE, FOREIGN KEY
C) CHECK, PRIMARY KEY
D) PRIMARY KEY, FOREIGN KEY

40. ………………… joins two or more tables based on a specified column value not equaling a specified column value in another table.
A) OUTER JOIN
B) NATURAL JOIN
C) NON-EQUIJOIN
D) EQUIJOIN

We have created a quiz including MCQ of Structured Query Language(SQL) with basic SQL queries. Please take this quiz to test your knowledge on DBMS fundamentals.

Quiz for Fundamentals of DBMS

 

1. What will be created if a primary key is combined with a foreign key?
2. Which statement is executed automatically by the system?
3. Which command can be used to change a column value in a table?
4. Which of the following defines rules regarding the values allowed in columns and is the standard mechanism for enforcing database integrity?
5. What is a full form of SQL?
6. Which of the following contains information that defines valid values that are stored in a column or data type?
7. Which of the following is a preferred method for enforcing data integrity?
8. Which of the following has to be dealt with by the integrity subsystem is to ensure that only valid values can be assigned to each data item?
9. What defines the structure of a relation that consists of a fixed set of attribute-domain pairs?
10. Which of the following is not a characteristic of a relational database model?
11. Which keyword is used to find the number of values in a column?
12. Which data type can store unstructured data?
13. Which is a proper subset designed to support views belonging to different classes of users in order to hide or protect information?
14. Who proposed the process of normalization in DBMS at first?
15. What is a special type of integrity constraint that relates two relations & maintains consistency across the relations?
16. Which table store information about the database or about the system?
17. Which of the following databases contains data assisting day-to-day activities of the organization?
18. DCL stands for
19. What is an advantage of the database management approach?
20. Which of the following files are used during the operation of the DBMS?
21. A top-to-bottom relationship among the items in a database is established by a
22. In a relational model, relations are also called
23. In SQL, the CREATE TABLESPACE is used
24. In a relational schema, each tuple is divided into fields called
25. Grant and revoke are which of the following statements?
26. Which of the following clauses is used to pass on granted privileges to other users?
27. What is the full form of DDL in Database Management System?
28. Which of the following entity does not have a distinguishing attribute if its own and most are dependent entities?
29. Which of the following is TRUE for the system variable "date"?
30. Which of the following are used during the operation of the DBMS?
31. What is the feature of the relational model?
32. If a table has more than one set of attributes that could be chosen as the key, it is called
33. Data independence means
34. What is the full form of HSAM?
35. What operator tests the column for the absence of data?
36. Which of the following databases has only a strict parent-child relationship?
37. Which of the following is a utility to capture a continuous record of server activity and provide auditing capability?
38. Which of the following operators is basically a join followed by a project on the attributes of the first relation?
39. Which of the following is a condition specified on a database schema and restricts the data that can be stored in an instance of the database?
40. What is a set of columns that identifies every row in a table?
41. Which of the following is/are the DDL statements?
42. A table can have only one
43. In a snapshot, which clause tells Oracle how long to wait between refreshes?
44. What is a set of possible data values?
45. A relational database developer refers to a record as
46. What is the number of tuples in a relation?
47. Which command is used for entering the specific database?
48. Which normal form is considered adequate for relational database design?
49. Which of the following is critical in formulating database design?
50. Which of the following is the complex search criteria in the where clause?
51. Which of the following is not a binary operator in relational algebra?
52. Which one of the following statements is false?
53. Which of the following enables users to create and maintain a database?
54. What language requires a user to specify the data to be retrieved without specifying exactly how to get it?
55. The database schema is written in which of the following languages?
56. DBMS helps to achieve
57. What are the different events in Triggers?
58. Which database level is closest to the users?
59. What is the collection of information stored in a database at a particular moment?
60. Which of the following is the preferred method for enforcing data integrity?
61. What is a logical schema?
62. Which character function can be used to return a specified portion of a character string?
63. Which of the following are the properties of entities?
64. Which key is a minimal superkey that can also refer to a surrogate key?
65. DFD stands for
66. Which of the following keys is used to eliminate duplicate rows?
67. What represents the number of entities to which another entity can be associated?
68. Which contains information about a file needed by system programs for accessing file records?
69. In an ER model, which is described in the database by storing its data.
70. Which database is used as a template for all databases created?
71. Which of the following is a way a particular application views the data from the database that the application uses?
72. Which of the following components is NOT included in the database environment?
73. Which of the following is used to define the overall design of the database?
74. Data items grouped together for storage purposes is called a
75. In the relational modes, cardinality is also called
76. In SQL, which command is used to issue multiple CREATE TABLE, CREATE VIEW, and GRANT statements in a single transaction?
77. Which of the following is used to determine whether a table contains duplicate rows?
78. Which of the following is an outstanding functionality of SQL that supports automatic selection of the target data?
79. Which of the following commands can be used to modify a column in a table?
80. The key to represent the relationship between tables is called
81. Which candidate key allows you to uniquely identify each row?
82. Which of the following SQL commands can be used to modify existing data in a database table?
83. Which of the following clauses specifies a search condition for a group or an aggregate?
84. What is the process of organizing data into related tables?
85. Which of the following are the ways in which entities can participate in a relationship?
86. What is the view of total database content?
87. Which of the following provides an option for entering SQL queries as execution time, rather than at the development stage?
88. Which clause is an additional filter that is applied to the result?
89. What is the way a particular application views the data from the database that the application uses?
90. Which of the following is not a logical database structure?

 

Answers:

  1. B) SELECT
  2. B) It filters rows on a condition.
  3. B) SELECT * FROM employees;
  4. B) Select the names of customers who are between the ages of 30 and 50.
  5. B) IS NULL
  6. B) DISTINCT keyword
  7. B) ORDER BY
  8. A) INSERT INTO products VALUES (101, ‘Laptop’, 750);
  9. A) UPDATE staff SET salary = salary * 1.1;
  10. B) SUM()
  11. B) DELETE FROM table WHERE status = ‘inactive’;
  12. A) GROUP BY
  13. A) It filters rows after it has grouped them.
  14. B) SELECT DISTINCT job_title FROM employees;
  15. B) CREATE TABLE employees;
  16. B) Relate tables on their relationships to one another
  17. A) UNION
  18. B) The total number of rows in the table
  19. A) CREATE DATABASE database_name;
  20. B) It limits the number of rows in the result set
  21. A) LIKE
  22. C) SELECT * FROM table LIMIT 5;
  23. B) ALTER TABLE
  24. A) Ascending
  25. B) INNER JOIN
  26. B) Gives average salary of employees
  27. A) SELECT DISTINCT
  28. A) Deletes all records and resets the structure of the table
  29. A) UNIQUE
  30. B) It increases the speed of a query
  31. B) SELECT sname, coursename FROM studentinfo WHERE age>50 and age <80;
  32. A) SELECT * FROM  studentinfo WHERE sname LIKE ‘r%’;
  33.  A) SELECT sname from tblstaff WHERE salary IN (15000, 25000);
  34. D) SELECT * FROM empinfo WHERE ename like ‘[d-p]%’;
  35. A) SELECT DISTINCT coursename FROM studentinfo;
  36. A) SELECT * FROM  empinfo ORDER BY age;
  37. D) INSERT INTO stdinfo VALUES (“15”, “Hari Thapa”, 45, 5000);
  38. B) DELETE FROM studentinfo WHERE sname=’Hari Prasad’;
  39. A) CHECK, FOREIGN KEY
  40. C) NON-EQUIJOIN

Read Next: SQL MCQ of Structured Query Language With Answers set-3

FAQs for MCQ of Structured Query Language (SQL)

What are MCQs of Structured Query Language?

MCQs of Structured Query Language are a form of assessment in SQL that measures one’s cognizance about concepts. It poses questions to which several answers are possible but again only one is correct. You will find huge applications for testing theoretical and practical SQL understanding in certification tests conducted on SQL.

Why should I Prepare MCQ of Structured Query Language for certification exams?

Practicing MCQ of Structured Query Language fortifies the concepts of SQL, helps learn how queries have to be framed, and recognizes common pitfalls. You will get insight into the form of questions for certification of examinations and should confidently and efficiently be used by practicing time management.

What topics are covered by this set on MCQ of Structured Query Language?

This set on MCQ of Structured Query Language touch on a wide range of topics: SQL statements such as SELECT and UNIQUE statements, constraints, joins, aggregate functions, and more.

Are the MCQ of Structured Query Language theory-based or practical in the Exam?

Most MCQ of Structured Query Language are scenario-based, and they test your practical understanding. Although some are theoretical, most will involve query analysis or solving real-world database problems.

Does practicing this MCQ of Structured Query Language help me with overall database skills?

Of course, practicing this MCQ of Structured Query Language enhances your understanding of database concepts, query optimization, and troubleshooting by serving as a platform to bridge the gap in theoretical and practical applications.

We have created a video on YouTube including MCQ of Structured Query Language(SQL) with basic SQL queries. Please watch the video and subscribe to our channel to get more videos on DBMS.

Read More: Collections of DBMS MCQ questions
Download: Free PDF E-book of DBMS MCQ questions

Author

Shuseel Baral is a web programmer and the founder of InfoTechSite has over 8 years of experience in software development, internet, SEO, blogging and marketing digital products and services is passionate about exceeding your expectations.

Write A Comment

Protected by Security by CleanTalk and CleanTalk Anti-Spam