Sql Questions MCQs


sql Questions

Total Questions : 84

Page 1 of 5 pages
Question 1. Which of the following SQL query is correct for selecting the name of staffs from 'staffinfo' table where salary is 10,000 or 25,000?
  1.    SELECT name FROM staffinfo WHERE salary BETWEEN 10000 AND 25000;
  2.    SELECT name FROM staffinfo WHERE salary IN (10000, 25000);
  3.    Both A and B
  4.    None of the above
Answer: Option B
Question 2. Select the right statement to insert values to the student table.
  1.    INSERT student VALUES (
  2.    INSERT VALUES (
  3.    INSERT INTO student VALUES (
  4.    INSERT VALUES INTO student (
Answer: Option C
Question 3. ............. joins two or more tables based on a specified column value not equaling a specified column value in another table.
  1.    EQUIJOIN
  2.    NON-EQUIJOIN
  3.    OUTER JOIN
  4.    NATURAL JOIN
Answer: Option B
Question 4. In SQL, which command is used to change a table's storage characteristics?
  1.    ALTER TABLE
  2.    MODIFY TABLE
  3.    CHANGE TABLE
  4.    None of these
Answer: Option A
Question 5. In SQL, which of the following is not a data definition language commands?
  1.    REVOKE
  2.    RENAME
  3.    UPDATE
  4.    GRANT
Answer: Option C
Question 6. 'AS' clause is used in SQL for
  1.    Selection operation.
  2.    Rename operation.
  3.    Join operation.
  4.    Projection operation.
Answer: Option B
Question 7. Count function in SQL returns the number of
  1.    values.
  2.    distinct values.
  3.    groups.
  4.    columns.
Answer: Option A
Question 8. NULL is
  1.    the same as 0 for integer
  2.    the same as blank for character
  3.    the same as 0 for integer and blank for character
  4.    not a value
Answer: Option D
Question 9. Which of the following is a valid SQL type?
  1.    CHARACTER
  2.    NUMERIC
  3.    FLOAT
  4.    All of the above
Answer: Option D
Question 10. What is the full form of SQL?
  1.    Structured Query Language
  2.    Structured Query List
  3.    Simple Query Language
  4.    None of these
Answer: Option A
Question 11. Which is the subset of SQL commands used to manipulate Oracle Database structures, including tables?
  1.    Data Definition Language(DDL)
  2.    Data Manipulation Language(DML)
  3.    Both of above
  4.    None
Answer: Option A
Question 12. Which operator performs pattern matching?
  1.    BETWEEN operator
  2.    LIKE operator
  3.    EXISTS operator
  4.    None of these
Answer: Option B
Question 13. In SQL, which command(s) is(are) used to change a table's storage characteristics?
  1.    ALTER TABLE
  2.    MODIFY TABLE
  3.    CHANGE TABLE
  4.    All of the above
Answer: Option A
Question 14. What operator tests column for the absence of data?
  1.    EXISTS operator
  2.    NOT operator
  3.    IS NULL operator
  4.    None of these
Answer: Option C
Question 15. In SQL, which of the following is not a data definition language commands?
  1.    RENAME
  2.    REVOKE
  3.    GRANT
  4.    UPDATE
Answer: Option D
Question 16. A command that lets you change one or more fields in a record is
  1.    Insert
  2.    Modify
  3.    Look-up
  4.    All of the above
Answer: Option B
Question 17. In SQL, which command is used to SELECT only one copy of each set of duplicable rows
  1.    SELECT DISTINCT
  2.    SELECT UNIQUE
  3.    SELECT DIFFERENT
  4.    All of the above
Answer: Option A
Question 18. Which of the SQL statements is correct?
  1.    SELECT Username AND Password FROM Users
  2.    SELECT Username, Password FROM Users
  3.    SELECT Username, Password WHERE Username = 'user1'
  4.    None of these
Answer: Option B
Question 19. The FROM SQL clause is used to...
  1.    specify what table we are selecting or deleting data FROM
  2.    specify range for search condition
  3.    specify search condition
  4.    None of these
Answer: Option A
Question 20. Which SQL keyword is used to retrieve only unique values?
  1.    DISTINCTIVE
  2.    UNIQUE
  3.    DISTINCT
  4.    DIFFERENT
Answer: Option C