SQL MCQ
SQL MCQ
A. Oracle
B. MySQL
C. HeidiSQL
D. All of the above
A. CREATE TABLE
B. BUILD TABLE
C. GENERATE TABLE
D. None of the above
4. Which of the following are types of Unicode character string types in SQL?
A. nchar
B. ntext
C. Both A and B
D. None of the above
A. TEXT
B. TINY TEXT
C. BLOB
D. BINARY
8. What is the range of integers that can be held in the MEDIUMINT datatype of
SQL?
10. Which of the following commands is used to delete all rows and free up space
from a table?
A. TRUNCATE
B. DROP
C. DELETE
D. ALTER
11. Which of the following commands are a part of Data Control Language?
A. Revoke
B. Grant
C. Both A and B
D. None of the above
15. Which SQL constraint do we use to set some value to a field whose value has
not been added explicitly?
A. UNIQUE
B. NOT NULL
C. DEFAULT
D. CHECK
A. Degree
B. Entity
C. Tuple
D. None
17. During transaction before commit which of the following statements is done
automatically in case of shutdown?
A. Rollback
B. Commit
C. View
D. Flashback
A. Schema
B. Attribute
C. Super key
D. Domain
19. How many operations are considered to be the most basic SQL operations?
A. 4
B. 3
C. 2
D. 1
20. Which of the following is not a SQL command?
A. DEL
B. ORDER BY
C. SELECT
D. WHERE
22. Which of the following matches the definition given below: It is an artificial
key that aims to uniquely identify each record.
A. Primary Key
B. Foreign Key
C. Surrogate Key
D. Composite Key
23. Which of the following commands are used to put a restriction on the number
of rows returned from a query?
A. LIMIT
B. LIKE
C. WHERE
D. GROUP BY
A. SOME
B. ALL
C. AND
D. All of the above
A. DROP
B. DELETE
C. ALTER
D. None of the above
28. Which of the following SQL functions compares the similarities of 2 strings
and returns the result as a 4 character code?
A. SOUNDEX
B. DIFFERENCE
C. CONCAT
D. None of the above
29. Which of the following operators is used to compare a value to a list of literal
values that have been specified?
A. ANY
B. BETWEEN
C. IN
D. ALL
A. NUMERIC
B. DECIMAL
C. CHARACTER
D. None of the above
31. Which of the following constraints can be defined only at the column level?
A. UNIQUE
B. NOT NULL
C. CHECK
D. PRIMARY KEY
A. count()
B. Sum()
C. Avg()
D. None of the above
33. Which of the following is not a DDL command?
A. REVOKE
B. GRANT
C. UPDATE
D. RENAME
A. Primary key
B. Foreign key
C. Candidate key
D. None of the above
36. Which of the following functions do we use to get a specified day of the
month for a given date?
A. DAY
B. DATEPART
C. GETDATE
D. CURRENT_TIMESTAMP
A. NUMERIC
B. CHARACTER
C. FLOAT
D. All of the above
38. Group of operations that form a single logical unit of work called?
A. Network
B. Unit
C. Transaction
D. None of the above
41. How can we view all the triggers currently in the database?
A. SHOW
B. VIEW
C. READ
D. None of the above
A. NULL
B. NOT NULL
C. Both NULL and NOT NULL
D. Depends on situation
45. The program which performs some common action on database data and is
also stored there is called?
A. Trigger
B. Stored Procedure
C. Stored Function
D. None of the above
A. Referential integrity
B. Entity integrity
C. Domain integrity
D. None of the above
A. Schema
B. Virtual Table
C. Instance
D. None of the above
48.To select some particular columns, which of the following commands is used?
A. PROJECTION
B. SELECTION
C. JOIN
D. UNION
A. Join
B. Self-join
C. Outer join
D. None of the above
A. WRITE UNCOMMITTED
B. READ COMMITTED
C. WRITE COMMITTED
D. READ UNCOMMITTED
52.What is the name of the query that is placed within a WHERE or HAVING
clause of another query?
A. Multi query
B. Subquery
C. Super query
D. Master query
A. Rename
B. Selection
C. Join
D. Projection
A. ROLLBACK
B. SAVEPOINT
C. Both A and B
D. None of the above