Chapter 2 - Basic SQL SELECT Statements

C. SELECT firstname, lastname FROM customers;

Which of the following SELECT statements displays a list of customer names from the CUSTOMERS table?
A. SELECT customer names FROM customers;
B. SELECT "Names" FROM customers;
C. SELECT firstname, lastname FROM customers;
D. SELECT firstname, lastname, FR

D. FROM

Which clause is required in a SELECT statement?
A. WHERE
B. ORDER BY
C. GROUP BY
D. FROM
E. All of the above

D. SELECT lastname Last Name FROM customers;
Not certain about this one.

Which of the following is not a valid SELECT statement?
A. SELECT lastname, firstname FROM customers;
B. SELECT * FROM orders;
C. Select FirstName NAME from CUSTOMERS;
D. SELECT lastname Last Name FROM customers;

B. ||

Which of the following symbols represents concatenation?
A. *
B. ||
C. [ ]
D. ''

B. SELECT * FROM orders;

Which of the following SELECT statements returns all fields in the ORDERS table?
A. SELECT customer#, order#, orderdate, shipped, address FROM orders;
B. SELECT * FROM orders;
C. SELECT ? FROM orders;
D. SELECT ALL FROM orders;

C. "

Which of the following symbols is used for a column alias containing spaces?
A. ''
B. ||
C. " "
D. //

C. SELECT title AS "Book Title" from books;

Which of the following is a valid SELECT statement?
A. SELECT TITLES * TITLE! FROM BOOKS;
B. SELECT "customer#" FROM books;
C. SELECT title AS "Book Title" from books;
D. all of the above

C. *

Which of the following symbols is used in a SELECT clause to display all columns from a table?
A. /
B. &
C. *
D.

D. SELECT retail^3 from books;
^ represents raising to the power of, but this is not supported in Oracle and must be written columnname
columnname
columnname......

Which of the following is not a valid SELECT statement?
A. SELECT cost-retail FROM books;
B. SELECT retail+cost FROM books;
C. SELECT retail
retail
retail FROM books;
D. SELECT retail^3 from books;

D. when listing more than one field name and the fields aren't concatenated

When must a comma be used in the SELECT clause of a query?
A. when a field name is followed by a column alias
B. to separate the SELECT clause and the FROM clause when only one field is selected
C. It's never used in the SELECT clause
D. when listing more

C. SELECT title, cat FROM books;

Which of the following commands displays a listing of the category for each book in the BOOKS table?
A. SELECT title books, category FROM books;
B. SELECT title, books, and category FROM books;
C. SELECT title, cat FROM books;
D. SELECT books, || category

C. WHERE

Which clause is not required in a SELECT statement?
A. SELECT
B. FROM
C. WHERE
D. All of the above clauses are required

D. There are no errors

Which of the following lines of the SELECT statement contains an error?
SELECT title, isbn,
Pubdate "Date of Publication"
FROM books;
A. line 1
B. line 2
C. line 3
D. There are no errors

B. line 2

Which of the following lines of the SELECT statement contains an error?
SELECT ISBN,
retail-cost
FROM books;
A. line 1
B. line 2
C. line 3
D. There are no errors

C. line 3

Which of the following lines of the SELECT statement contains an error?
SELECT title, cost,
cost*2
'With 200% Markup'
FROM books;
A. line 1
B. line 2
C. line 3
D. There are no errors

D. There are no errors

Which of the following lines of the SELECT statement contains an error?
SELECT name, contact
"Person to Call", phone
FROM publisher;
A. line 1
B. line 2
C. line 3
D. There are no errors

A. line 1

Which of the following lines of the SELECT statement contains an error?
SELECT ISBN, || ' is the ISBN for the book name ' ||
title
FROM books;
A. line 1
B. line 2
C. line 3
D. There are no errors

B. line 2

Which of the following lines of the SELECT statement contains an error?
SELECT title, category
FORM books;
A. line 1
B. line 2
C. There are no errors

D. There are no errors

Which of the following lines of the SELECT statement contains an error?
SELECT name, contact
"Person to Call", phone
FROM publisher;
A. line 1
B. line 2
C. line 3
D. There are no errors

C. There are no errors

Which of the following lines of the SELECT statement contains an error?
SELECT *
From publishers:
A. line 1
B. line 2
C. There are no errors