Created
July 13, 2015 19:50
-
-
Save tim-br/35fac97ce4518b3c10c7 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
EXERCISE 1/2 are earlier versions of ex 3 | |
EXERCISE 3. | |
select books.title, stock.retail, stock.stock, books.id AS BOOK_ID, editions.isbn, editions.publisher_id from books left join editions on books.id = editions.book_id left join stock on stock.isbn = editions.isbn where editions.publisher_id = 59; | |
EXERCISE 4. | |
select books.title, stock.retail, stock.stock, books.id AS BOOK_ID, editions.isbn, editions.publisher_id from books left join editions on books.id = editions.book_id left join stock on stock.isbn = editions.isbn where editions.publisher_id = 59 and stock.stock > 0; | |
EXERCISE 5. | |
select book_id, case when type='h' then 'hardcover' else 'paperback' end as type from editions; | |
EXERCISE 6 | |
select books.title, editions.publication from books left join editions on editions.book_id=books.id; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment