SQL Test For Mappers

10 Questions | Attempts: 257
Share

SettingsSettingsSettings
SQL Quizzes & Trivia

Dear All,This quiz contains 10 quesions on SQL. Thought these quizzes will help us keep involved in some constructive work. If its ok to all the next one would be Unix followed by systems like MICA,BPI,FLEXCAB and CR'S


Questions and Answers
  • 1. 
    1. What does SQL stand for?
    • A. 

      Structured Question Language

    • B. 

      Structured Query Language

    • C. 

      Strong Question Language

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

      SELECT

    • B. 

      EXTRACT

    • C. 

      GET

    • D. 

      OPEN

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

      MODIFY

    • B. 

      SAVE

    • C. 

      UPDATE

    • D. 

      SAVE AS

  • 4. 
    Which SQL statement is used to delete data from a database?
    • A. 

      REMOVE

    • B. 

      COLLAPSE

    • C. 

      DELETE

  • 5. 
    Which SQL statement is used to insert new data in a database?
    • A. 

      INSERT NEW

    • B. 

      ADD NEW

    • C. 

      INSERT INTO

    • D. 

      ADD RECORD

  • 6. 
    With SQL, how do you select all the records from a table named "Persons" where the value of the column "FirstName" starts with an "a"?
    • A. 

      SELECT * FROM Persons WHERE FirstName LIKE 'a%'

    • B. 

      SELECT * FROM Persons WHERE FirstName LIKE '%a'

    • C. 

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

    • D. 

      SELECT * FROM Persons WHERE FirstName='a'

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

      SELECT DIFFERENT

    • B. 

      SELECT UNIQUE

    • C. 

      SELECT DISTINCT

    • D. 

      SELECT ALL

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

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

    • B. 

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

    • C. 

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

    • D. 

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

  • 9. 
    The Person table has the following structure :Last_Name Varchar2(30);Salary number(8,2);Commision_PCT number (5,2).You want to display the name and the annual salary multiplied by the commission_pct for all the employees. and the annual commission.Additionally records that have a null value for Commision_PCT a zero must be displayed against the calculated column.Which SQL statement display the desired results?
    • A. 

      Select Last_Name,(salary*12)*NVL(Commision_PCT,0) FROM Person

    • B. 

      Select Last_Name,(salary*12)*NVL2(Commision_PCT,0) FROM Person

    • C. 

      Select Last_Name,(salary*12)* ifnull(Commision_PCT,0) FROM Person

    • D. 

      Select Last_Name,(salary*12)*NVL(Commision_PCT,0) FROM Person

  • 10. 
    Examine the data in the EMPLOYEES table:  LAST_NAME              DEPARTMENT_ID             SALARY  Getz                                 10                                        3000  Davis                               20                                         1500  King                                20                                          2200  Davis                              30                                          5000 ...  Which of these Subqueries work?
    • A. 

      SELECT * FROM employees where salary > (SELECT MIN(salary) FROM employees GROUP BY department.id);

    • B. 

      B. SELECT * FROM employees WHERE salary = (SELECT AVG(salary) FROM employees GROUP BY department_id);

    • C. 

      SELECT distinct department_id FROM employees Where salary > ANY (SELECT AVG(salary) FROM employees GROUP BY department_id);

    • D. 

      D. SELECT department_id FROM employees WHERE SALARY > (SELECT AVG(salary) FROM employees GROUP BY department_id);

Related Topics

Back to Top Back to top
×

Wait!
Here's an interesting quiz for you.

We have other quizzes matching your interest.