The Ultimate Server Query Language Quiz

42 Questions | Total Attempts: 5379

SettingsSettingsSettings
Please wait...
The Ultimate Server Query Language Quiz

A server query language is designed so that users can retrieve specific information from a database. As a software developer you should have some knowledge on the use of such languages. Do you believe you understand SQL completely? Take up the quiz below and be sure about it! All the best and look out for more tests on the topic.


Related Topics
Questions and Answers
  • 1. 
    • A. 

      COUNT()

    • B. 

      NUMBER()

    • C. 

      SUM()

  • 2. 
    The FROM SQL clause is used to…
    • A. 

      specify range for search condition

    • B. 

      Specify search condition

    • C. 

      Specify what table we are selecting or deleting data from.

  • 3. 
    Which of the following is NOT a SQL keyword or SQL clause?
    • A. 

      INSERT

    • B. 

      SELECT

    • C. 

      UPDATE

    • D. 

      INVERT

  • 4. 
    • A. 

      The SELECT clause only

    • B. 

      The DELETE and UPDATE clauses

    • C. 

      The UPDATE clause only

    • D. 

      None of the other three

  • 5. 
    What does DML stand for?
    • A. 

      Different Mode Level

    • B. 

      Data Model Language

    • C. 

      Data Mode Lane

    • D. 

      Data Manipulation language

  • 6. 
    • A. 

      MOST

    • B. 

      MAX

    • C. 

      TOP

    • D. 

      UPPER

  • 7. 
    • A. 

      INSERT INTO Projects (ProjectName, ProjectDescription) VALUES ('Content Development', 'Website content development project')

    • B. 

      SAVE INTO Projects (ProjectName, ProjectDescription) VALUES ('Content Development', 'Website content development project')

    • C. 

      INSERT Projects VALUES ('Content Development', 'Website content development project')

    • D. 

      INSERT Projects ('Content Development', 'Website content development project')

  • 8. 
    Which of the following SQL clauses is used to enter data into a SQL table?
    • A. 

      INSERT INTO

    • B. 

      WRITE

    • C. 

      SELECT

    • D. 

      ENTER

  • 9. 
    Which of the following SQL clauses is used to DELETE data from a database table?
    • A. 

      DELETE

    • B. 

      REMOVE

    • C. 

      DROP DATA

    • D. 

      CLEAR

  • 10. 
    Which of the following SQL statements is correct?
    • A. 

      SELECT CustomerName, COUNT(CustomerName) FROM Orders

    • B. 

      SELECT CustomerName, COUNT(CustomerName) FROM Orders GROUP BY CustomerName

    • C. 

      SELECT CustomerName, COUNT(CustomerName) FROM Orders ORDER BY CustomerName

  • 11. 
    What does SQL stand for?
    • A. 

      Strong Question Language

    • B. 

      Structured Query Language

    • C. 

      Structured Question Language

  • 12. 
    Which SQL statement is used to extract data from a database?
    • A. 

      SELECT

    • B. 

      GET

    • C. 

      OPEN

    • D. 

      EXTRACT

  • 13. 
    Which SQL statement is used to update data in a database?
    • A. 

      SAVE

    • B. 

      SAVE AS

    • C. 

      MODIFY

    • D. 

      UPDATE

  • 14. 
    • A. 

      SELECT Persons.FirstName

    • B. 

      SELECT FirstName FROM Persons

    • C. 

      EXTRACT FirstName FROM Persons

  • 15. 
    With SQL, how do you select all the columns from a table named "Persons"?
    • A. 

      SELECT *.Persons

    • B. 

      SELECT [all] FROM Persons

    • C. 

      SELECT * FROM Persons

    • D. 

      SELECT Persons

  • 16. 
    With SQL, how do you select all the records from a table named "Persons" where the value of the column "FirstName" is "Peter"?
    • A. 

      SELECT * FROM Persons WHERE FirstName'Peter'

    • B. 

      SELECT [all] FROM Persons WHERE FirstName LIKE 'Peter'

    • C. 

      SELECT * FROM Persons WHERE FirstName='Peter'

    • D. 

      SELECT [all] FROM Persons WHERE FirstName='Peter'

  • 17. 
    • A. 

      SELECT * FROM Persons WHERE FirstName='a'

    • B. 

      SELECT * FROM Persons WHERE FirstName LIKE 'a%'

    • C. 

      SELECT * FROM Persons WHERE FirstName LIKE '%a'

    • D. 

      SELECT * FROM Persons WHERE FirstName='%a%'

  • 18. 
    The OR operator displays a record if ANY conditions listed are true. The AND operator displays a record if ALL of the conditions listed are
    • A. 

      False

    • B. 

      True

  • 19. 
    With SQL, how do you select all the records from a table named "Persons" where the "FirstName" is "Peter" and the "LastName" is "Jackson"?
    • A. 

      SELECT * FROM Persons WHERE FirstName='Peter' AND LastName='Jackson'

    • B. 

      SELECT FirstName='Peter', LastName='Jackson' FROM Persons

    • C. 

      SELECT * FROM Persons WHERE FirstName'Peter' AND LastName'Jackson'

  • 20. 
    With SQL, how do you select all the records from a table named "Persons" where the "LastName" is alphabetically between (and including) "Hansen" and "Pettersen"?
    • A. 

      SELECT * FROM Persons WHERE LastName BETWEEN 'Hansen' AND 'Pettersen'

    • B. 

      SELECT * FROM Persons WHERE LastName>'Hansen' AND LastName

    • C. 

      SELECT LastName>'Hansen' AND LastName

  • 21. 
    Which SQL statement is used to return only different values?
    • A. 

      SELECT DISTINCT

    • B. 

      SELECT DIFFERENT

    • C. 

      SELECT UNIQUE

  • 22. 
    Which SQL keyword is used to sort the result-set?
    • A. 

      ORDER BY

    • B. 

      SORT

    • C. 

      ORDER

    • D. 

      SORT BY

  • 23. 
    • A. 

      SELECT * FROM Persons SORT BY 'FirstName' DESC

    • B. 

      SELECT * FROM Persons ORDER FirstName DESC

    • C. 

      SELECT * FROM Persons SORT 'FirstName' DESC

    • D. 

      SELECT * FROM Persons ORDER BY FirstName DESC

  • 24. 
    With SQL, how can you insert a new record into the "Persons" table?
    • A. 

      INSERT INTO Persons VALUES ('Jimmy', 'Jackson')

    • B. 

      INSERT VALUES ('Jimmy', 'Jackson') INTO Persons

    • C. 

      INSERT ('Jimmy', 'Jackson') INTO Persons

  • 25. 
    How can you change "Hansen" into "Nilsen" in the "LastName" column in the Persons table?
    • A. 

      UPDATE Persons SET LastName='Hansen' INTO LastName='Nilsen'

    • B. 

      MODIFY Persons SET LastName='Nilsen' WHERE LastName='Hansen'

    • C. 

      MODIFY Persons SET LastName='Hansen' INTO LastName='Nilsen

    • D. 

      UPDATE Persons SET LastName='Nilsen' WHERE LastName='Hansen'

  • 26. 
    With SQL, how can you delete the records where the "FirstName" is "Peter" in the Persons Table?
    • A. 

      DELETE FROM Persons WHERE FirstName = 'Peter'

    • B. 

      DELETE ROW FirstName='Peter' FROM Persons

    • C. 

      DELETE FirstName='Peter' FROM Persons

  • 27. 
    With SQL, how can you return the number of records in the "Persons" table?
    • A. 

      SELECT COUNT() FROM Persons

    • B. 

      SELECT COLUMNS() FROM Persons

    • C. 

      SELECT COLUMNS(*) FROM Persons

    • D. 

      SELECT COUNT(*) FROM Persons

  • 28. 
    If you don't specify ASC or DESC after a SQL ORDER BY clause, the following is used by default:
    • A. 

      ASC

    • B. 

      DESC

    • C. 

      There is no default value.

  • 29. 
    When inserting data in a table do you always have to specify a list of all column names you are inserting values for?
    • A. 

      No

    • B. 

      Yes

  • 30. 
    Which of the following 3 SQL statements is correct?
    • A. 

      SELECT Username, Password FROM Users

    • B. 

      SELECT Username AND Password FROM Users

    • C. 

      SELECT Username, Password WHERE Username = 'user1'

  • 31. 
    • A. 

      Cursor is acronym for Current Set Of Records and is a database object pointing to a currently selected set of records.

    • B. 

      A cursor is SQL keyword specifying a retrieved data order.

    • C. 

      A blinking vertical line that indicates the location of the next input on the display screen.

  • 32. 
    • A. 

      Definition of the condition to be met for the rows to be returned.

    • B. 

      A list of columns to be selected.

    • C. 

      The name of the table we are selecting from.

  • 33. 
    • A. 

      The SQL ALTER TABLE clause modifies a table definition by altering, adding, or deleting table columns and/or constraints.

    • B. 

      The SQL ALTER TABLE clause is used to insert data into database table.

    • C. 

      THE SQL ALTER TABLE deletes data from database table.

    • D. 

      The SQL ALTER TABLE clause is used to delete a database table.

  • 34. 
    • A. 

      The WHERE and the HAVING clauses are identical

    • B. 

      The HAVING SQL clause condition(s) is applied to all rows in the result set before the WHERE clause is applied (if present). The WHERE clause is used only with SELECT SQL statements and specifies a search condition for an aggregate or a group.

    • C. 

      The WHERE SQL clause condition(s) is applied to all rows in the result set before the HAVING clause is applied (if present). The HAVING clause is used only with SELECT SQL statements and specifies a search condition for an aggregate or a group.

  • 35. 
    • A. 

      The AS SQL clause is used change the name of a column in the result set or to assign a name to a derived column.

    • B. 

      The AS clause is used with the JOIN clause only.

    • C. 

      The AS clause defines a search condition.

  • 36. 
    Can you join a table to itself?
    • A. 

      Yes.

    • B. 

      No.

  • 37. 
    The IN SQL keyword…
    • A. 

      Is used with the DISTINCT SQL keyword only.

    • B. 

      Determines if a value matches any of the values in a list or a sub-query.

    • C. 

      Defines the tables we are selecting or deleting data from

  • 38. 
    • A. 

      Update only one row at a time.

    • B. 

      Update more than one row at a time.

    • C. 

      Delete more than one row at a time.

    • D. 

      Delete only one row at a time..

  • 39. 
    The difference between the DELETE and TRUNCATE SQL clauses is:
    • A. 

      The TRUNCATE clause deletes all rows in a database table, while the DELETE clause can have a WHERE condition and might or might not delete all rows in a table.

    • B. 

      The DELETE clause deletes all rows in a database table, while the TRUNCATE clause can have a WHERE condition and might or might not delete all rows in a table.

    • C. 

      The TRUNCATE clause is identical to the DELETE clause

  • 40. 
    The LIKE SQL keyword is used along with ...
    • A. 

      WHERE clause.

    • B. 

      GROUP BY clause.

    • C. 

      ORDER BY clause.

    • D. 

      JOIN clause.

  • 41. 
    • A. 

      SELECT ADD(Price) FROM Sales

    • B. 

      SELECT SUM(Price) FROM Sales

    • C. 

      SELECT TOTAL(Price) FROM Sales

    • D. 

      SELECT SUM(Price) WHERE Sales

  • 42. 
    • A. 

      SELECT AVG(OrderNumber) FROM Sales

    • B. 

      SELECT COUNT(*) FROM Sales

    • C. 

      SELECT SUM(OrderNumber) FROM Sales