I need help with the queries I wrote and I don't understand what is wrong with them? Can someone help me correct them?
#11
SELECT BOOK_CODE, TITLE, PUBLISHER.PUBLISHER_CODE, PUBLISHER_NAME
FROM BOOK, PUBLISHER
WHERE PUBLISHER.PUBLISHER_CODE = BOOK.PUBLISHER_CODE
ORDER BY PUBLISHER_NAME;
#12
SELECT BOOK_CODE, TITLE, PRICE
FROM BOOK, PUBLISHER
WHERE PUBLISHER_NAME = 'Plume'
AND BOOK.PUBLISHER_CODE = PUBLISHER.PUBLISHER_CODE;
#13
SELECT BOOK_CODE, TITLE, PRICE
FROM BOOK, PUBLISHER
WHERE PUBLISHER_NAME = 'Plume'
AND BOOK.PUBLISHER_CODE = PUBLISHER.PUBLISHER_CODE
AND PRICE >= 14;
#14
SELECT TITLE, BOOK.BOOK_CODE, ON_HAND, BRANCH.BRANCH_NUM
FROM BOOK, BRANCH, INVENTORY
WHERE BRANCH.BRANCH_NUM = 4
AND BOOK.BOOK_CODE = INVENTORY.BOOK_CODE
AND INVENTORY.BRANCH_NUM = BRANCH.BRANCH_NUM;
#15
SELECT TITLE
FROM BOOK, PUBLISHER
WHERE TYPE = 'PSY'
AND PUBLISHER_NAME = 'Jove Publications'
AND BOOK.PUBLISHER_CODE = PUBLISHER.PUBLISHER_CODE ;
#16
SELECT TITLE, BOOK_CODE
FROM BOOK
WHERE BOOK_CODE
IN (SELECT BOOK_CODE FROM WROTE WHERE AUTHOR_NUM =18);
#17
SELECT A.BOOK_CODE, B.BOOK_CODE, A.PRICE FROM BOOK A, BOOK B WHERE A.PRICE=B.PRICE AND A.BOOK_CODE < B.BOOK_CODE ORDER BY A.BOOK_CODE, B.BOOK_CODE;
#18
SELECT BOOK.BOOK_CODE, TITLE FROM BOOK, WROTE, INVENTORY WHERE INVENTORY.BRANCH_NUM = 2 AND AUTHOR_NUM = 20 AND BOOK.BOOK_CODE = WROTE.BOOK_CODE AND INVENTORY.BOOK_CODE = BOOK.BOOK_CODE;
#19
SELECT A.BOOK_CODE, B.BOOK_CODE, A.PRICE FROM BOOK A, BOOK B WHERE A.PRICE=B.PRICE AND A.BOOK_CODE < B.BOOK_CODE ORDER BY A.BOOK_CODE, B.BOOK_CODE;
#20
SELECT TITLE, AUTHOR_LAST, ON_HAND FROM WROTE, BOOK, BRANCH, INVENTORY, AUTHOR WHERE BRANCH.BRANCH_NUM = 4 AND BOOK.BOOK_CODE = INVENTORY.BOOK_CODE AND BOOK.BOOK_CODE = WROTE.BOOK_CODE AND INVENTORY.BRANCH_NUM = BRANCH.BRANCH_NUM AND WROTE.AUTHOR_NUM = AUTHOR.AUTHOR_NUM;
#6
SELECT CUSTOMER_NUM, CUSTOMER_NAME
FROM CUSTOMER WHERE CUSTOMER.CUSTOMER_NUM
NOT IN (SELECT CUSTOMER_NUM FROM ORDERS WHERE ORDER_DATE = '2007-10-21');
Can someone help me correct my mistakes? the teachers compilers just say there was a syntax error in each of the queries i wrote.
Thanks