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