SQL Training Jan13 - Quiz1

21 Questions | Total Attempts: 151

SettingsSettingsSettings
Please wait...
SQL Quizzes & Trivia

Test your basic database skills, RDBMS, DDL, DML, Normalization etc.


Questions and Answers
  • 1. 
    A Multidimensional Cube is a type of a relational database
    • A. 

      True

    • B. 

      False

  • 2. 
    The following table is in 1NF
    • A. 

      True

    • B. 

      False

  • 3. 
    A table in 3NF is already in 1NF and 2NF
    • A. 

      True

    • B. 

      False

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

      Structured Query Language

    • B. 

      Strong Query Language

    • C. 

      Structured Question Language

  • 5. 
    Which SQL keyword is used to extract data from a table
    • A. 

      EXTRACT

    • B. 

      OPEN

    • C. 

      PULL

    • D. 

      SELECT

  • 6. 
    Which SQL keyword is used to update data in a table.
    • A. 

      MODIFY

    • B. 

      UPDATE

    • C. 

      SAVE

    • D. 

      SAVE AS

  • 7. 
    Which SQL keyword is used to insert new data in a table
    • A. 

      ADD NEW

    • B. 

      ADD RECORD

    • C. 

      INSERT NEW

    • D. 

      INSERT INTO

  • 8. 
    How to select all columns from a table Employee
    • A. 

      SELECT * FROM Employee

    • B. 

      SELECT * .Employee

    • C. 

      SELECT * FROM Persons

    • D. 

      SELECT ALL FROM Employee

  • 9. 
    Which SQL statement will select all the rows and columns from the table "Employee" and sort them in descending order by "Salary" column.
    • A. 

      SELECT * FROM Employee ORDER BY EmpID ASC

    • B. 

      SELECT * FROM Employee ORDER BY EmpID DESC

    • C. 

      SELECT * FROM Employee ORDER BY Salary ASC

    • D. 

      SELECT * FROM Employee ORDER BY Salary DESC

  • 10. 
    Which of the following SQL statements is correct and has no syntax errors?
    • A. 

      INSERT INTO Employee (EmpID,Salary) VALUES (2321,25000.99)

    • B. 

      SAVE INTO Employee (EmpID,Salary) VALUES (2321,25000.99)

    • C. 

      UPDATE INTO Employee (EmpID,Salary) VALUES (2321,25000.99)

    • D. 

      INSERT INTO Employee EmpID,Salary VALUES 2321,25000.99

  • 11. 
    SQL statement to delete all rows from a table "Employee".
    • A. 

      REMOVE * FROM Employee

    • B. 

      DELETE ALL FROM Employee

    • C. 

      TRUNCATE TABLE Employee

    • D. 

      DROP TABLE Employee

  • 12. 
    Which of the following statements is/are true for a Primary Key Constraint?
    • A. 

      1. Prevents deletion of the table

    • B. 

      2. Prevents NULL values to be inserted into the Primary Key column

    • C. 

      3. Prevents insertion of duplicate rows

    • D. 

      4. Both 2 & 3

  • 13. 
    A Primary Key can be NULL.
    • A. 

      True

    • B. 

      False

  • 14. 
    Which of the following is/are true for a Foreign Key Constraint?
    • A. 

      Enforces Referential Integrity

    • B. 

      Enforces Parent-Child relationship

    • C. 

      Prevents deletion of Parent table while child table still exists

    • D. 

      Prevents insertion of Foreign Key values into the Child table that do not exist in the Parent table

    • E. 

      All of the above

  • 15. 
    CREATE TABLE Employee ( EmpID INT IDENTITY CONSTRAINT PK_EMP PRIMARY KEY NOT NULL, EmployeeName VARCHAR(20), Salary NUMERIC(10,2)) In the above SQL what is the significance of IDENTITY keyword.
    • A. 

      Enforces Primary Key Constraint

    • B. 

      Makes column not NULL

    • C. 

      Automatically assigns a value to EmpID column when a new row is inserted.

    • D. 

      Doesn't do anything

  • 16. 
    ALTER TABLE Persons ALTER COLUMN PersonName VARCHAR(50) What does the above SQL statement achieve ?
    • A. 

      Changes PersonName datatype from INT to VARCHAR

    • B. 

      Changes PersonName datatype to VARCHAR(50)

    • C. 

      Drops PersonName column from the table

    • D. 

      Insufficient information

  • 17. 
    SELECT EmpID, EmpName FROM Employee WHERE EmpID = 2321 The above SQL statement is a
    • A. 

      DCL Statement

    • B. 

      DDL Statement

    • C. 

      XML Statement

    • D. 

      DML Statement

  • 18. 
    ALTER TABLE Persons ALTER COLUMN PersonName VARCHAR(50) The above statement is a
    • A. 

      HTML Statement

    • B. 

      DDL Statement

    • C. 

      DML Statement

    • D. 

      SQR Statement

  • 19. 
    Which SQL clause is useful in choosing the columns to be displayed in the results?
    • A. 

      WHERE clause

    • B. 

      FROM clause

    • C. 

      SELECT clause

    • D. 

      ORDER BY clause

  • 20. 
    Which SQL clause is useful in limiting the number of rows displayed in the results?
    • A. 

      SELECT clause

    • B. 

      FROM clause

    • C. 

      WHERE clause

    • D. 

      Santa Claus

  • 21. 
    What did you think of the Quiz? (Not graded)
    • A. 

      Very useful

    • B. 

      Somewhat useful

    • C. 

      Too easy

    • D. 

      Only if I had more time.

Related Topics
Back to Top Back to top