Advertisement
Guest User

Untitled

a guest
Dec 4th, 2016
74
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.49 KB | None | 0 0
  1. INSERT INTO transaction(transaction_id,borrower_id,book_id,librarian_id)
  2. VALUES('TR'||LPAD(transaction_transaction_id_seq.NEXTVAL,3,0),
  3. (SELECT borrower_id FROM borrower WHERE borrower_name Like 'Vincencius Kevin'),
  4. (SELECT book_id FROM book WHERE book_title LIKE 'Breaking Dawn'),
  5. (SELECT librarian_id FROM librarian WHERE librarian_name LIKE 'Steven Young')
  6. );
  7.  
  8. UPDATE book
  9. SET stock = (SELECT stock FROM book WHERE book_title LIKE 'Breaking Dawn')-1
  10. WHERE book_title LIKE 'Breaking Dawn';
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement