Name: _________________________________
The following queries apply to the Bookbiz database that comes with the Practical SQL Handbook. The relationship diagram can be found on page 47 of the book. Run the database to check your answer.
authors table.
You should get all 23 rows.
SELECT * FROM authors;
SELECT au_fname, au_lname FROM authors;
SELECT au_fname AS FirstName, au_lname AS LastName FROM authors;
SELECT au_fname AS "First", au_lname AS "Last" FROM authors;
SELECT * FROM authors WHERE city='Walnut Creek';
SELECT title_id, qty_ordered-qty_shipped FROM salesdetails WHERE qty_shipped < qty_ordered;
SELECT ed_fname, ed_lname FROM editors WHERE ed_boss IS NULL;
SELECT ed_lname, ed_boss
FROM editors
WHERE ed_boss IS NULL
OR ed_boss <> '993-86-0420';
SELECT title, type, price FROM titles WHERE type <> 'business' AND price BETWEEN 20 AND 30;
SELECT au_lname FROM authors WHERE au_lname LIKE '%k%';