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 -- {...}.

    View Answer

    Workspace

    Discuss Discuss in Forum


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

  4. A.

     file

    B.

     report

    C.

     table

    D.

     form

    View Answer

    Workspace

    Discuss Discuss in Forum


  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.

    View Answer

    Workspace

    Discuss Discuss in Forum


  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.

    View Answer

    Workspace

    Discuss Discuss in Forum


  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.

    View Answer

    Workspace

    Discuss Discuss in Forum


  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.

    View Answer

    Workspace

    Discuss Discuss in Forum


  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.

    View Answer

    Workspace

    Discuss Discuss in Forum


  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.

    View Answer

    Workspace

    Discuss Discuss in Forum


  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

    View Answer

    Workspace

    Discuss Discuss in Forum


  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%';

    View Answer

    Workspace

    Discuss Discuss in Forum