Practice
Resources
Contests
Online IDE
New
Free Mock
Events New Scaler
Practice
Improve your coding skills with our resources
Contests
Compete in popular contests with top coders
logo
Events
Attend free live masterclass hosted by top tech professionals
New
Scaler
Explore Offerings by SCALER

SQL MCQ With Answers

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.

Useful Resources

SQL MCQs

Events | Powered By
Certificate included
About the Speaker
What will you Learn?
Register Now
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?

Excel at your interview with Masterclasses Know More
Certificate included
What will you Learn?
Your feedback is important to help us improve.
Free Mock Assessment
Fill up the details for personalised experience.
All fields are mandatory
Current Employer *
Enter company name *
Graduation Year *
Select an option *
1993
1994
1995
1996
1997
1998
1999
2000
2001
2002
2003
2004
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
2025
2026
2027
2028
Phone Number *
OTP will be sent to this number for verification
+1 *
+1
Change Number
Phone Number *
OTP will be sent to this number for verification
+1 *
+1
Change Number
Graduation Year *
Graduation Year *
1993
1994
1995
1996
1997
1998
1999
2000
2001
2002
2003
2004
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
2025
2026
2027
2028
*Enter the expected year of graduation if you're student
Current Employer *
Company Name *
Please verify your phone number
Edit
Resend OTP
By clicking on Start Test, I agree to be contacted by Scaler in the future.
Already have an account? Log in
Free Mock Assessment
Instructions from Interviewbit
Start Test