SQL Multiple Choice Questions With Answers

20 Questions | Total Attempts: 2343

SettingsSettingsSettings
SQL Multiple Choice Questions With Answers - Quiz

Are you looking for some SQL multiple-choice questions with answers to make your preparation level better for the upcoming exam? Try our quiz below and see if you know the basics of SQL programming language or not. SQL is the full form of the structured query language designed to work with databases. If you know the basics of SQL, this quiz will not be easy for you. You can test your SQL skills with us by taking the test. Go for it, then!


Questions and Answers
  • 1. 
    Which commands are used to define or redefine schema objects? 
    • A. 

      DDL

    • B. 

      DML

    • C. 

      TCL

    • D. 

      (a) & (b) both

  • 2. 
    Which is a valid CREATE TABLE statement? 
    • A. 

      Create table emp add(id integer(3));

    • B. 

      Create table emp (id integers(3));

    • C. 

      Create table emp modified (id integer(3));

    • D. 

      Create table emp (id integer(3));

  • 3. 
    How can you insert a new row into the “STORE” table. 
    • A. 

      INSERT ROW (1,‟ RAM SINGH‟) INTO STORE;

    • B. 

      INSERT VALUES (1,‟ RAM SINGH‟) INTO STORE;

    • C. 

      INSERT INTO (1,‟ RAM SINGH‟) STORE;

    • D. 

      INSERT INTO STORE VALUES (1,‟ RAM SINGH‟);

  • 4. 
    Conditionally retrieval of rows from a table with SELECT, which clause is used? 
    • A. 

      Where

    • B. 

      Having

    • C. 

      Group By

    • D. 

      Order by

  • 5. 
    The ……………. key word eliminates duplicate rows from the result of a SELECT statement. 
    • A. 

      All

    • B. 

      Unique

    • C. 

      Distinct

    • D. 

      IN

  • 6. 
    Which operator defines a range of values that the column values must fall in? 
    • A. 

      In

    • B. 

      Like

    • C. 

      Between

    • D. 

      IS

  • 7. 
    To specify a list of values …………. Operator is used. 
    • A. 

      IN

    • B. 

      Like

    • C. 

      Between

    • D. 

      IS

  • 8. 
    Which SQL statement will not generate any error message? 
    • A. 

      SELECT * FROM EMP WHERE EMPNO LIKE (1,2,3,4);

    • B. 

      SELECT * FROM EMP WHERE SAL BETWEEN 3000 TO 15000;

    • C. 

      SELECT * FROM EMP WHERE COMM IS NOT NULL;

    • D. 

      All of the above

  • 9. 
    Which statement is valid? 
    • A. 

      ALTER TABLE EMPLOYEE MODIFY (last_name CHAR2(2000));

    • B. 

      ALTER TABLE EMPLOYEE CHANGE (last_name CHAR2(2000));

    • C. 

      ALTER TABLE EMPLOYEE CHANGE (last_name VARCHAR2 (2000));

    • D. 

      ALTER TABLE EMPLOYEE MODIFY (last_name VARCHAR2 (2000));

  • 10. 
    The clause which sorts data of table.
    • A. 

      Group by clause

    • B. 

      Having clause

    • C. 

      Order by Clause

    • D. 

      Where Clause

  • 11. 
    Which of the following commands should be used to create a database named “student”?
    • A. 

      CREATE ?I student

    • B. 

      CREATE DATABASE student

    • C. 

      DATABASE /student

    • D. 

      DATABASE student

  • 12. 
    Which one will delete the table data as well as table structure?
    • A. 

      DROP

    • B. 

      TRUNCATE

    • C. 

      Alter

    • D. 

      Delete

  • 13. 
    Full form of RDBMS is
    • A. 

      Regional district management system

    • B. 

      Relational database management system

    • C. 

      Regular database management system

    • D. 

      Regular district machine system

  • 14. 
    The USE command?
    • A. 

      Is used to load code from another file

    • B. 

      Has been deprecated and should be avoided for security reasons

    • C. 

      Is a pseudonym for the SELECT command

    • D. 

      Should be used to choose the database you want to use once you've connected to MySQL

  • 15. 
    A row of relation generally referred to as ……….. and column of a relation is ………… 
    • A. 

      Domain & Attribute

    • B. 

      Attribute & Domain

    • C. 

      Tuple & Attribute

    • D. 

      Attribute & Tuple

  • 16. 
    A relation has 45 tuples & 5 attributes, what will be the Degree & Cardinality of that relation? 
    • A. 

      Degree 5, Cardinality 45

    • B. 

      Degree 45, Cardinality 5

    • C. 

      Degree 50, Cardinality 45

    • D. 

      Degree 50, Cardinality 2250

  • 17. 
    We use …………… operator with select for condition based on pattern matching.
    • A. 

      IN

    • B. 

      LIKE

    • C. 

      BETWEEN

    • D. 

      IS

  • 18. 
    To display the detail of employee having „e‟ in their name in descending order of salary the correct SQL statement is :
    • A. 

      SELECT * FROM emp WHERE ename LIKE „e%‟ ORDER BY SAL ;

    • B. 

      SELECT * FROM emp ORDER BY SAL DESCWHERE ename LIKE „%e%‟;

    • C. 

      SELECT * FROM emp WHERE ename LIKE „%e%‟ ORDER BY DESCSAL;

    • D. 

      SELECT * FROM emp WHERE ename LIKE „%e%‟ ORDER BY SAL DESC;

  • 19. 
    _________is the attribute or group of attributes that uniquely identify occurrence of each entity.
    • A. 

      Foreign key

    • B. 

      Super Key

    • C. 

      Primary Key

    • D. 

      All of these

  • 20. 
    A non-key attribute, whose values are derived from primary key of some other table. 
    • A. 

      Alternate key

    • B. 

      Foreign key

    • C. 

      Primary key

    • D. 

      Super Key

Related Topics
Back to Top Back to top
×

Wait!
Here's an interesting quiz for you.

We have other quizzes matching your interest.