4.5 Insert Data into the Tables

Add some sample data to the BOOKS, PATRONS, and TRANSACTIONS tables.

  1. Copy and paste the following INSERT statements into the SQL Worksheet:

    INSERT INTO books VALUES ('A1111', 'Moby Dick', 'Melville', 'Herman', 10);
    INSERT INTO books VALUES ('A2222', 'Get Rich Really Fast', 'Scammer', 'Ima', 1);
    INSERT INTO books VALUES ('A3333', 'Finding Inner Peace', 'Blissford', 'Serenity', null);
    INSERT INTO books VALUES ('A4444', 'Great Mystery Stories', 'Whodunit', 'Rodney', 5);
    INSERT INTO books VALUES ('A5555', 'Software Wizardry', 'Abugov', 'D.', 10);
     
    INSERT INTO patrons VALUES  (patron_id_seq.nextval, 
       'Smith', 'Jane', '123 Main Street', 'Mytown, MA 01234');
    INSERT INTO patrons VALUES  (patron_id_seq.nextval, 
       'Chen', 'William', '16 S. Maple Road', 'Mytown, MA 01234');
    INSERT INTO patrons VALUES  (patron_id_seq.nextval, 
       'Fernandez', 'Maria', '502 Harrison Blvd.', 'Sometown, NH 03078');
    INSERT INTO patrons VALUES  (patron_id_seq.nextval, 
       'Murphy', 'Sam', '57 Main Street', 'Mytown, MA 01234');
     
    INSERT INTO transactions
      VALUES (transaction_id_seq.nextval, 100, 'A1111', SYSDATE, 1);
    INSERT INTO transactions
      VALUES (transaction_id_seq.nextval, 100, 'A2222', SYSDATE, 2);
    INSERT INTO transactions
      VALUES (transaction_id_seq.nextval, 101, 'A3333', SYSDATE, 3);
    INSERT INTO transactions
      VALUES (transaction_id_seq.nextval, 101, 'A2222', SYSDATE, 1);
    INSERT INTO transactions
      VALUES (transaction_id_seq.nextval, 102, 'A3333', SYSDATE, 1);
    INSERT INTO transactions
      VALUES (transaction_id_seq.nextval, 103, 'A4444', SYSDATE, 2);
    INSERT INTO transactions
      VALUES (transaction_id_seq.nextval, 100, 'A4444', SYSDATE, 1);
    INSERT INTO transactions
      VALUES (transaction_id_seq.nextval, 102, 'A2222', SYSDATE, 2);
    INSERT INTO transactions
      VALUES (transaction_id_seq.nextval, 102, 'A5555', SYSDATE, 1);
    INSERT INTO transactions
      VALUES (transaction_id_seq.nextval, 101, 'A2222', SYSDATE, 1);
  2. Click Run Script.