GoConqr has a new look! Let us know what you think.

Quiz

SQL Test

rahim.ali 9 questions

Take the quiz

This quiz has a time limit, so it opens in the usual player.

Questions in this quiz (9)

  1. 1Which of the following code would grant the role student_admin to a user named william?
    1. AA - grant student_admin to william;
    2. BB - grant to william student_admin;
    3. CC - grant william student_admin;
    4. DD - None of the above.
  2. 2Select the right query for retrieving records from the tables HONOURS_SUBJECT and LOCATIONS with a right outer join
    HONOURS_SUBJECT(subject_code, subject_name, department_head);
    LOCATIONS(subject_code, department_name, location_id, city);
    1. AA - select h.subject_name, l.department_name, h.department_head, l.city from honours_subject h on right outer join location l where(h.subject_code = l.subject_code);
    2. BB - select h.subject_name, l.department_name, h.department_head, l.city from honours_subject h outer join location l on(subject_code);
    3. CC - select h.subject_name, l.department_name, h.department_head, l.city from honours_subject h right outer join location l on(h.subject_code = l.subject_code);
    4. DD - None of the above.
  3. 3Q - Which of the following code will remove all the rows from the table LOCATIONS?

    1. AA - DROP TABLE locations;
    2. BB - DELETE TABLE locations;
    3. CC - TRUNCATE TABLE locations;
    4. DD - None of the above.
  4. 4Which of the following is not true about modifying rows in a table?

    1. AA - Existing rows in a table are modified using the UPDATE statement.
    2. BB - You can update more than one row at a time.
    3. CC - All the rows in a table are modified if you omit the WHERE clause.
    4. DD - None of the above.
  5. 5Consider the following schema −
    STUDENTS(student_code, first_name, last_name, email,
    phone_no, date_of_birth, honours_subject, percentage_of_marks);
    Which of the following query would display the distinct honours subjects in the STUDENTS table?
    1. AA - select honours_subject from students;
    2. BB - select distinct honours_subject from students;
    3. CC - select all honours_subject from students;
    4. DD - select * from students;
  6. 6Q 12 - Which of the following is not a character manipulation function?
    1. AA - concat
    2. BB - substr
    3. CC - instr
    4. DD - coalesce
  7. 7Q 14 - Which of the following is true about inserting news rows to a table?
    1. AA - You must list values in the default order of the columns in the table.
    2. BB - You can also list the columns in the INSERT clause.
    3. CC - You can use the INSERT statement to add rows from one table to another.
    4. DD - All of the above.
  8. 8Given the following data definition, select all queries that return a list of employees who are not managers.
    TABLE emp
    id INTEGER NOT NULL PRIMARY KEY
    mgrId INTEGER REFERENCES emp (id)
    name VARCHAR(30) NOT NULL

    1. AA SELECT e.name FROM emp e
      WHERE e.id NOT IN (
      SELECT DISTINCT m.mgrId FROM emp m)
    2. BB SELECT e.name FROM emp e
      WHERE e.id NOT IN (
      SELECT DISTINCT m.mgrId FROM emp m WHERE m.mgrId IS NOT NULL)
    3. CC SELECT e.name FROM emp e
      WHERE e.id NOT IN (
      SELECT m.mgrId FROM emp m)
    4. DD SELECT e.name FROM emp e
      WHERE e.id NOT IN (
      SELECT m.mgrId FROM emp m WHERE m.mgrId IS NOT NULL)
  9. 99. Which of the follwing statements is/are not true for SQL profiler?
    1. Aenables you to monitor events
    2. Bcheck if rows are being inserted properly
    3. Ccheck the performance of a stored procedure
    4. DALL answers are correct

Information

Description
Basic SQL Test
Author
rahim.ali
Language
English
Views
382
Rating
No ratings yet
Rate this quiz
Rate this quiz

Feedback

What is it about?

What do you think of the new look?

How do you like it?