Academic Integrity: tutoring, explanations, and feedback — we don’t complete graded work or submit on a student’s behalf.

Take Test: 2. Chapter 9 Quiz - Click Here Question 1 Structure of the ORDERS tab

ID: 3580149 • Letter: T

Question

            Take Test: 2. Chapter 9 Quiz - Click Here

Question 1

Structure of the ORDERS table

Structure of the CUSTOMERS table

Which of the following queries will display data from both the ORDERS and CUSTOMERS tables?

a.

SELECT lastname, firstname, order#

FROM orders, customers

WHERE orders.customer# = customers.customer#;

b.

SELECT lastname, firstname, order#
FROM orders NATURAL JOIN customers;

c.

SELECT * FROM orders, customers;

d.

all of the above

0.1 points

Question 2

Structure of the ORDERS table

Structure of the CUSTOMERS table

Which SQL statement will return the same results as the following SQL statement?

SELECT * FROM orders, customers;

a.

SELECT * FROM orders, customers

WHERE orders.customer# > customers.customer#;

b.

SELECT * FROM orders, customers

WHERE orders.customer# = customers.customer#;

c.

SELECT * FROM orders CROSS JOIN customers;

d.

SELECT * FROM o orders , c customers

WHERE o.customer# = c.customer#;

0.1 points

Question 3

Structure of the ORDERS table

Structure of the CUSTOMERS table

Which of the following queries will return the same results as the following SQL statement?

SELECT c.customer#, lastname, firstname, order#

FROM customers c, orders o

WHERE c.customer# = o.customer#;

a.

SELECT customer#, lastname, firstname, order#

FROM customers NATURAL JOIN orders;

b.

SELECT c.customer#, lastname, firstname, order#

FROM customers c, orders o;

c.

SELECT customer#, lastname, firstname, order#

FROM customers JOIN orders USING (customer#);

d.

both a and b

0.1 points

Question 4

Structure of the ORDERS table

Structure of the CUSTOMERS table

Which of the following SQL statements will return the names of all customers who placed an order on April 12, 2003?

a.

SELECT lastname, firstname

FROM customers

WHERE orderdate = '12-APR-03';

b.

SELECT lastname, firstname

FROM customers NATURAL JOIN orders

WHERE orderdate = '12-APR-03';

c.

both a and b

d.

SELECT lastname, firstname

FROM customers JOIN orders ON (customer#)

WHERE orderdate = '12-APR-03';

0.1 points

Question 5

Structure of the ORDERS table

Structure of the CUSTOMERS table

Which of the following SQL statements will list the name of each customer stored in the CUSTOMERS table, and, if the customer has placed an order that is contained in the ORDERS table, the order# of any order each customer has placed?

a.

SELECT lastname, firstname, order#

FROM customers c LEFT OUTER JOIN orders o

ON c.customer# = o.customer#;

b.

SELECT lastname, firstname, order#

FROM customers RIGHT OUTER JOIN orders;

c.

SELECT lastname, firstname, order#

FROM customers NATURAL JOIN orders;

d.

SELECT lastname, firstname, order#

FROM customers JOIN orders USING (customer#);

0.1 points

Question 6

Structure of the ORDERS table

Structure of the CUSTOMERS table

Which of the following SQL statements will list the name of each customer stored in the CUSTOMERS table, and, if the customer has placed an order that is contained in the ORDERS table, the order# of any order each customer has placed?

a.

SELECT lastname, firstname, order#

FROM customers, orders

WHERE orders.customer# = customers.customer# (+);

b.

SELECT lastname, firstname, order#

FROM customers NATURAL JOIN orders

WHERE orders.customer# IS NOT NULL;

c.

SELECT lastname, firstname, order#

FROM customers NATURAL JOIN orders

WHERE orders.customer# IS NULL;

d.

SELECT lastname, firstname, order#

FROM customers, orders

WHERE orders.customer# (+) = customers.customer#;

0.1 points

Question 7

Structure of the ORDERS table

Structure of the CUSTOMERS table

Which of the following SQL statements will display all customers who have not recently placed an order?

a.

SELECT customer# FROM customers

UNION

SELECT customer# FROM orders;

b.

SELECT customer# FROM orders

MINUS

SELECT customer# FROM customers;

c.

SELECT customer# FROM orders

INTERSECT

SELECT customer# FROM customers;

d.

SELECT customer# FROM customers

MINUS

SELECT customer# FROM orders;

0.1 points

Question 8

A join based upon a column from each table containing equivalent data is known as a(n) ____.

a.

equality join

b.

outer join

c.

inequality join

d.

all of the above

0.1 points

Question 9

A table alias can consist of a maximum of ____ characters.

a.

12

b.

225

c.

30

d.

255

0.1 points

Question 10

Which of the following can only be used to link tables that have a common column?

a.

FULL OUTER JOIN

b.

JOIN...ON

c.

CROSS JOIN

d.

NATURAL JOIN

0.1 points

Question 11

Which of the following keywords can be used to join two tables that do not contain a commonly named and defined column?

a.

JOIN...USING

b.

NATURAL JOIN

c.

JOIN...ON

d.

none of the above

0.1 points

Question 12

Which of the following types of joins refers to joining a table to itself?

a.

Cartesian join

b.

equality join

c.

self-join

d.

outer join

0.1 points

Question 13

Structure of the BOOKS table

  

Structure of the PUBLISHER table

Which of the following SQL statements will display the title of each book in the BOOKS table and the name of its publisher?

a.

SELECT title, name
FROM publisher NATURAL JOIN books;

b.

SELECT title, name
FROM publisher, books;

c.

both b and c

d.

SELECT title, name

FROM publisher, books

WHERE p.pubid = b.pubid;

0.1 points

Question 14

Structure of the BOOKS table

  

Structure of the PUBLISHER table

Which of the following SQL statements will display the publisher name, book title, and retail price of all books that cost more than $35.95?

a.

SELECT name, title, retail

FROM books NATURAL JOIN publisher

WHERE cost > 35.95;

b.

SELECT p.name, b.title, b.retail
FROM books b NATURAL JOIN publisher p

WHERE b.cost > 35.95;

c.

SELECT name, title, retail

FROM books, publisher

WHERE cost > 35.95;

d.

none of the above

0.1 points

Question 15

Structure of the BOOKS table

  

Structure of the PUBLISHER table

Which of the following will display the title, publication date, and publisher name of each book in the BUSINESS category?

a.

SELECT title, pubdate, name

FROM publisher CROSS JOIN books USING (pubid)

WHERE category = 'BUSINESS';

b.

SELECT title, pubdate, name

FROM publisher JOIN books ON (pubid)

WHERE category = 'BUSINESS';

c.

SELECT title, pubdate, name

FROM publisher OUTER JOIN books USING (pubid)

WHERE category = 'BUSINESS';

d.

SELECT title, pubdate, name

FROM publisher JOIN books USING (pubid)

WHERE category = 'BUSINESS';

a.

SELECT lastname, firstname, order#

FROM orders, customers

WHERE orders.customer# = customers.customer#;

b.

SELECT lastname, firstname, order#
FROM orders NATURAL JOIN customers;

c.

SELECT * FROM orders, customers;

d.

all of the above

Explanation / Answer

1) Answer: d

2)Answer: c

3)Answer: d

4)Answer: b

5)Answer: a

6)Answer: a

7)Answer: d

8)Answer: a

9)Answer: c

10)Answer: a

11)Answer: b

12)Answer: c

13)Answer: a

14)Answer: b

15) Answer: c