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
- DBMS Interview
- SQL Cheat Sheet
- SQL Queries
- Database Testing
- Complete Technical Interview Guide
- SQL Books
- SQL Projects
- SQL IDEs
- SQL Commands
- Learn SQL
- Difference Between Alter and Update
SQL MCQs
Which of the following are some common RDBMS in use?
What command is used to create a new table in SQL?
What does the following statement in SQL do?
DROP TABLE student;
Which of the following are types of Unicode character string types in SQL?
What does BLOB in SQL stand for?
Which of the following datatype is most appropriate for storing a string of up to 255 characters?
What happens when no value is inserted in an ENUM list?
What is the range of integers that can be held in the MEDIUMINT datatype of SQL?
What does the following code snippet do?
ALTER TABLE STUDENT ADD(ADDRESS VARCHAR2(20));
Which of the following commands is used to delete all rows and free up space from a table?
Which of the following commands are a part of Data Control Language?
What does the following code snippet do?
DELETE FROM STUDENTS
WHERE AGE = 16;
ROLLBACK;
When is the wildcard in WHERE clause used?
Which of the following is the full form of DDL?
Which SQL constraint do we use to set some value to a field whose value has not been added explicitly?
What are rows of a relation known as?
During transaction before commit which of the following statements is done automatically in case of shutdown?
Which of the following allows you to uniquely identify a tuple?
How many operations are considered to be the most basic SQL operations?
Which of the following is not a SQL command?
What does the following code snippet do?
SELECT TOP 5 * FROM students;
Which of the following matches the definition given below: It is an artificial key that aims to uniquely identify each record.
Which of the following commands are used to put a restriction on the number of rows returned from a query?
Which of the following are valid logical operators in SQL?
Which of the following commands is used to delete a trigger in SQL?
Which of the following can replace the below query?
SELECT Name, ID
FROM Student, Courses
WHERE Student_ID = Courses_ID;
What will be the output of the following code snippet?
SELECT ROUND (TRUNCATE (MOD (2500, 20), -1), 2) FROM dual;
Which of the following SQL functions compares the similarities of 2 strings and returns the result as a 4 character code?
Which of the following operators is used to compare a value to a list of literal values that have been specified?
Which of the following is not a valid SQL type?
Which of the following constraints can be defined only at the column level?
Which of the following is not a valid aggregate function?
Which of the following is not a DDL command?
Which of the following is known as the minimal super key?
Which of the following is also known as a concatenated key?
Which of the following functions do we use to get a specified day of the month for a given date?
Select the valid SQL type.
Group of operations that form a single logical unit of work called?
How can SQL injections occur?
How can the user change “Scaler” into “Interviewbit” in the “Name” column in the Users table?
How can we view all the triggers currently in the database?
Identify the concurrency-based protocol?
NATURAL JOIN can also be termed as -
Primary key can be?
The program which performs some common action on database data and is also stored there is called?
Select the correct foreign key constraint?
Which of the following are valid SQL constraints?
SQL views are also known as?
To select some particular columns, which of the following commands is used?
What is a table joined with itself called?
What is NOLOCK in SQL equivalent to?
What is the full form of SQL?
What is the name of the query that is placed within a WHERE or HAVING clause of another query?
Which is the AS clause used for?
Which of the following are TCL commands?