9. 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;
Week 3
3. Which of the following SQL statements is valid?
a. SELECT order# FROM orders WHERE shipdate = NULL;
b. SELECT order# FROM orders WHERE shipdate = 'NULL';
c. SELECT order# FROM orders WHERE shipdate = "NULL";
d. None of the statements are valid.
9. Which of the following includes a customer with the first name BONITA in the results?
a. SELECT * FROM customers WHERE firstname = 'B%';
b. SELECT * FROM customers WHERE firstname LIKE '%N%';
c. SELECT * FROM customers WHERE firstname = '%N%';
d. SELECT * FROM customers WHERE firstname LIKE '_B%';
Week 4
1. Which of the following is a valid SQL statement?
a. SELECT SYSDATE;
b. SELECT UPPER(Hello) FROM dual;
c. SELECT TO_CHAR(SYSDATE, 'Month DD, YYYY')
FROM dual;
d. all of the above
e. none of the above
5. Which of the following functions can be used to substitute a value for a NULL value?
a. NVL
b. TRUNC
c. NVL2
d. SUBSTR
e. both a and d
f. both a and c
9. Which of the following displays the order date for order 1000 as 03/31?
a. SELECT TO_CHAR(orderdate, 'MM/DD')
FROM orders
WHERE order# = 1000;
b. SELECT TO_CHAR(orderdate, 'Mth/DD')
FROM orders
WHERE order# = 1000;
c. SELECT TO_CHAR(orderdate, 'MONTH/YY')
FROM orders
WHERE order# = 1000;
d. both a and b
e. none of the above
Week 5
3. Which of the following queries contains an equality join?
a. SELECT title, authored FROM books, bookauthor
WHERE books.isbn = bookauthor.isbn AND retail > 20;
b. SELECT title, name FROM books CROSS JOIN publisher;
c. SELECT title, gift FROM books, promotion
WHERE retail >= minretail AND retail 20;
b. SELECT title, name
FROM books JOIN publisher
USING (pubid);
c. SELECT title, gift
FROM books, promotion
WHERE retail >= minretail AND retail ‘01-APR-09’;