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

Quiz

QUIZ 6

Claudia Piscociu 15 questions

Take the quiz

Questions in this quiz (15)

  1. 1Evaluate this SELECT statement:
    SELECT a.lname || ', ' || a.fname as "Patient", b.lname || ', ' || b.fname as "Physician", c.admission
    FROM patient a
    JOIN physician b
    ON (b.physician_id = c.physician_id)
    JOIN admission c
    ON (a.patient_id = c.patient_id);

    Which clause generates an error?
    1. AON (b.physician_id = c.physician_id);
    2. BJOIN physician b
    3. CON (a.patient_id = c.patient_id)
    4. DJOIN admission c
  2. 2Below find the structures of the PRODUCTS and VENDORS tables:
    PRODUCTS
    PRODUCT_ID NUMBER
    PRODUCT_NAME VARCHAR2 (25)
    VENDOR_ID NUMBER
    CATEGORY_ID NUMBER

    VENDORS
    VENDOR_ID NUMBER
    VENDOR_NAME VARCHAR2 (25)
    ADDRESS VARCHAR2 (30)
    CITY VARCHAR2 (25)
    REGION VARCHAR2 (10)
    POSTAL_CODE VARCHAR2 (11)

    You want to create a query that will return an alphabetical list of products, including the product name and associated vendor name, for all products that have a vendor assigned.

    Which two queries could you use?
    1. ASELECT p.product_name, v.vendor_name
      FROM products p
      NATURAL JOIN vendors v
      ORDER BY p.product_name;
    2. BSELECT p.product_name, v.vendor_name
      FROM products p
      JOIN vendors v
      ON (vendor_id)
      ORDER BY p.product_name;
    3. CSELECT p.product_name, v.vendor_name
      FROM products p
      JOIN vendors v
      USING (p.vendor_id)
      ORDER BY p.product_name;
    4. DSELECT p.product_name, v.vendor_name
      FROM products p
      JOIN vendors v
      USING (vendor_id)
      ORDER BY p.product_name;
    5. ESELECT p.product_name, v.vendor_name
      FROM products p
      LEFT OUTER JOIN vendors v
      ON p.vendor_id = v.vendor_id
      ORDER BY p.product_name;
  3. 3You created the CUSTOMERS and ORDERS tables by issuing these CREATE TABLE statements in sequence:
    CREATE TABLE customers
    (custid varchar2(5),
    companyname varchar2(30),
    contactname varchar2(30),
    address varchar2(30),
    city varchar2(20),
    state varchar2(30),
    phone varchar2(20),
    constraint pk_customers_01 primary key (custid));

    CREATE TABLE orders
    (orderid varchar2(5) constraint pk_orders_01 primary key,
    orderdate date,
    total number(15),
    custid varchar2(5) references customers (custid));

    You have been instructed to compile a report to present the information about orders placed by customers who reside in Nashville. Which query should you issue to achieve the desired results?
    1. ASELECT custid, companyname
      FROM customers
      WHERE city = 'Nashville';
    2. BSELECT orderid, orderdate, total
      FROM orders
      WHERE city = 'Nashville';
    3. CSELECT orderid, orderdate, total
      FROM orders o
      JOIN customers c ON o.custid = c.custid
      WHERE city = 'Nashville';
    4. DSELECT orderid, orderdate, total
      FROM orders o
      NATURAL JOIN customers c ON o.custid = c.custid
      WHERE city = 'Nashville';
  4. 4Which select statement will return the last name and hire date of an employee and his/ her manager for employees that started in the company before their managers?
    1. ASELECT w.last_name, w.hire_date, m.last_name, m.hire_date
      FROM employees w , employees w
      WHERE w.manager_id = w.employee_id
      AND w.hire_date < w.hire_date
    2. BSELECT w.last_name, w.hire_date, m.last_name, m.hire_date
      FROM employees w , employees m
      WHERE w.manager_id = m.employee_id
      AND w.hire_date < m.hire_date
    3. CSELECT w.last_name, w.hire_date, m.last_name, m.hire_date
      FROM employees w , employees m
      WHERE w.manager_id = m.employee_id
      AND w.hire_date > m.hire_date
    4. DSELECT w.last_name, w.hire_date, m.last_name, m.hire_date
      FROM employees w , employees m
      WHERE w.manager_id != m.employee_id
      AND w.hire_date < m.hire_date
  5. 5Which of the following database design concepts is implemented with a self join?
    1. ASupertype
    2. BNon-Transferability
    3. CRecursive Relationship
    4. DArc
  6. 6 Hierarchical queries can walk both Top-Down and Bottom-Up. True or False?
    1. ATrue
    2. BFalse
  7. 7Which of the following database design concepts do you need in your tables to write Hierarchical queries?
    1. ASupertype
    2. BNon-Transferability
    3. CRecursive Relationship
    4. DArc
  8. 8Which statement about a self join is true?
    1. AA self join must be implemented by defining a view.
    2. BTable aliases cannot be used to qualify table names.
    3. CThe NATURAL JOIN clause must be used.
    4. DTable aliases must be used to qualify table names.
  9. 9Given the following descriptions of the employees and jobs tables, which of the following scripts will display each employeeメs possible minimum and maximum salaries based on their job title?
    EMPLOYEES Table:
    Image for question 9
    1. ASELECT e.first_name, e.last_name, e.job_id, j.min_salary, j.max_salary
      FROM employees e
      NATURAL JOIN jobs j ON (e.job_title = j.job_title);
    2. BSELECT first_name, last_name, job_id, min_salary, max_salary
      FROM employees e
      FULL JOIN jobs j (job_id);
    3. CSELECT e.first_name, e.last_name, e.job_id, j.min_salary, j.max_salary
      FROM employees e
      NATURAL JOIN jobs j
      USING (job_id);
    4. DSELECT first_name, last_name, job_id, min_salary, max_salary
      FROM employees
      NATURAL JOIN jobs;
    5. ESELECT e.first_name, e.last_name, e.job_id, j.min_salary, j.max_salary
      FROM employees e
      NATURAL JOIN jobs j;
  10. 10A query is needed to display each department and its manager name from the above tables. However, not all departments have a manager but we want departments returned in all cases. Which of the following SQL: 1999 syntax scripts will accomplish the task?Image for question 10
    1. ASELECT d.department_id, e.first_name, e.last_name
      FROM employees e
      RIGHT OUTER JOIN departments d
      ON (e.employee_id = d.manager_id);
    2. BSELECT d.department_id, e.first_name, e.last_name
      FROM employees e
      FULL OUTER JOIN departments d
      ON (e.employee_id = d.manager_id);
    3. CSELECT d.department_id, e.first_name, e.last_name
      FROM employees e, departments d
      WHERE e.employee_id
      RIGHT OUTER JOIN d.manager_id;
    4. DSELECT d.department_id, e.first_name, e.last_name
      FROM employees e
      LEFT OUTER JOIN departments d
      WHERE (e.department_id = d.department_id);

Information

Description
Quiz on QUIZ 6, created by Claudia Piscociu on 14/01/2017.
Language
English
Views
8
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?