Home / CSE / SQL Basics :: section-1

CSE :: SQL Basics

  1. A subquery in an SQL SELECT statement is enclosed in:

  2. A.

     parenthesis -- (...).

    B.

     brackets -- [...].

    C.

     CAPITAL LETTERS.

    D.

     braces -- {...}.


  3. The result of a SQL SELECT statement is a ________ .

  4. A.

     file

    B.

     report

    C.

     table

    D.

     form


  5. In an SQL SELECT statement querying a single table, according to the SQL-92 standard the asterisk (*) means that:

  6. A.

     all columns of the table are to be returned.

    B.

     all records meeting the full criteria are to be returned.

    C.

     all records with even partial criteria met are to be returned.

    D.

     None of the above is correct.


  7. The HAVING clause does which of the following?

  8. A.

     Acts EXACTLY like a WHERE clause.

    B.

     Acts like a WHERE clause but is used for columns rather than groups.

    C.

     Acts like a WHERE clause but is used for groups rather than rows.

    D.

     Acts like a WHERE clause but is used for rows rather than columns.


  9. Which of the following do you need to consider when you make a table in SQL?

  10. A.

     Data types

    B.

     Primary keys

    C.

     Default values

    D.

     All of the above.


  11. When three or more AND and OR conditions are combined, it is easier to use the SQL keyword(s):

  12. A.

     NOT IN only.

    B.

     LIKE only.

    C.

     IN only.

    D.

     Both IN and NOT IN.


  13. SQL can be used to:

  14. A.

     create database structures only.

    B.

     query database data only.

    C.

     modify database data only.

    D.

     All of the above can be done by SQL.


  15. The SQL keyword BETWEEN is used:

  16. A.

     to limit the columns displayed.

    B.

     for ranges.

    C.

     as a wildcard.

    D.

     None of these is correct.


  17. Which of the following query is correct for using comparison operators in SQL?

  18. A.

     SELECT name, course_name FROM student WHERE age>50 and <80;

    B.

     SELECT name, course_name FROM student WHERE age>50 and age <80;

    C.

     SELECT name, course_name FROM student WHERE age>50 and WHERE age<80;

    D.

     None of these


  19. How to select all data from student table starting the name from letter 'r'?

  20. A.

     SELECT * FROM student WHERE name LIKE 'r%';

    B.

     SELECT * FROM student WHERE name LIKE '%r%';

    C.

     SELECT * FROM student WHERE name LIKE '%r';

    D.

     SELECT * FROM student WHERE name LIKE '_r%';