Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- SELECT B.BOOK_ID, B.TITLE, B.PUBLISHER_NAME, A.AUTHOR_NAME,
- C.NO_OF_COPIES, L.BRANCH_ID
- FROM BOOK B, BOOK_AUTHORS A, BOOK_COPIES C
- WHERE B.BOOK_ID=A.BOOK_ID
- AND B.BOOK_ID=C.BOOK_ID;
- SELECT CARD_NO
- FROM BOOK_LENDING
- WHERE DATE_OUT BETWEEN '01-JAN-2017' AND '01-JUL-2017'
- GROUP BY CARD_NO
- HAVING COUNT (*)>3;
- DELETE FROM BOOK
- WHERE BOOK_ID='3';
- CREATE TABLE BOOKPART
- PARTITION BY RANGE (PUB_YEAR)
- (PARTITION P1 VALUES LESS THAN(2016),
- PARTITION P2 VALUES LESS THAN (MAXVALUE))
- AS SELECT * FROM BOOK;
- CREATE VIEW BC AS
- SELECT B.BOOK_ID,C.TITLE,B.BRANCH_ID,
- (B.NO_OF_COPIES-(SELECT COUNT(*)
- FROM BOOK_LENDING L
- WHERE B.BOOK_ID=L.BOOK_ID AND
- B.BRANCH_ID=L.BRANCH_ID))
- AS NO_COPY
- FROM BOOK_COPIES B,BOOK C
- WHERE B.BOOK_ID=C.BOOK_ID;
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement