Oracle Test2

10 Questions | Total Attempts: 1384

SettingsSettingsSettings
Please wait...
Oracle Quizzes & Trivia

This exam is used to Test your DDL and DML Knowledge


Questions and Answers
  • 1. 
    • A. 

      INSERT INTO employees VALUES (NULL, 'JOHN','Smith');

    • B. 

      INSERT INTO employees( first_name, last_name) VALUES ('JOHN','Smith');

    • C. 

      INSERT INTO employees VALUES ('1000','JOHN','NULL');

    • D. 

      INSERT INTO employees(first_name,last_name, employee_id) VALUES ('1000, 'john','Smith');

    • E. 

      INSERT INTO employees (employee_id, first_name, last_name) VALUES ( 1000, 'john',");

  • 2. 
    You added a PHONE_NUMBER column of NUMBER data type to an existing EMPLOYEES table. The EMPLOYEES table already contains records of 100 employees. Now, you want to enter the phone numbers of each of the 100 employees into the table. Some of the employees may not have a phone number available. Which data manipulation operation do you perform?
    • A. 

      MERGE

    • B. 

      INSERT

    • C. 

      UPDATE

    • D. 

      ADD

    • E. 

      You cannot enter the phone numbers for the existing employee records.

  • 3. 
    On the EMPLOYEES table, EMPLOYEE_ID is the primary key. MGR_ID is the ID of managers and refers to the EMPLOYEE_ID. The JOB_ID column is a NOT NULL column. Evaluate this DELETE statement: DELETE employee_id, salary, job_id FROM employees WHERE dept_id = 90; Why does the DELETE statement fail when you execute it?
    • A. 

      There is no row with dept_id 90 in the EMPLOYEES table.

    • B. 

      You cannot delete the JOB_ID column because it is a NOT NULL column

    • C. 

      You cannot specify column names in the DELETE clause of the DELETE statement.

    • D. 

      You cannot delete the EMPLOYEE_ID column because it is the primary key of the table.

  • 4. 
    From SQL*Plus, you issue this SELECT statement: SELECT* FROM order; You use this statement to retrieve data from a data table for __________.
    • A. 

      Updating

    • B. 

      Viewing

    • C. 

      Deleting

    • D. 

      Inserting

    • E. 

      Truncating

  • 5. 
    What does the TRUNCATE statement do?
    • A. 

      Removes the table

    • B. 

      Removes all rows from a table

    • C. 

      Shortens the table to 10 rows

    • D. 

      Removes all columns from a table

    • E. 

      Removes foreign keys from a table

  • 6. 
    The EMPLOYEES table has these columns: LAST NAME VARCHAR2(35) SALARY NUMBER(8,2) HIRE_DATE DATE Management wants to add a default value to the SALARY column. You plan to alter the table by using this SQL statement: ALTER TABLE EMPLOYEES MODIFY ( SALARY DEFAULT 5000); What is true about your ALTER statement?
    • A. 

      Column definitions cannot be altered to add DEFAULT values

    • B. 

      A change to the DEFAULT value affects only subsequent insertions to the table.

    • C. 

      Column definitions cannot be altered at add DEFAULT values for columns with a NUMBER data type.

    • D. 

      All the rows that have a NULL value for the SALARY column will be updated with the value 5000.

  • 7. 
    You own a table called EMPLOYEES with this table structure: EMPLOYEE_ID NUMBER Primary Key FIRST_NAME VARCHAR2(25) LAST_NAME VARCHAR2(25) HIRE_DATE DATE What happens when you execute this DELETE statement? DELETE employees;
    • A. 

      You get an error because of a primary key violation

    • B. 

      The data and structure of the EMPLOYEES table are deleted.

    • C. 

      The data in the EMPLOYEES table is deleted but not the structure

    • D. 

      You get an error because the statement is not syntactically correct

  • 8. 
    A data manipulation language statement
    • A. 

      Completes a transaction on a table

    • B. 

      Modifies the structure and data in a table

    • C. 

      Modifies the data but not the structure of a table

    • D. 

      Modifies the structure but not the data of a table

  • 9. 
    Examine the structure of the EMPLOYEES table: EMPLOYEE_ID NUMBER Primary Key FIRST_NAME VARCHAR2 (25) LAST_NAME VARCHAR2 (25) HIRE_DATE DATE     Which UPDATE statement is valid?
    • A. 

      UPDATE employees SET first_name = 'John' SET last_name = 'Smith' WHERE employee_id = 180;

    • B. 

      UPDATE employees SET first_name = 'John',SET last_name = 'Smoth' WHERE employee_id = 180;

    • C. 

      UPDATE employee SET first_name = 'John' AND last_name = 'Smith' WHERE employee_id = 180;

    • D. 

      UPDATE employee SET first_name = 'John', last_name = 'Smith' WHERE employee_id = 180;

  • 10. 
    Which of these commands removes the largest number of rows from the table? Assume that the table and all columns exist and that there are no constraint issues involved
    • A. 

      DELETE FROM MOVIE;

    • B. 

      *DELETE ALL FROM MOVIE;

    • C. 

      TRUNCATE MOVIE;

    • D. 

      TRUNCATE TABLE MOVIE;

    • E. 

      All of the above remove the same number of rows.