Welcome to Interviewbit, help us create the best experience for you!

Currently, You are a:

Few details about your education

College/University *
Enter the name of your college
Branch *
Year of completion *

Few details about your education

College/University *
Enter the name of your college
Branch *
Year of completion *

Few details about your career...

Current Company *
Enter company name
Experience *

You're all set!

Begin your success journey!

Sign Up using
Full name *
Email *
Password *

By creating an account, I acknowledge that I have read and agree to InterviewBit’s Terms and Privacy Policy .

Welcome back!

Log In using
Email *
Password *

SQL MCQ With Answers

Begin your success journey!

Sign Up using
Full name *
Email *
Password *

By creating an account, I acknowledge that I have read and agree to InterviewBit’s Terms and Privacy Policy .

Welcome back!

Log In using
Email *
Password *

To get introduced to SQL, we first need to know about Databases and Database Management Systems (DBMS).

Data is basically a collection of facts related to some object. A database is a collection of small units of data arranged in a systematic manner. A Relational Database Management System is a collection of tools that allows the users to manipulate, organize and visualize the contents of a database while following some standard rules that facilitate fast response between the database and the user side.

After getting introduced to the concept of data, databases, and DBMS/RDBMS, we can finally get introduced to SQL. SQL or Structured Query Language is basically the language that we (the user) use to communicate with the Databases and get our required interpretation of data out of it. It is used for storing, manipulating, and retrieving data out of a database.

SQL Features

SQL allows us to interact with the databases and bring out/manipulate data within it. Using SQL, we can create our own databases and then add data into these databases in the form of tables.

The following functionalities can be performed on a database using SQL:

  • Create or Delete a Database.
  • Create or Alter or Delete some tables in a Database.
  • SELECT data from tables.
  • INSERT data into tables.
  • UPDATE data in tables.
  • DELETE data from tables.
  • Create Views in the database.
  • Execute various aggregate functions.

SQL MCQs

1. 

Which of the following are some common RDBMS in use?

2. 

What command is used to create a new table in SQL?

3. 

What does the following statement in SQL do?

DROP TABLE student;
4. 

Which of the following are types of Unicode character string types in SQL?

5. 

What does BLOB in SQL stand for?

6. 

Which of the following datatype is most appropriate for storing a string of up to 255 characters?

7. 

What happens when no value is inserted in an ENUM list?

8. 

What is the range of integers that can be held in the MEDIUMINT datatype of SQL?

9. 

What does the following code snippet do?

ALTER TABLE STUDENT ADD(ADDRESS VARCHAR2(20));
10. 

Which of the following commands is used to delete all rows and free up space from a table?

11. 

Which of the following commands are a part of Data Control Language?

12. 

What does the following code snippet do?

DELETE FROM STUDENTS 
WHERE AGE = 16;  
ROLLBACK;
13. 

When is the wildcard in WHERE clause used?

14. 

Which of the following is the full form of DDL?

15. 

Which SQL constraint do we use to set some value to a field whose value has not been added explicitly?

16. 

What are rows of a relation known as?

17. 

During transaction before commit which of the following statements is done automatically in case of shutdown?

18. 

Which of the following allows you to uniquely identify a tuple?

19. 

How many operations are considered to be the most basic SQL operations?

20. 

Which of the following is not a SQL command?

21. 

What does the following code snippet do?

SELECT TOP 5 * FROM students;
22. 

Which of the following matches the definition given below: It is an artificial key that aims to uniquely identify each record.

23. 

Which of the following commands are used to put a restriction on the number of rows returned from a query?

24. 

Which of the following are valid logical operators in SQL?

25. 

Which of the following SQL functions compares the similarities of 2 strings and returns the result as a 4 character code?

26. 

To select some particular columns, which of the following commands is used?

27. 

Primary key can be?

28. 

Select the valid SQL type.

29. 

Which of the following functions do we use to get a specified day of the month for a given date?

30. 

Which of the following operators is used to compare a value to a list of literal values that have been specified?

31. 

What is a table joined with itself called?

32. 

NATURAL JOIN can also be termed as -

33. 

Which of the following commands is used to delete a trigger in SQL?

34. 

How can we view all the triggers currently in the database?

35. 

Which of the following is known as the minimal super key?

36. 

Select the correct foreign key constraint?

37. 

What is NOLOCK in SQL equivalent to?

38. 

Which of the following can replace the below query?

SELECT Name, ID  
FROM Student, Courses  
WHERE Student_ID = Courses_ID;
39. 

What will be the output of the following code snippet?

SELECT ROUND (TRUNCATE (MOD (2500, 20), -1), 2) FROM dual;
40. 

How can the user change “Scaler” into “Interviewbit” in the “Name” column in the Users table?

41. 

What is the name of the query that is placed within a WHERE or HAVING clause of another query?

42. 

Which is the AS clause used for?

43. 

Which of the following are valid SQL constraints?

44. 

Which of the following is also known as a concatenated key?

45. 

The program which performs some common action on database data and is also stored there is called?

46. 

How can SQL injections occur?

47. 

Which of the following constraints can be defined only at the column level?

48. 

Group of operations that form a single logical unit of work called?

49. 

Identify the concurrency-based protocol?

50. 

Which of the following is not a valid SQL type?

51. 

What is the full form of SQL?

52. 

Which of the following is not a DDL command?

53. 

Which of the following are TCL commands?

54. 

SQL views are also known as?

55. 

Which of the following is not a valid aggregate function?

Your feedback is important to help us improve.