Home
MCQS
SQL MCQ Quiz Hub
SQL MCQ SET 18
Choose a topic to test your knowledge and improve your SQL skills
1. What is the full form of SQL?
Structured Query List
Structure Query Language
Sample Query Language
None of these.
2. Which of the following is not a valid SQL type?
FLOAT
NUMERIC
DECIMAL
CHARACTER
3. Which of the following is not a DDL command?
TRUNCATE
ALTER
CREATE
UPDATE
4. Which of the following are TCL commands?
COMMIT and ROLLBACK
UPDATE and TRUNCATE
SELECT and INSERT
GRANT and REVOKE
5. Which statement is used to delete all rows in a table without having the action logged?
DELETE
REMOVE
DROP
TRUNCATE
6. SQL Views are also known as
Simple tables
Virtual tables
Complex tables
Actual Tables
7. How many Primary keys can have in a table?
Only 1
Only 2
Depends on no of Columns
Depends on DBA
8. Which datatype can store unstructured data in a column?
CHAR
RAW
NUMERIC
VARCHAR
9. Which of the following is not Constraint in SQL?
Primary Key
Not Null
Check
Union
10. Which of the following is not a valid aggregate function?
COUNT
COMPUTE
SUM
MAX
11. Which data manipulation command is used to combines the records from one or more tables?
SELECT
PROJECT
JOIN
PRODUCT
12. Which operator is used to compare a value to a specified list of values?
ANY
BETWEEN
ALL
IN
13. What operator tests column for absence of data
NOT Operator
Exists Operator
IS NULL Operator
None of the above
14. In which of the following cases a DML statement is not executed?
When existing rows are modified.
When a table is deleted.
When some rows are deleted.
All of the above
15. If we have not specified ASC or DESC after a SQL ORDER BY clause, the following is used by default
DESC
ASC
There is no default value
None of the mentioned
16. A command that lets you change one or more field in a table is:
INSERT
MODIFY
LOOK-UP
All of the above
17. Which of the following is also called an INNER JOIN?
SELF JOIN
EQUI JOIN
NON-EQUI JOIN
None of the above
18. Which of the following is true about the HAVING clause?
Similar to the WHERE clause but is used for columns rather than groups.
Similar to WHERE clause but is used for rows rather than columns.
Similar to WHERE clause but is used for groups rather than rows.
Acts exactly like a WHERE clause.
19. ______ clause creates temporary relation for the query on which it is defined.
WITH
FROM
WHERE
SELECT
20. The SQL statement: SELECT ROUND (65.726, -1) FROM DUAL; Prints:
is illegal
garbage
726
70
21. Which of the following is true about the SQL AS clause?
The AS clause in SQL is used to change the column name in the output or assign a name to a derived column.
The SQL AS clause can only be used with the JOIN clause.
The AS clause in SQL is used to defines a search condition.
All of the mentioned
22. ____ command makes the updates performed by the transaction permanent in the database?
ROLLBACK
COMMIT
TRUNCATE
DELETE
23. Which command is used to change the definition of a table in SQL?
CREATE
UPDATE
ALTER
SELECT
24. Which type of JOIN is used to returns rows that do not have matching values?
Natural JOIN
Outer JOIN
EQUI JOIN
All of the above
25. A CASE SQL statement is ________?
A way to establish a loop in SQL.
A way to establish an IF-THEN-ELSE in SQL
A way to establish a data definition in SQL
All of the above.
26. Which statement is true regarding routines and triggers?
Both run automatically.
Both are stored in the database.
Both consist of procedural code.
Both have to be called to operate.
27. Which statement is true regarding procedures?
They include procedural and SQL statements.
They work similarly to the functions.
It does not need unique names.
It cannot be created with SQL statements.
28. Which of the following is the basic approaches for joining tables?
Union JOIN
Natural JOIN
Subqueries
All of the above
29. Why we need to create an index if the primary key is already present in a table?
Index improves the speed of data retrieval operations on a table.
Indexes are special lookup tables that will be used by the database search engine.
Indexes are synonyms of a column in a table.
All of the above
30. Group of operations that form a single logical unit of work is known as
View
Network
Unit
Transaction
31. Shared locks are applied while performing
Read operations
Write operations
A & B both
None of the above
32. Sequence can generate
Numeric value
Alphanumeric value
A & B both
None of the above
33. A sequence in SQL can generate a maximum number:
39 digits
38 digits
40 digits
37 digits
34. Which of the following is the correct order of a SQL statement?
SELECT, GROUP BY, WHERE, HAVING
SELECT, WHERE, GROUP BY, HAVING
SELECT, HAVING, WHERE, GROUP BY
SELECT, WHERE, HAVING, GROUP BY
35. What is the difference between a PRIMARY KEY and a UNIQUE KEY?
Primary key can store null value, whereas a unique key cannot store null value.
We can have only one primary key in a table while we can have multiple unique keys
Primary key cannot be a date variable whereas unique key can be
None of these
36. Which operator is used to compare the NULL values in SQL?
Equal
IN
IS
None of Above
37. When the wildcard in a WHERE clause is useful?
When an exact match is required in a SELECT statement.
When an exact match is not possible in a SELECT statement.
When an exact match is required in a CREATE statement.
When an exact match is not possible in a CREATE statement.
38. _____ is NOT a type of constraint in SQL language?
FOREIGN KEY
PRIMARY KEY
UNIQUE
ALTERNATE KEY
39. ______ is a program that performs some common action on database data and also stored in the database.
Stored Procedure
Trigger
Stored Function
None of the above
40. What is the advantage of the clustered index?
It is fast to update the records.
It does not need extra work for SQL queries.
It minimizes the page transfer and maximizes the cache hits.
None of the above is correct.
41. Which of the following are the DATETIME data types that can be used in column definitions?
TIMESTAMP
INTERVAL MONTH TO DAY
INTERVAL YEAR TO MONTH
TIMESTAMP WITH DATABASE TIMEZONE
42. Which data dictionary table can be used to show the object privileges granted to the user on specific columns?
USER_TAB_PRIVS_MADE
USER_COL_PRIVS_MADE
USER_TAB_PRIVS
USER_COL_PRIVS
43. What is the need for our query to execute successfully on an existing view?
The specified table must contain data.
We must have a SELECT privilege on the view.
We should have a SELECT privilege only on the specified table.
The specified table must be in the same database or schema.
44. Which of the following operator can be used with a multiple-row subquery?
=
BETWEEN
NOT IN
<>
Submit