Music Schema

Utilities

Music Schema ERDs

Music OLTP Schema

Music Data WareHouse Schema

Music Combined OLTP and Data Warehouse Schema

Music Schema Creation Scripts

Music Schema Create User Script

SPOOL log/CREATEUSER.LOG;
--DROP USER MUSIC CASCADE;
CREATE USER MUSIC IDENTIFIED BY MUSIC
DEFAULT TABLESPACE USERS
TEMPORARY TABLESPACE TEMP
QUOTA UNLIMITED ON USERS
QUOTA UNLIMITED ON TEMP;
GRANT CONNECT,RESOURCE TO MUSIC;
GRANT UNLIMITED TABLESPACE TO MUSIC;
SPOOL OFF;

Music OLTP Schema Creation Script


CREATE TABLE INSTRUMENT(
	 INSTRUMENT_ID	NUMBER NOT NULL
	,SECTION_ID	NUMBER NULL
	,NAME		VARCHAR2(32) NOT NULL
	,CONSTRAINT	XPKINSTRUMENT PRIMARY KEY (INSTRUMENT_ID) USING INDEX TABLESPACE INDX
	,CONSTRAINT	FKI_1 FOREIGN KEY (SECTION_ID) REFERENCES INSTRUMENT
) TABLESPACE DATA;

CREATE UNIQUE INDEX XUK_INSTRUMENT_NAME ON INSTRUMENT (NAME) TABLESPACE INDX;
CREATE INDEX XFK_I_1 ON INSTRUMENT (SECTION_ID) TABLESPACE INDX;

SPOOL log/SCHEMA_OLTP.LOG;

DROP TABLE INSTRUMENT CASCADE CONSTRAINTS;
CREATE TABLE INSTRUMENT
(
	 INSTRUMENT_ID		NUMBER NOT NULL
	,SECTION_ID		NUMBER NULL
	,NAME			VARCHAR2(32) NOT NULL
	,CONSTRAINT		XPKINSTRUMENT PRIMARY KEY (INSTRUMENT_ID) 
	,CONSTRAINT		FKI_1 FOREIGN KEY (SECTION_ID) REFERENCES INSTRUMENT
);
CREATE UNIQUE INDEX XUK_INSTRUMENT_NAME ON INSTRUMENT (NAME);
CREATE INDEX XFK_I_1 ON INSTRUMENT (SECTION_ID);

DROP TABLE ARTIST CASCADE CONSTRAINTS;
CREATE OR REPLACE TYPE INSTRUMENTSCOLLECTION AS VARRAY(10) OF VARCHAR2(32);
/
CREATE TABLE ARTIST
(
	 ARTIST_ID		NUMBER NOT NULL
	,NAME 			VARCHAR2(32) NOT NULL
	,STREET 		VARCHAR2(32)
	,POBOX			CHAR(20)
	,CITY			VARCHAR2(32)
	,STATE_PROVINCE		VARCHAR2(32)
	,COUNTRY		VARCHAR2(32)
	,ZIP			CHAR(10)
	,EMAIL			VARCHAR2(32)
	,INSTRUMENTS		INSTRUMENTSCOLLECTION
	,CONSTRAINT		XPKARTIST PRIMARY KEY (ARTIST_ID)
);
CREATE UNIQUE INDEX XUK_ARTIST_NAME ON ARTIST (NAME);

DROP TABLE SONG CASCADE CONSTRAINTS;
CREATE TABLE SONG
(
	 SONG_ID		NUMBER NOT NULL
	,ARTIST_ID		NUMBER NOT NULL
	,TITLE			VARCHAR2(64) NOT NULL
	,RECORDING_DATE		DATE
	,PLAYING_TIME		CHAR(10)
	,RECORDING		BLOB
	,CONSTRAINT		XPKSONG PRIMARY KEY (SONG_ID)
	,CONSTRAINT		FKSONG_1 FOREIGN KEY (ARTIST_ID) REFERENCES ARTIST
);
CREATE INDEX XFK_SONG_1 ON SONG (ARTIST_ID);
CREATE UNIQUE INDEX XUK_SONG_TITLE ON SONG (TITLE);

DROP TABLE GUESTAPPEARANCE CASCADE CONSTRAINTS;
CREATE TABLE GUESTAPPEARANCE
(
	 SONG_ID		NUMBER NOT NULL
	,GUESTARTIST_ID		NUMBER NOT NULL
	,COMMENT_TEXT		VARCHAR2(256)
	,CONSTRAINT		XPKGUESTAPPEARANCE PRIMARY KEY (SONG_ID,GUESTARTIST_ID)
	,CONSTRAINT		FKGUESTAPPEARANCE_1 FOREIGN KEY (GUESTARTIST_ID) REFERENCES ARTIST
	,CONSTRAINT		FKGUESTAPPEARANCE_2 FOREIGN KEY (SONG_ID) REFERENCES SONG
);
CREATE INDEX XFK_GUESTAPPEARANCE_1 ON GUESTAPPEARANCE (GUESTARTIST_ID);
CREATE INDEX XFK_GUESTAPPEARANCE_2 ON GUESTAPPEARANCE (SONG_ID);

DROP TABLE INSTRUMENTATION CASCADE CONSTRAINTS;
CREATE TABLE INSTRUMENTATION
(
	 SONG_ID		NUMBER NOT NULL
	,GUESTARTIST_ID		NUMBER NOT NULL
	,INSTRUMENT_ID		NUMBER NOT NULL
	,COMMENT_TEXT		VARCHAR2(256)
	,CONSTRAINT		XPKISG PRIMARY KEY (SONG_ID,GUESTARTIST_ID,INSTRUMENT_ID) 
	,CONSTRAINT		FKISG_1 FOREIGN KEY (SONG_ID,GUESTARTIST_ID) REFERENCES GUESTAPPEARANCE
	,CONSTRAINT		FKISG_2 FOREIGN KEY (INSTRUMENT_ID) REFERENCES INSTRUMENT
);
CREATE INDEX XFK_ISG_1 ON INSTRUMENTATION (INSTRUMENT_ID);
CREATE INDEX XFK_ISG_2 ON INSTRUMENTATION (SONG_ID, GUESTARTIST_ID);

DROP TABLE GENRE CASCADE CONSTRAINTS;
CREATE TABLE GENRE
(
	 GENRE_ID		NUMBER NOT NULL
	,STYLE_ID		NUMBER
	,GENRE			VARCHAR2(32)
	,CONSTRAINT		XPKGENRE PRIMARY KEY (GENRE_ID)
	,CONSTRAINT		FKG_1 FOREIGN KEY (STYLE_ID) REFERENCES GENRE
);
CREATE INDEX XFK_G_1 ON GENRE (STYLE_ID);

DROP TABLE MUSICCD CASCADE CONSTRAINTS;
CREATE TABLE MUSICCD
(
	 MUSICCD_ID		NUMBER NOT NULL
	,GENRE_ID		NUMBER
	,TITLE			VARCHAR2(32)
	,PRESSED_DATE		DATE
	,PLAYING_TIME		CHAR(10)
	,LIST_PRICE		FLOAT
	,CONSTRAINT		XPKMUSICCD PRIMARY KEY (MUSICCD_ID)
	,CONSTRAINT		FKMCD_1 FOREIGN KEY (GENRE_ID) REFERENCES GENRE
);
CREATE UNIQUE INDEX XUK_MUSICCD_TITLE ON MUSICCD (TITLE);
CREATE INDEX XFK_MCD_1 ON MUSICCD (GENRE_ID);

DROP TABLE CDTRACK CASCADE CONSTRAINTS;
CREATE TABLE CDTRACK
(
	 MUSICCD_ID		NUMBER NOT NULL
	,SONG_ID		NUMBER NOT NULL
	,TRACK_SEQ_NO		NUMBER NOT NULL
	,CONSTRAINT		XPKCDTRACK PRIMARY KEY (MUSICCD_ID,SONG_ID) 
	,CONSTRAINT		FKCDTRACK_1 FOREIGN KEY (SONG_ID) REFERENCES SONG
	,CONSTRAINT		FKCDTRACK_2 FOREIGN KEY (MUSICCD_ID) REFERENCES MUSICCD
);
CREATE INDEX XFK_CDTRACK_1 ON CDTRACK (SONG_ID);
CREATE INDEX XFK_CDTRACK_2 ON CDTRACK (MUSICCD_ID);
CREATE UNIQUE INDEX XAK_CDTRACK_TRACK ON CDTRACK (MUSICCD_ID,TRACK_SEQ_NO);

DROP TABLE STUDIOTIME CASCADE CONSTRAINTS;
CREATE TABLE STUDIOTIME
(
	 STUDIOTIME_ID		NUMBER NOT NULL
	,ARTIST_ID		NUMBER NOT NULL
	,SESSION_DATE		DATE
	,MINUTES_USED		NUMBER(10,2)
	,DUE_DATE		DATE
	,AMOUNT_CHARGED		NUMBER(10,2)
	,AMOUNT_PAID		NUMBER(10,2)
	,CONSTRAINT		XPKSTUDIOTIME PRIMARY KEY (STUDIOTIME_ID) 
	,CONSTRAINT		FKSTUDIOTIME_1 FOREIGN KEY (ARTIST_ID) REFERENCES ARTIST 
);
CREATE INDEX XFK_STUDIOTIME_1 ON STUDIOTIME (ARTIST_ID);

SPOOL OFF;

Music Data Warehouse Schema Creation Script

SPOOL log/SCHEMA_DW.LOG;

--
--dimensions
--

DROP TABLE CONTINENT CASCADE CONSTRAINTS;
CREATE TABLE CONTINENT
(
	 CONTINENT_ID   	NUMBER NOT NULL
	,NAME           	VARCHAR2(32)
	,CONSTRAINT		XPKCONTINENT PRIMARY KEY (CONTINENT_ID) 
);
CREATE UNIQUE INDEX XUK_CONTINENT_NAME ON CONTINENT(NAME);

DROP TABLE COUNTRY CASCADE CONSTRAINTS;
CREATE TABLE COUNTRY
(
	 COUNTRY_ID   		NUMBER NOT NULL
	,CONTINENT_ID		NUMBER
	,NAME           	VARCHAR2(32)
	,CONSTRAINT		XPKCOUNTRY PRIMARY KEY (COUNTRY_ID) 
	,CONSTRAINT		FKCOUNTRY_1 FOREIGN KEY (CONTINENT_ID) REFERENCES CONTINENT
);
CREATE UNIQUE INDEX XUK_COUNTRY_NAME ON COUNTRY(NAME);
CREATE INDEX XFKCOUNTRY_1 ON COUNTRY (CONTINENT_ID);

DROP TABLE RETAILER CASCADE CONSTRAINTS;
CREATE TABLE RETAILER
(
	 RETAILER_ID   		NUMBER NOT NULL
	,NAME           	VARCHAR2(32)
	,DISCOUNT		FLOAT
	,URL			VARCHAR2(128)
	,CONSTRAINT		XPKRETAILER PRIMARY KEY (RETAILER_ID) 
);
CREATE UNIQUE INDEX XUK_RETAILER_NAME ON RETAILER(NAME);

--
--dimension oltp links
--

CREATE OR REPLACE TYPE PREFERENCESCOLLECTION AS TABLE OF VARCHAR2(32);
/
DROP TABLE CUSTOMER CASCADE CONSTRAINTS;
CREATE TABLE CUSTOMER
(
	 customer_id          	NUMBER NOT NULL
	,name                 	VARCHAR2(32) NOT NULL
	,username             	CHAR(8)
	,password             	CHAR(8)
	,shipping_address     	CLOB 
	,billing_address      	CLOB 
	,credit_card          	CLOB 
	,Preferences		PREFERENCESCOLLECTION
	,CONSTRAINT		XPKCUSTOMER PRIMARY KEY (CUSTOMER_ID) 
) NESTED TABLE Preferences STORE AS preferencesTab;
CREATE UNIQUE INDEX XUK_CUSTOMER_NAME ON CUSTOMER(NAME);
--ALTER TABLE CUSTOMER ADD(preferences PreferencesCollection) NESTED TABLE preferences STORE AS preferences;

--
--facts
--

DROP TABLE Sales CASCADE CONSTRAINTS;
CREATE TABLE Sales
(
	 sales_id		NUMBER NOT NULL
	,musiccd_id          	NUMBER NOT NULL
	,customer_id          	NUMBER NOT NULL
	,retailer_id		NUMBER
	,continent_id          	NUMBER
	,country_id            	NUMBER
	,list_price           	FLOAT
	,discount             	FLOAT
	,sale_price           	FLOAT
	,sale_date            	DATE
	,sale_qty             	NUMBER
	,shipping_cost        	FLOAT
	,CONSTRAINT		XPKSALES PRIMARY KEY (SALES_ID) 
	,CONSTRAINT		FKSALES_1 FOREIGN KEY (RETAILER_ID) REFERENCES RETAILER
	,CONSTRAINT		FKSALES_2 FOREIGN KEY (CONTINENT_ID) REFERENCES CONTINENT
	,CONSTRAINT		FKSALES_3 FOREIGN KEY (COUNTRY_ID) REFERENCES COUNTRY
	,CONSTRAINT		FKSALES_4 FOREIGN KEY (CUSTOMER_ID) REFERENCES CUSTOMER
);
CREATE INDEX XFK_SALES_1 ON SALES (RETAILER_ID);
CREATE INDEX XFK_SALES_2 ON SALES (CONTINENT_ID);
CREATE INDEX XFK_SALES_3 ON SALES (COUNTRY_ID);
CREATE INDEX XFK_SALES_4 ON SALES (CUSTOMER_ID);

SPOOL OFF;

Music Sequences Creation Script

SPOOL log/SEQUENCES.LOG;
DROP SEQUENCE ARTIST_ID_SEQ;
DROP SEQUENCE SONG_ID_SEQ;
DROP SEQUENCE INSTRUMENT_ID_SEQ;
DROP SEQUENCE STUDIOTIME_ID_SEQ;
DROP SEQUENCE MUSICCD_ID_SEQ;
DROP SEQUENCE GENRE_ID_SEQ;
DROP SEQUENCE continent_ID_SEQ;
DROP SEQUENCE country_ID_SEQ;
DROP SEQUENCE retailer_ID_SEQ;
DROP SEQUENCE CUSTOMER_ID_SEQ;
DROP SEQUENCE SALES_ID_SEQ;
CREATE SEQUENCE ARTIST_ID_SEQ START WITH 1 INCREMENT BY 1 NOMAXVALUE NOCYCLE;
CREATE SEQUENCE SONG_ID_SEQ START WITH 1 INCREMENT BY 1 NOMAXVALUE NOCYCLE;
CREATE SEQUENCE INSTRUMENT_ID_SEQ START WITH 1 INCREMENT BY 1 NOMAXVALUE NOCYCLE;
CREATE SEQUENCE STUDIOTIME_ID_SEQ START WITH 1 INCREMENT BY 1 NOMAXVALUE NOCYCLE;
CREATE SEQUENCE MUSICCD_ID_SEQ START WITH 1 INCREMENT BY 1 NOMAXVALUE NOCYCLE;
CREATE SEQUENCE GENRE_ID_SEQ START WITH 1 INCREMENT BY 1 NOMAXVALUE NOCYCLE;
CREATE SEQUENCE continent_ID_SEQ START WITH 1 INCREMENT BY 1 NOMAXVALUE NOCYCLE;
CREATE SEQUENCE country_ID_SEQ START WITH 1 INCREMENT BY 1 NOMAXVALUE NOCYCLE;
CREATE SEQUENCE retailer_ID_SEQ START WITH 1 INCREMENT BY 1 NOMAXVALUE NOCYCLE;
CREATE SEQUENCE CUSTOMER_ID_SEQ START WITH 1 INCREMENT BY 1 NOMAXVALUE NOCYCLE;
CREATE SEQUENCE SALES_ID_SEQ START WITH 1 INCREMENT BY 1 NOMAXVALUE NOCYCLE;
SPOOL OFF;

Music Schema Data Generation Scripting

Music Schema Data Generation Master Control Script

SET ECHO OFF
UNDEF DBNAME
PROMPT WHAT IS THE DATABASE OR NETWORK NAME? (SUCH AS: ORADB10)
ACCEPT DBNAME
PROMPT CONNECTING TO SYSTEM NOW.
CONNECT SYSTEM@&&DBNAME
@CREATEUSER.SQL
CONNECT MUSIC/MUSIC@&&DBNAME
@SCHEMAOLTP.SQL
@SEQUENCES.SQL
@INSTRUMENT.SQL
@ARTIST.SQL
@GENRE.SQL;
@MUSICCD.SQL
@SONGANDTRACK.SQL
@GUESTARTIST.SQL
@STUDIOTIME.SQL
@UPDATEDATA.SQL
@SCHEMADW.SQL
@DIMENSIONS.SQL
@FACTS.SQL
EXIT;

Music Schema Data Generation: INSTRUMENT.SQL

SPOOL log/INSTRUMENT.LOG;

INSERT INTO INSTRUMENT(INSTRUMENT_ID,SECTION_ID,NAME) VALUES(INSTRUMENT_ID_SEQ.NEXTVAL,NULL,'Guitar');
INSERT INTO INSTRUMENT(INSTRUMENT_ID,SECTION_ID,NAME) VALUES(INSTRUMENT_ID_SEQ.NEXTVAL,NULL,'General');
INSERT INTO INSTRUMENT(INSTRUMENT_ID,SECTION_ID,NAME) VALUES(INSTRUMENT_ID_SEQ.NEXTVAL,NULL,'Percussion');
INSERT INTO INSTRUMENT(INSTRUMENT_ID,SECTION_ID,NAME) VALUES(INSTRUMENT_ID_SEQ.NEXTVAL,NULL,'Piano');
INSERT INTO INSTRUMENT(INSTRUMENT_ID,SECTION_ID,NAME) VALUES(INSTRUMENT_ID_SEQ.NEXTVAL,NULL,'String');
INSERT INTO INSTRUMENT(INSTRUMENT_ID,SECTION_ID,NAME) VALUES(INSTRUMENT_ID_SEQ.NEXTVAL,NULL,'Vocals');
INSERT INTO INSTRUMENT(INSTRUMENT_ID,SECTION_ID,NAME) VALUES(INSTRUMENT_ID_SEQ.NEXTVAL,NULL,'Wind');
INSERT INTO INSTRUMENT(INSTRUMENT_ID,SECTION_ID,NAME) VALUES(INSTRUMENT_ID_SEQ.NEXTVAL,NULL,'Orchestra');

INSERT INTO INSTRUMENT(INSTRUMENT_ID,SECTION_ID,NAME) VALUES(INSTRUMENT_ID_SEQ.NEXTVAL,(SELECT INSTRUMENT_ID FROM INSTRUMENT WHERE NAME='Guitar')			,'Acoustic Guitar');
INSERT INTO INSTRUMENT(INSTRUMENT_ID,SECTION_ID,NAME) VALUES(INSTRUMENT_ID_SEQ.NEXTVAL,(SELECT INSTRUMENT_ID FROM INSTRUMENT WHERE NAME='Guitar')			,'Electric Guitar');
INSERT INTO INSTRUMENT(INSTRUMENT_ID,SECTION_ID,NAME) VALUES(INSTRUMENT_ID_SEQ.NEXTVAL,(SELECT INSTRUMENT_ID FROM INSTRUMENT WHERE NAME='Wind')			,'Brass');
INSERT INTO INSTRUMENT(INSTRUMENT_ID,SECTION_ID,NAME) VALUES(INSTRUMENT_ID_SEQ.NEXTVAL,(SELECT INSTRUMENT_ID FROM INSTRUMENT WHERE NAME='Wind')			,'Woodwind');

INSERT INTO INSTRUMENT(INSTRUMENT_ID,SECTION_ID,NAME) VALUES(INSTRUMENT_ID_SEQ.NEXTVAL,(SELECT INSTRUMENT_ID FROM INSTRUMENT WHERE NAME='Woodwind')		,'Alto Horn');
INSERT INTO INSTRUMENT(INSTRUMENT_ID,SECTION_ID,NAME) VALUES(INSTRUMENT_ID_SEQ.NEXTVAL,(SELECT INSTRUMENT_ID FROM INSTRUMENT WHERE NAME='Brass')			,'Alto Saxophone');
INSERT INTO INSTRUMENT(INSTRUMENT_ID,SECTION_ID,NAME) VALUES(INSTRUMENT_ID_SEQ.NEXTVAL,(SELECT INSTRUMENT_ID FROM INSTRUMENT WHERE NAME='Vocals')			,'Background Vocals');
INSERT INTO INSTRUMENT(INSTRUMENT_ID,SECTION_ID,NAME) VALUES(INSTRUMENT_ID_SEQ.NEXTVAL,(SELECT INSTRUMENT_ID FROM INSTRUMENT WHERE NAME='Brass')			,'Baritone / Bass Saxophone');
INSERT INTO INSTRUMENT(INSTRUMENT_ID,SECTION_ID,NAME) VALUES(INSTRUMENT_ID_SEQ.NEXTVAL,(SELECT INSTRUMENT_ID FROM INSTRUMENT WHERE NAME='Woodwind')		,'Baritone Horn');
INSERT INTO INSTRUMENT(INSTRUMENT_ID,SECTION_ID,NAME) VALUES(INSTRUMENT_ID_SEQ.NEXTVAL,(SELECT INSTRUMENT_ID FROM INSTRUMENT WHERE NAME='Electric Guitar')	,'Bass Guitar');
INSERT INTO INSTRUMENT(INSTRUMENT_ID,SECTION_ID,NAME) VALUES(INSTRUMENT_ID_SEQ.NEXTVAL,(SELECT INSTRUMENT_ID FROM INSTRUMENT WHERE NAME='String')			,'Cello');
INSERT INTO INSTRUMENT(INSTRUMENT_ID,SECTION_ID,NAME) VALUES(INSTRUMENT_ID_SEQ.NEXTVAL,(SELECT INSTRUMENT_ID FROM INSTRUMENT WHERE NAME='Woodwind')		,'Clarinet');
INSERT INTO INSTRUMENT(INSTRUMENT_ID,SECTION_ID,NAME) VALUES(INSTRUMENT_ID_SEQ.NEXTVAL,(SELECT INSTRUMENT_ID FROM INSTRUMENT WHERE NAME='Percussion')		,'Cymbals');
INSERT INTO INSTRUMENT(INSTRUMENT_ID,SECTION_ID,NAME) VALUES(INSTRUMENT_ID_SEQ.NEXTVAL,(SELECT INSTRUMENT_ID FROM INSTRUMENT WHERE NAME='String')			,'Double Bass');
INSERT INTO INSTRUMENT(INSTRUMENT_ID,SECTION_ID,NAME) VALUES(INSTRUMENT_ID_SEQ.NEXTVAL,(SELECT INSTRUMENT_ID FROM INSTRUMENT WHERE NAME='General')		,'Double Reeds');
INSERT INTO INSTRUMENT(INSTRUMENT_ID,SECTION_ID,NAME) VALUES(INSTRUMENT_ID_SEQ.NEXTVAL,(SELECT INSTRUMENT_ID FROM INSTRUMENT WHERE NAME='Percussion')		,'Drum Machines');
INSERT INTO INSTRUMENT(INSTRUMENT_ID,SECTION_ID,NAME) VALUES(INSTRUMENT_ID_SEQ.NEXTVAL,(SELECT INSTRUMENT_ID FROM INSTRUMENT WHERE NAME='Percussion')		,'Drums');
INSERT INTO INSTRUMENT(INSTRUMENT_ID,SECTION_ID,NAME) VALUES(INSTRUMENT_ID_SEQ.NEXTVAL,(SELECT INSTRUMENT_ID FROM INSTRUMENT WHERE NAME='Percussion')		,'Electronic Drums');
INSERT INTO INSTRUMENT(INSTRUMENT_ID,SECTION_ID,NAME) VALUES(INSTRUMENT_ID_SEQ.NEXTVAL,(SELECT INSTRUMENT_ID FROM INSTRUMENT WHERE NAME='String')			,'Fiddle');
INSERT INTO INSTRUMENT(INSTRUMENT_ID,SECTION_ID,NAME) VALUES(INSTRUMENT_ID_SEQ.NEXTVAL,(SELECT INSTRUMENT_ID FROM INSTRUMENT WHERE NAME='Wind')			,'Flugelhorn');
INSERT INTO INSTRUMENT(INSTRUMENT_ID,SECTION_ID,NAME) VALUES(INSTRUMENT_ID_SEQ.NEXTVAL,(SELECT INSTRUMENT_ID FROM INSTRUMENT WHERE NAME='Wind')			,'Flute');
INSERT INTO INSTRUMENT(INSTRUMENT_ID,SECTION_ID,NAME) VALUES(INSTRUMENT_ID_SEQ.NEXTVAL,(SELECT INSTRUMENT_ID FROM INSTRUMENT WHERE NAME='Brass')			,'French Horn');
INSERT INTO INSTRUMENT(INSTRUMENT_ID,SECTION_ID,NAME) VALUES(INSTRUMENT_ID_SEQ.NEXTVAL,(SELECT INSTRUMENT_ID FROM INSTRUMENT WHERE NAME='Piano')			,'Keyboards');
INSERT INTO INSTRUMENT(INSTRUMENT_ID,SECTION_ID,NAME) VALUES(INSTRUMENT_ID_SEQ.NEXTVAL,(SELECT INSTRUMENT_ID FROM INSTRUMENT WHERE NAME='Percussion')		,'Latin Percussion');
INSERT INTO INSTRUMENT(INSTRUMENT_ID,SECTION_ID,NAME) VALUES(INSTRUMENT_ID_SEQ.NEXTVAL,(SELECT INSTRUMENT_ID FROM INSTRUMENT WHERE NAME='Electric Guitar')	,'Lead Guitar');
INSERT INTO INSTRUMENT(INSTRUMENT_ID,SECTION_ID,NAME) VALUES(INSTRUMENT_ID_SEQ.NEXTVAL,(SELECT INSTRUMENT_ID FROM INSTRUMENT WHERE NAME='General')		,'Mellophone');
INSERT INTO INSTRUMENT(INSTRUMENT_ID,SECTION_ID,NAME) VALUES(INSTRUMENT_ID_SEQ.NEXTVAL,(SELECT INSTRUMENT_ID FROM INSTRUMENT WHERE NAME='Wind')			,'Piccolo');
INSERT INTO INSTRUMENT(INSTRUMENT_ID,SECTION_ID,NAME) VALUES(INSTRUMENT_ID_SEQ.NEXTVAL,(SELECT INSTRUMENT_ID FROM INSTRUMENT WHERE NAME='Acoustic Guitar')	,'Rhythm Guitar');
INSERT INTO INSTRUMENT(INSTRUMENT_ID,SECTION_ID,NAME) VALUES(INSTRUMENT_ID_SEQ.NEXTVAL,(SELECT INSTRUMENT_ID FROM INSTRUMENT WHERE NAME='Brass')			,'Soprano Saxophone');
INSERT INTO INSTRUMENT(INSTRUMENT_ID,SECTION_ID,NAME) VALUES(INSTRUMENT_ID_SEQ.NEXTVAL,(SELECT INSTRUMENT_ID FROM INSTRUMENT WHERE NAME='Brass')			,'Sousaphone');
INSERT INTO INSTRUMENT(INSTRUMENT_ID,SECTION_ID,NAME) VALUES(INSTRUMENT_ID_SEQ.NEXTVAL,(SELECT INSTRUMENT_ID FROM INSTRUMENT WHERE NAME='Acoustic Guitar')	,'Steel Guitar');
INSERT INTO INSTRUMENT(INSTRUMENT_ID,SECTION_ID,NAME) VALUES(INSTRUMENT_ID_SEQ.NEXTVAL,(SELECT INSTRUMENT_ID FROM INSTRUMENT WHERE NAME='Brass')			,'Tenor Saxophone');
INSERT INTO INSTRUMENT(INSTRUMENT_ID,SECTION_ID,NAME) VALUES(INSTRUMENT_ID_SEQ.NEXTVAL,(SELECT INSTRUMENT_ID FROM INSTRUMENT WHERE NAME='Brass')			,'Trombone');
INSERT INTO INSTRUMENT(INSTRUMENT_ID,SECTION_ID,NAME) VALUES(INSTRUMENT_ID_SEQ.NEXTVAL,(SELECT INSTRUMENT_ID FROM INSTRUMENT WHERE NAME='Brass')			,'Trumpet');
INSERT INTO INSTRUMENT(INSTRUMENT_ID,SECTION_ID,NAME) VALUES(INSTRUMENT_ID_SEQ.NEXTVAL,(SELECT INSTRUMENT_ID FROM INSTRUMENT WHERE NAME='Brass')			,'Tuba');
INSERT INTO INSTRUMENT(INSTRUMENT_ID,SECTION_ID,NAME) VALUES(INSTRUMENT_ID_SEQ.NEXTVAL,(SELECT INSTRUMENT_ID FROM INSTRUMENT WHERE NAME='String')			,'Viola');
INSERT INTO INSTRUMENT(INSTRUMENT_ID,SECTION_ID,NAME) VALUES(INSTRUMENT_ID_SEQ.NEXTVAL,(SELECT INSTRUMENT_ID FROM INSTRUMENT WHERE NAME='String')			,'Violin');

COMMIT;
SPOOL OFF;

Music Schema Data Generation: ARTIST.SQL

SPOOL log/ARTIST.LOG;
INSERT INTO ARTIST(ARTIST_ID,NAME,INSTRUMENTS)
VALUES(ARTIST_ID_SEQ.NEXTVAL,'Sheryl Crow'
,INSTRUMENTSCOLLECTION('Vocals','Acoustic Guitar','Electric Guitar'));
INSERT INTO ARTIST(ARTIST_ID,NAME,INSTRUMENTS)
VALUES(ARTIST_ID_SEQ.NEXTVAL,'Barry Manilow'
,INSTRUMENTSCOLLECTION('Vocals','Piano'));
INSERT INTO ARTIST(ARTIST_ID,NAME,INSTRUMENTS)
VALUES(ARTIST_ID_SEQ.NEXTVAL,'Avril Lavigne'
,INSTRUMENTSCOLLECTION('Vocals'));
INSERT INTO ARTIST(ARTIST_ID,NAME,INSTRUMENTS)
VALUES(ARTIST_ID_SEQ.NEXTVAL,'Goo Goo Dolls',null);
INSERT INTO ARTIST(ARTIST_ID,NAME,INSTRUMENTS)
VALUES(ARTIST_ID_SEQ.NEXTVAL,'Puddle of Mudd',null);
INSERT INTO ARTIST(ARTIST_ID,NAME,INSTRUMENTS)
VALUES(ARTIST_ID_SEQ.NEXTVAL,'Nickelback',null);
INSERT INTO ARTIST(ARTIST_ID,NAME,INSTRUMENTS)
VALUES(ARTIST_ID_SEQ.NEXTVAL,'Matchbox Twenty',null);
INSERT INTO ARTIST(ARTIST_ID,NAME,INSTRUMENTS) VALUES(ARTIST_ID_SEQ.NEXTVAL,'Jewel'
,INSTRUMENTSCOLLECTION('Vocals','Acoustic Guitar'));
INSERT INTO ARTIST(ARTIST_ID,NAME,INSTRUMENTS) VALUES(ARTIST_ID_SEQ.NEXTVAL,'Mozart',NULL);
INSERT INTO ARTIST(ARTIST_ID,NAME,INSTRUMENTS) VALUES(ARTIST_ID_SEQ.NEXTVAL,'James Taylor',INSTRUMENTSCOLLECTION('Vocals','Acoustic Guitar'));
COMMIT;
SPOOL OFF;

Music Schema Data Generation: GENRE.SQL

SPOOL log/GENRE.LOG;
INSERT INTO GENRE (GENRE_ID,STYLE_ID,GENRE) VALUES (GENRE_ID_SEQ.NEXTVAL,NULL,'Classical');
INSERT INTO GENRE (GENRE_ID,STYLE_ID,GENRE) VALUES (GENRE_ID_SEQ.NEXTVAL,NULL,'Folk');
INSERT INTO GENRE (GENRE_ID,STYLE_ID,GENRE) VALUES (GENRE_ID_SEQ.NEXTVAL,NULL,'Popular');
INSERT INTO GENRE (GENRE_ID,STYLE_ID,GENRE) VALUES (GENRE_ID_SEQ.NEXTVAL,(SELECT GENRE_ID FROM GENRE WHERE genre='Popular'),'Rock');
INSERT INTO GENRE (GENRE_ID,STYLE_ID,GENRE) VALUES (GENRE_ID_SEQ.NEXTVAL,(SELECT GENRE_ID FROM GENRE WHERE genre='Popular'),'Blues');
INSERT INTO GENRE (GENRE_ID,STYLE_ID,GENRE) VALUES (GENRE_ID_SEQ.NEXTVAL,(SELECT GENRE_ID FROM GENRE WHERE genre='Popular'),'Contemporary');
INSERT INTO GENRE (GENRE_ID,STYLE_ID,GENRE) VALUES (GENRE_ID_SEQ.NEXTVAL,(SELECT GENRE_ID FROM GENRE WHERE genre='Popular'),'Motown');
INSERT INTO GENRE (GENRE_ID,STYLE_ID,GENRE) VALUES (GENRE_ID_SEQ.NEXTVAL,(SELECT GENRE_ID FROM GENRE WHERE genre='Popular'),'Reggae');
INSERT INTO GENRE (GENRE_ID,STYLE_ID,GENRE) VALUES (GENRE_ID_SEQ.NEXTVAL,(SELECT GENRE_ID FROM GENRE WHERE genre='Rock'),'Heavy Rock');
INSERT INTO GENRE (GENRE_ID,STYLE_ID,GENRE) VALUES (GENRE_ID_SEQ.NEXTVAL,(SELECT GENRE_ID FROM GENRE WHERE genre='Rock'),'Intellectual Rock');
INSERT INTO GENRE (GENRE_ID,STYLE_ID,GENRE) VALUES (GENRE_ID_SEQ.NEXTVAL,(SELECT GENRE_ID FROM GENRE WHERE genre='Rock'),'Grunge');
INSERT INTO GENRE (GENRE_ID,STYLE_ID,GENRE) VALUES (GENRE_ID_SEQ.NEXTVAL,(SELECT GENRE_ID FROM GENRE WHERE genre='Rock'),'American Soft Rock');
INSERT INTO GENRE (GENRE_ID,STYLE_ID,GENRE) VALUES (GENRE_ID_SEQ.NEXTVAL,(SELECT GENRE_ID FROM GENRE WHERE genre='Rock'),'Weird Rock');
INSERT INTO GENRE (GENRE_ID,STYLE_ID,GENRE) VALUES (GENRE_ID_SEQ.NEXTVAL,(SELECT GENRE_ID FROM GENRE WHERE genre='Rock'),'More Weird Rock');
INSERT INTO GENRE (GENRE_ID,STYLE_ID,GENRE) VALUES (GENRE_ID_SEQ.NEXTVAL,(SELECT GENRE_ID FROM GENRE WHERE genre='Rock'),'Manic Rock');
COMMIT;
SPOOL OFF;

Music Schema Data Generation: MUSICCD.SQL

SPOOL log/MUSICCD.LOG;
INSERT INTO MUSICCD (MUSICCD_ID,GENRE_ID,TITLE,PRESSED_DATE,LIST_PRICE)
VALUES (MUSICCD_ID_SEQ.NEXTVAL,(SELECT GENRE_ID FROM GENRE WHERE GENRE='American Soft Rock'),'Soak Up the Sun','28-FEB-2001',9.99);
INSERT INTO MUSICCD (MUSICCD_ID,GENRE_ID,TITLE,PRESSED_DATE,LIST_PRICE)
VALUES (MUSICCD_ID_SEQ.NEXTVAL,(SELECT GENRE_ID FROM GENRE WHERE GENRE='Manic Rock'),'Complicated','15-DEC-2001',19.99);
INSERT INTO MUSICCD (MUSICCD_ID,GENRE_ID,TITLE,PRESSED_DATE,LIST_PRICE)
VALUES (MUSICCD_ID_SEQ.NEXTVAL,(SELECT GENRE_ID FROM GENRE WHERE GENRE='Weird Rock'),'Here Is Gone Pt.1','11-JUN-2002',14.99);
INSERT INTO MUSICCD (MUSICCD_ID,GENRE_ID,TITLE,PRESSED_DATE,LIST_PRICE)
VALUES (MUSICCD_ID_SEQ.NEXTVAL,(SELECT GENRE_ID FROM GENRE WHERE GENRE='More Weird Rock'),'Here Is Gone Pt.2','15-NOV-2001',9.99);
INSERT INTO MUSICCD (MUSICCD_ID,GENRE_ID,TITLE,PRESSED_DATE,PLAYING_TIME,LIST_PRICE)
VALUES (MUSICCD_ID_SEQ.NEXTVAL,(SELECT GENRE_ID FROM GENRE WHERE GENRE='American Soft Rock'),'C''mon, C''mon','23-JAN-2002','56:32',19.99);
INSERT INTO MUSICCD (MUSICCD_ID,GENRE_ID,TITLE,PRESSED_DATE,PLAYING_TIME,LIST_PRICE)
VALUES (MUSICCD_ID_SEQ.NEXTVAL,(SELECT GENRE_ID FROM GENRE WHERE GENRE='Popular'),'Come Clean','09-JAN-02','48:03',14.99);
INSERT INTO MUSICCD (MUSICCD_ID,GENRE_ID,TITLE,PRESSED_DATE,PLAYING_TIME,LIST_PRICE)
VALUES (MUSICCD_ID_SEQ.NEXTVAL,(SELECT GENRE_ID FROM GENRE WHERE GENRE='Rock'),'Silver Side Up','14-JUL-2002','39:08',9.99);
INSERT INTO MUSICCD (MUSICCD_ID,GENRE_ID,TITLE,PRESSED_DATE,PLAYING_TIME,LIST_PRICE)
VALUES (MUSICCD_ID_SEQ.NEXTVAL,(SELECT GENRE_ID FROM GENRE WHERE GENRE='Contemporary'),'Ultimate Manilow','25-MAR-2002','77:43',19.99);
INSERT INTO MUSICCD (MUSICCD_ID,GENRE_ID,TITLE,LIST_PRICE)
VALUES (MUSICCD_ID_SEQ.NEXTVAL,(SELECT GENRE_ID FROM GENRE WHERE GENRE='Grunge'),'Mad Season',14.99);
INSERT INTO MUSICCD (MUSICCD_ID,GENRE_ID,TITLE,PLAYING_TIME,LIST_PRICE)
VALUES (MUSICCD_ID_SEQ.NEXTVAL,(SELECT GENRE_ID FROM GENRE WHERE GENRE='Blues'),'This Way','58:42',9.99);
INSERT INTO MUSICCD (MUSICCD_ID,GENRE_ID,TITLE,PRESSED_DATE,PLAYING_TIME,LIST_PRICE)
VALUES (MUSICCD_ID_SEQ.NEXTVAL,(SELECT GENRE_ID FROM GENRE WHERE GENRE='Intellectual Rock'),'The Best of Sheryl Crow','15-SEP-02','44:54',19.99);
INSERT INTO MUSICCD (MUSICCD_ID,GENRE_ID,TITLE,PRESSED_DATE,LIST_PRICE)
VALUES (MUSICCD_ID_SEQ.NEXTVAL,(SELECT GENRE_ID FROM GENRE WHERE GENRE='Classical'),'Requiem','16-MAY-90',7.98);
INSERT INTO MUSICCD (MUSICCD_ID,GENRE_ID,TITLE,PRESSED_DATE,LIST_PRICE)
VALUES (MUSICCD_ID_SEQ.NEXTVAL,(SELECT GENRE_ID FROM GENRE WHERE GENRE='Folk'),'Sweet Baby James','25-OCT-90',10.99);
COMMIT;
SPOOL OFF;

Music Schema Data Generation: SONGANDTRACK.SQL

SPOOL log/SONGANDTRACK.LOG;
SET ECHO OFF

--Soak up the Sun by Sheryl Crow
INSERT INTO SONG(SONG_ID,ARTIST_ID,TITLE, PLAYING_TIME)
VALUES(SONG_ID_SEQ.NEXTVAL
,(SELECT ARTIST_ID FROM ARTIST WHERE NAME='Sheryl Crow')
,'Soak Up The Sun (Album Version)','11:20');
INSERT INTO SONG(SONG_ID,ARTIST_ID,TITLE, PLAYING_TIME) 
VALUES(SONG_ID_SEQ.NEXTVAL
,(SELECT ARTIST_ID FROM ARTIST WHERE NAME='Sheryl Crow')
,'Soak Up The Sun (Sunsweep Radio Mix)','3:20');
INSERT INTO SONG(SONG_ID,ARTIST_ID,TITLE,PLAYING_TIME) 
VALUES(SONG_ID_SEQ.NEXTVAL
,(SELECT ARTIST_ID FROM ARTIST WHERE NAME='Sheryl Crow')
,'Soak Up The Sun (Sunsweep Club Mix)','22:30');
INSERT INTO SONG(SONG_ID,ARTIST_ID,TITLE, PLAYING_TIME) 
VALUES(SONG_ID_SEQ.NEXTVAL
,(SELECT ARTIST_ID FROM ARTIST WHERE NAME='Sheryl Crow')
,'Soak Up The Sun (Sunsweep Dub)','15:30');
COMMIT;

INSERT INTO CDTRACK(MUSICCD_ID,SONG_ID,TRACK_SEQ_NO)
VALUES ((SELECT MUSICCD_ID FROM MUSICCD WHERE TITLE='Soak Up the Sun')
,(SELECT SONG_ID FROM SONG 
WHERE TITLE='Soak Up The Sun (Album Version)'),1);
INSERT INTO CDTRACK(MUSICCD_ID,SONG_ID,TRACK_SEQ_NO)
VALUES ((SELECT MUSICCD_ID FROM MUSICCD WHERE TITLE='Soak Up the Sun')
,(SELECT SONG_ID FROM SONG 
WHERE TITLE='Soak Up The Sun (Sunsweep Radio Mix)'),2);
INSERT INTO CDTRACK(MUSICCD_ID,SONG_ID,TRACK_SEQ_NO)
VALUES ((SELECT MUSICCD_ID FROM MUSICCD WHERE TITLE='Soak Up the Sun')
,(SELECT SONG_ID FROM SONG 
WHERE TITLE='Soak Up The Sun (Sunsweep Club Mix)'),3);
INSERT INTO CDTRACK(MUSICCD_ID,SONG_ID,TRACK_SEQ_NO)
VALUES ((SELECT MUSICCD_ID FROM MUSICCD WHERE TITLE='Soak Up the Sun')
,(SELECT SONG_ID FROM SONG 
WHERE TITLE='Soak Up The Sun (Sunsweep Dub)'),4);
COMMIT;

--Complicated by Avril Lavigne
INSERT INTO SONG(SONG_ID,ARTIST_ID,TITLE) 
VALUES(SONG_ID_SEQ.NEXTVAL
,(SELECT ARTIST_ID FROM ARTIST
WHERE NAME='Avril Lavigne'),'Complicated');
COMMIT;

INSERT INTO CDTRACK(MUSICCD_ID,SONG_ID,TRACK_SEQ_NO)
VALUES ((SELECT MUSICCD_ID FROM MUSICCD WHERE TITLE='Complicated')
,(SELECT SONG_ID FROM SONG WHERE TITLE='Complicated'),1);
COMMIT;

--Here is Gone Pt.1 by Goo Goo Dolls
INSERT INTO SONG(SONG_ID,ARTIST_ID,TITLE)
VALUES(SONG_ID_SEQ.NEXTVAL
,(SELECT ARTIST_ID FROM ARTIST WHERE NAME='Goo Goo Dolls')
,'Here Is Gone');
INSERT INTO SONG(SONG_ID,ARTIST_ID,TITLE)
VALUES(SONG_ID_SEQ.NEXTVAL
,(SELECT ARTIST_ID FROM ARTIST WHERE NAME='Goo Goo Dolls')
,'We Are The Normal');
INSERT INTO SONG(SONG_ID,ARTIST_ID,TITLE)
VALUES(SONG_ID_SEQ.NEXTVAL
,(SELECT ARTIST_ID FROM ARTIST WHERE NAME='Goo Goo Dolls')
,'Burnin Up');
INSERT INTO SONG(SONG_ID,ARTIST_ID,TITLE)
VALUES(SONG_ID_SEQ.NEXTVAL
,(SELECT ARTIST_ID FROM ARTIST WHERE NAME='Goo Goo Dolls')
,'Video');
COMMIT;

INSERT INTO CDTRACK(MUSICCD_ID,SONG_ID,TRACK_SEQ_NO)
VALUES ((SELECT MUSICCD_ID FROM MUSICCD WHERE TITLE='Here Is Gone Pt.1')
,(SELECT SONG_ID FROM SONG WHERE TITLE='Here Is Gone'),1);
INSERT INTO CDTRACK(MUSICCD_ID,SONG_ID,TRACK_SEQ_NO)
VALUES ((SELECT MUSICCD_ID FROM MUSICCD WHERE TITLE='Here Is Gone Pt.1')
,(SELECT SONG_ID FROM SONG WHERE TITLE='We Are The Normal'),2);
INSERT INTO CDTRACK(MUSICCD_ID,SONG_ID,TRACK_SEQ_NO)
VALUES ((SELECT MUSICCD_ID FROM MUSICCD WHERE TITLE='Here Is Gone Pt.1')
,(SELECT SONG_ID FROM SONG WHERE TITLE='Burnin Up'),3);
INSERT INTO CDTRACK(MUSICCD_ID,SONG_ID,TRACK_SEQ_NO)
VALUES ((SELECT MUSICCD_ID FROM MUSICCD WHERE TITLE='Here Is Gone Pt.1')
,(SELECT SONG_ID FROM SONG WHERE TITLE='Video'),4);
COMMIT;

--Here is Gone Pt.2 by Goo Goo Dolls
INSERT INTO SONG(SONG_ID,ARTIST_ID,TITLE)
VALUES(SONG_ID_SEQ.NEXTVAL
,(SELECT ARTIST_ID FROM ARTIST WHERE NAME='Goo Goo Dolls')
,'Here Is Gone Reprise');
INSERT INTO SONG(SONG_ID,ARTIST_ID,TITLE)
VALUES(SONG_ID_SEQ.NEXTVAL
,(SELECT ARTIST_ID FROM ARTIST WHERE NAME='Goo Goo Dolls')
,'Two Days In February');
INSERT INTO SONG(SONG_ID,ARTIST_ID,TITLE)
VALUES(SONG_ID_SEQ.NEXTVAL
,(SELECT ARTIST_ID FROM ARTIST WHERE NAME='Goo Goo Dolls')
,'Girl Right Next To Me');
COMMIT;

INSERT INTO CDTRACK(MUSICCD_ID,SONG_ID,TRACK_SEQ_NO)
VALUES ((SELECT MUSICCD_ID FROM MUSICCD WHERE TITLE='Here Is Gone Pt.2')
,(SELECT SONG_ID FROM SONG WHERE TITLE='Here Is Gone Reprise'),1);
INSERT INTO CDTRACK(MUSICCD_ID,SONG_ID,TRACK_SEQ_NO)
VALUES ((SELECT MUSICCD_ID FROM MUSICCD WHERE TITLE='Here Is Gone Pt.2')
,(SELECT SONG_ID FROM SONG WHERE TITLE='Two Days In February'),2);
INSERT INTO CDTRACK(MUSICCD_ID,SONG_ID,TRACK_SEQ_NO)
VALUES ((SELECT MUSICCD_ID FROM MUSICCD WHERE TITLE='Here Is Gone Pt.2')
,(SELECT SONG_ID FROM SONG WHERE TITLE='Girl Right Next To Me'),3);
COMMIT;

--Cmon Cmon by Sheryl Crow
INSERT INTO SONG(SONG_ID,ARTIST_ID,TITLE,PLAYING_TIME)
VALUES(SONG_ID_SEQ.NEXTVAL
,(SELECT ARTIST_ID FROM ARTIST WHERE NAME='Sheryl Crow')
,'Steve McQueen','3:25');
INSERT INTO SONG(SONG_ID,ARTIST_ID,TITLE,PLAYING_TIME)
VALUES(SONG_ID_SEQ.NEXTVAL
,(SELECT ARTIST_ID FROM ARTIST WHERE NAME='Sheryl Crow')
,'Soak Up The Sun','4:52');
INSERT INTO SONG(SONG_ID,ARTIST_ID,TITLE,PLAYING_TIME)
VALUES(SONG_ID_SEQ.NEXTVAL
,(SELECT ARTIST_ID FROM ARTIST WHERE NAME='Sheryl Crow')
,'You''re An Original','4:18');
INSERT INTO SONG(SONG_ID,ARTIST_ID,TITLE,PLAYING_TIME)
VALUES(SONG_ID_SEQ.NEXTVAL
,(SELECT ARTIST_ID FROM ARTIST WHERE NAME='Sheryl Crow')
,'Safe And Sound','4:32');
INSERT INTO SONG(SONG_ID,ARTIST_ID,TITLE,PLAYING_TIME)
VALUES(SONG_ID_SEQ.NEXTVAL
,(SELECT ARTIST_ID FROM ARTIST WHERE NAME='Sheryl Crow')
,'C''mon, C''mon','4:45');
INSERT INTO SONG(SONG_ID,ARTIST_ID,TITLE,PLAYING_TIME)
VALUES(SONG_ID_SEQ.NEXTVAL
,(SELECT ARTIST_ID FROM ARTIST WHERE NAME='Sheryl Crow')
,'It''s So Easy','3:24');
INSERT INTO SONG(SONG_ID,ARTIST_ID,TITLE,PLAYING_TIME)
VALUES(SONG_ID_SEQ.NEXTVAL
,(SELECT ARTIST_ID FROM ARTIST WHERE NAME='Sheryl Crow')
,'Over You','4:38');
INSERT INTO SONG(SONG_ID,ARTIST_ID,TITLE,PLAYING_TIME)
VALUES(SONG_ID_SEQ.NEXTVAL
,(SELECT ARTIST_ID FROM ARTIST WHERE NAME='Sheryl Crow')
,'Lucky Kid','4:02');
INSERT INTO SONG(SONG_ID,ARTIST_ID,TITLE,PLAYING_TIME)
VALUES(SONG_ID_SEQ.NEXTVAL
,(SELECT ARTIST_ID FROM ARTIST WHERE NAME='Sheryl Crow')
,'Diamond Road','4:09');
INSERT INTO SONG(SONG_ID,ARTIST_ID,TITLE,PLAYING_TIME)
VALUES(SONG_ID_SEQ.NEXTVAL
,(SELECT ARTIST_ID FROM ARTIST WHERE NAME='Sheryl Crow')
,'It''s Only Love','5:05');
INSERT INTO SONG(SONG_ID,ARTIST_ID,TITLE,PLAYING_TIME)
VALUES(SONG_ID_SEQ.NEXTVAL
,(SELECT ARTIST_ID FROM ARTIST WHERE NAME='Sheryl Crow')
,'Abilene','4:05');
INSERT INTO SONG(SONG_ID,ARTIST_ID,TITLE,PLAYING_TIME)
VALUES(SONG_ID_SEQ.NEXTVAL
,(SELECT ARTIST_ID FROM ARTIST WHERE NAME='Sheryl Crow')
,'Hole In My Pocket','4:37');
INSERT INTO SONG(SONG_ID,ARTIST_ID,TITLE,PLAYING_TIME)
VALUES(SONG_ID_SEQ.NEXTVAL
,(SELECT ARTIST_ID FROM ARTIST WHERE NAME='Sheryl Crow')
,'Weather Channel','4:40');
COMMIT;

--Mozart: Requiem
INSERT INTO SONG(SONG_ID,ARTIST_ID,TITLE) VALUES(SONG_ID_SEQ.NEXTVAL,(SELECT ARTIST_ID FROM ARTIST WHERE NAME='Mozart'),'Requiem in D Minor: I. Introitus - Requiem');
INSERT INTO SONG(SONG_ID,ARTIST_ID,TITLE) VALUES(SONG_ID_SEQ.NEXTVAL,(SELECT ARTIST_ID FROM ARTIST WHERE NAME='Mozart'),'Requiem in D Minor: II. Kyrie');
INSERT INTO SONG(SONG_ID,ARTIST_ID,TITLE) VALUES(SONG_ID_SEQ.NEXTVAL,(SELECT ARTIST_ID FROM ARTIST WHERE NAME='Mozart'),'Requiem in D Minor: III. Sequenz - No.1 - Dies irae');
INSERT INTO SONG(SONG_ID,ARTIST_ID,TITLE) VALUES(SONG_ID_SEQ.NEXTVAL,(SELECT ARTIST_ID FROM ARTIST WHERE NAME='Mozart'),'Requiem in D Minor: III. Sequenz - No. 2 - Tuba mirum');
INSERT INTO SONG(SONG_ID,ARTIST_ID,TITLE) VALUES(SONG_ID_SEQ.NEXTVAL,(SELECT ARTIST_ID FROM ARTIST WHERE NAME='Mozart'),'Requiem in D Minor: III. Sequenz - No. 3 - Rex tremendae');
INSERT INTO SONG(SONG_ID,ARTIST_ID,TITLE) VALUES(SONG_ID_SEQ.NEXTVAL,(SELECT ARTIST_ID FROM ARTIST WHERE NAME='Mozart'),'Requiem in D Minor: III. Sequenz - No. 4 - Recordare'); 
INSERT INTO SONG(SONG_ID,ARTIST_ID,TITLE) VALUES(SONG_ID_SEQ.NEXTVAL,(SELECT ARTIST_ID FROM ARTIST WHERE NAME='Mozart'),'Requiem in D Minor: III. Sequenz - No. 5 - Confutatis');
INSERT INTO SONG(SONG_ID,ARTIST_ID,TITLE) VALUES(SONG_ID_SEQ.NEXTVAL,(SELECT ARTIST_ID FROM ARTIST WHERE NAME='Mozart'),'Requiem in D Minor: III. Sequenz - No. 6 - Lacrimosa');
INSERT INTO SONG(SONG_ID,ARTIST_ID,TITLE) VALUES(SONG_ID_SEQ.NEXTVAL,(SELECT ARTIST_ID FROM ARTIST WHERE NAME='Mozart'),'Requiem in D Minor: IV. Offertorium - No. 1 - Domine Jesu');        
INSERT INTO SONG(SONG_ID,ARTIST_ID,TITLE) VALUES(SONG_ID_SEQ.NEXTVAL,(SELECT ARTIST_ID FROM ARTIST WHERE NAME='Mozart'),'Requiem in D Minor: IV. Offertorium - No. 2 - Hostias');        
INSERT INTO SONG(SONG_ID,ARTIST_ID,TITLE) VALUES(SONG_ID_SEQ.NEXTVAL,(SELECT ARTIST_ID FROM ARTIST WHERE NAME='Mozart'),'Requiem in D Minor: V. Sanctus');        
INSERT INTO SONG(SONG_ID,ARTIST_ID,TITLE) VALUES(SONG_ID_SEQ.NEXTVAL,(SELECT ARTIST_ID FROM ARTIST WHERE NAME='Mozart'),'Requiem in D Minor: VI. Benedictus');        
INSERT INTO SONG(SONG_ID,ARTIST_ID,TITLE) VALUES(SONG_ID_SEQ.NEXTVAL,(SELECT ARTIST_ID FROM ARTIST WHERE NAME='Mozart'),'Requiem in D Minor: VII. Agnus Dei');        
INSERT INTO SONG(SONG_ID,ARTIST_ID,TITLE) VALUES(SONG_ID_SEQ.NEXTVAL,(SELECT ARTIST_ID FROM ARTIST WHERE NAME='Mozart'),'Requiem in D Minor: VIII. Communio - Lux aeterna');  
COMMIT;

INSERT INTO SONG(SONG_ID,ARTIST_ID,TITLE) VALUES(SONG_ID_SEQ.NEXTVAL,(SELECT ARTIST_ID FROM ARTIST WHERE NAME='James Taylor'),'Sweet Baby James');
INSERT INTO SONG(SONG_ID,ARTIST_ID,TITLE) VALUES(SONG_ID_SEQ.NEXTVAL,(SELECT ARTIST_ID FROM ARTIST WHERE NAME='James Taylor'),'Lo and Behold');
INSERT INTO SONG(SONG_ID,ARTIST_ID,TITLE) VALUES(SONG_ID_SEQ.NEXTVAL,(SELECT ARTIST_ID FROM ARTIST WHERE NAME='James Taylor'),'Sunny Skies');
INSERT INTO SONG(SONG_ID,ARTIST_ID,TITLE) VALUES(SONG_ID_SEQ.NEXTVAL,(SELECT ARTIST_ID FROM ARTIST WHERE NAME='James Taylor'),'Steamroller');
INSERT INTO SONG(SONG_ID,ARTIST_ID,TITLE) VALUES(SONG_ID_SEQ.NEXTVAL,(SELECT ARTIST_ID FROM ARTIST WHERE NAME='James Taylor'),'Country Road');
INSERT INTO SONG(SONG_ID,ARTIST_ID,TITLE) VALUES(SONG_ID_SEQ.NEXTVAL,(SELECT ARTIST_ID FROM ARTIST WHERE NAME='James Taylor'),'Oh Susanna');        
INSERT INTO SONG(SONG_ID,ARTIST_ID,TITLE) VALUES(SONG_ID_SEQ.NEXTVAL,(SELECT ARTIST_ID FROM ARTIST WHERE NAME='James Taylor'),'Fire and Rain');        
INSERT INTO SONG(SONG_ID,ARTIST_ID,TITLE) VALUES(SONG_ID_SEQ.NEXTVAL,(SELECT ARTIST_ID FROM ARTIST WHERE NAME='James Taylor'),'Blossom');        
INSERT INTO SONG(SONG_ID,ARTIST_ID,TITLE) VALUES(SONG_ID_SEQ.NEXTVAL,(SELECT ARTIST_ID FROM ARTIST WHERE NAME='James Taylor'),'Anywhere Like Heaven');        
INSERT INTO SONG(SONG_ID,ARTIST_ID,TITLE) VALUES(SONG_ID_SEQ.NEXTVAL,(SELECT ARTIST_ID FROM ARTIST WHERE NAME='James Taylor'),'Oh Baby, Don''t You Loose Your Lip on Me');        
INSERT INTO SONG(SONG_ID,ARTIST_ID,TITLE) VALUES(SONG_ID_SEQ.NEXTVAL,(SELECT ARTIST_ID FROM ARTIST WHERE NAME='James Taylor'),'Suite for 20 G');  
COMMIT;

INSERT INTO CDTRACK(MUSICCD_ID,SONG_ID,TRACK_SEQ_NO)
VALUES ((SELECT MUSICCD_ID FROM MUSICCD WHERE TITLE='C''mon, C''mon')
,(SELECT SONG_ID FROM SONG WHERE TITLE='Steve McQueen'),1);
INSERT INTO CDTRACK(MUSICCD_ID,SONG_ID,TRACK_SEQ_NO)
VALUES ((SELECT MUSICCD_ID FROM MUSICCD WHERE TITLE='C''mon, C''mon')
,(SELECT SONG_ID FROM SONG WHERE TITLE='Soak Up The Sun'),2);
INSERT INTO CDTRACK(MUSICCD_ID,SONG_ID,TRACK_SEQ_NO)
VALUES ((SELECT MUSICCD_ID FROM MUSICCD WHERE TITLE='C''mon, C''mon')
,(SELECT SONG_ID FROM SONG WHERE TITLE='You''re An Original'),3);
INSERT INTO CDTRACK(MUSICCD_ID,SONG_ID,TRACK_SEQ_NO)
VALUES ((SELECT MUSICCD_ID FROM MUSICCD WHERE TITLE='C''mon, C''mon')
,(SELECT SONG_ID FROM SONG WHERE TITLE='Safe And Sound'),4);
INSERT INTO CDTRACK(MUSICCD_ID,SONG_ID,TRACK_SEQ_NO)
VALUES ((SELECT MUSICCD_ID FROM MUSICCD WHERE TITLE='C''mon, C''mon')
,(SELECT SONG_ID FROM SONG WHERE TITLE='C''mon, C''mon'),5);
INSERT INTO CDTRACK(MUSICCD_ID,SONG_ID,TRACK_SEQ_NO)
VALUES ((SELECT MUSICCD_ID FROM MUSICCD WHERE TITLE='C''mon, C''mon')
,(SELECT SONG_ID FROM SONG WHERE TITLE='It''s So Easy'),6);
INSERT INTO CDTRACK(MUSICCD_ID,SONG_ID,TRACK_SEQ_NO)
VALUES ((SELECT MUSICCD_ID FROM MUSICCD WHERE TITLE='C''mon, C''mon')
,(SELECT SONG_ID FROM SONG WHERE TITLE='Over You'),7);
INSERT INTO CDTRACK(MUSICCD_ID,SONG_ID,TRACK_SEQ_NO)
VALUES ((SELECT MUSICCD_ID FROM MUSICCD WHERE TITLE='C''mon, C''mon')
,(SELECT SONG_ID FROM SONG WHERE TITLE='Lucky Kid'),8);
INSERT INTO CDTRACK(MUSICCD_ID,SONG_ID,TRACK_SEQ_NO)
VALUES ((SELECT MUSICCD_ID FROM MUSICCD WHERE TITLE='C''mon, C''mon')
,(SELECT SONG_ID FROM SONG WHERE TITLE='Diamond Road'),9);
INSERT INTO CDTRACK(MUSICCD_ID,SONG_ID,TRACK_SEQ_NO)
VALUES ((SELECT MUSICCD_ID FROM MUSICCD WHERE TITLE='C''mon, C''mon')
,(SELECT SONG_ID FROM SONG WHERE TITLE='It''s Only Love'),10);
INSERT INTO CDTRACK(MUSICCD_ID,SONG_ID,TRACK_SEQ_NO)
VALUES ((SELECT MUSICCD_ID FROM MUSICCD WHERE TITLE='C''mon, C''mon')
,(SELECT SONG_ID FROM SONG WHERE TITLE='Abilene'),11);
INSERT INTO CDTRACK(MUSICCD_ID,SONG_ID,TRACK_SEQ_NO)
VALUES ((SELECT MUSICCD_ID FROM MUSICCD WHERE TITLE='C''mon, C''mon')
,(SELECT SONG_ID FROM SONG WHERE TITLE='Hole In My Pocket'),12);
INSERT INTO CDTRACK(MUSICCD_ID,SONG_ID,TRACK_SEQ_NO)
VALUES ((SELECT MUSICCD_ID FROM MUSICCD WHERE TITLE='C''mon, C''mon')
,(SELECT SONG_ID FROM SONG WHERE TITLE='Weather Channel'),13);
COMMIT;

--Come Clean by Puddle of Mudd
INSERT INTO SONG(SONG_ID,ARTIST_ID,TITLE,PLAYING_TIME)
VALUES(SONG_ID_SEQ.NEXTVAL
,(SELECT ARTIST_ID FROM ARTIST WHERE NAME='Puddle of Mudd')
,'Control','3:50');
INSERT INTO SONG(SONG_ID,ARTIST_ID,TITLE,PLAYING_TIME)
VALUES(SONG_ID_SEQ.NEXTVAL
,(SELECT ARTIST_ID FROM ARTIST WHERE NAME='Puddle of Mudd')
,'Drift and Die','4:25');
INSERT INTO SONG(SONG_ID,ARTIST_ID,TITLE,PLAYING_TIME)
VALUES(SONG_ID_SEQ.NEXTVAL
,(SELECT ARTIST_ID FROM ARTIST WHERE NAME='Puddle of Mudd')
,'Out Of My Head','3:43');
INSERT INTO SONG(SONG_ID,ARTIST_ID,TITLE,PLAYING_TIME)
VALUES(SONG_ID_SEQ.NEXTVAL
,(SELECT ARTIST_ID FROM ARTIST WHERE NAME='Puddle of Mudd')
,'Nobody Told Me','5:21');
INSERT INTO SONG(SONG_ID,ARTIST_ID,TITLE,PLAYING_TIME)
VALUES(SONG_ID_SEQ.NEXTVAL
,(SELECT ARTIST_ID FROM ARTIST WHERE NAME='Puddle of Mudd')
,'Blurry','5:04');
INSERT INTO SONG(SONG_ID,ARTIST_ID,TITLE,PLAYING_TIME)
VALUES(SONG_ID_SEQ.NEXTVAL
,(SELECT ARTIST_ID FROM ARTIST WHERE NAME='Puddle of Mudd')
,'She Hates Me','3:36');
INSERT INTO SONG(SONG_ID,ARTIST_ID,TITLE,PLAYING_TIME)
VALUES(SONG_ID_SEQ.NEXTVAL
,(SELECT ARTIST_ID FROM ARTIST WHERE NAME='Puddle of Mudd')
,'Bring Me Down','4:02');
INSERT INTO SONG(SONG_ID,ARTIST_ID,TITLE,PLAYING_TIME)
VALUES(SONG_ID_SEQ.NEXTVAL
,(SELECT ARTIST_ID FROM ARTIST WHERE NAME='Puddle of Mudd')
,'Never Change','3:58');
INSERT INTO SONG(SONG_ID,ARTIST_ID,TITLE,PLAYING_TIME)
VALUES(SONG_ID_SEQ.NEXTVAL
,(SELECT ARTIST_ID FROM ARTIST WHERE NAME='Puddle of Mudd')
,'Basement','4:21');
INSERT INTO SONG(SONG_ID,ARTIST_ID,TITLE,PLAYING_TIME)
VALUES(SONG_ID_SEQ.NEXTVAL
,(SELECT ARTIST_ID FROM ARTIST WHERE NAME='Puddle of Mudd')
,'Said','4:05');
INSERT INTO SONG(SONG_ID,ARTIST_ID,TITLE,PLAYING_TIME)
VALUES(SONG_ID_SEQ.NEXTVAL
,(SELECT ARTIST_ID FROM ARTIST WHERE NAME='Puddle of Mudd')
,'It All Away','5:38');
COMMIT;

INSERT INTO CDTRACK(MUSICCD_ID,SONG_ID,TRACK_SEQ_NO)
VALUES ((SELECT MUSICCD_ID FROM MUSICCD WHERE TITLE='Come Clean')
,(SELECT SONG_ID FROM SONG WHERE TITLE='Control'),1);
INSERT INTO CDTRACK(MUSICCD_ID,SONG_ID,TRACK_SEQ_NO)
VALUES ((SELECT MUSICCD_ID FROM MUSICCD WHERE TITLE='Come Clean')
,(SELECT SONG_ID FROM SONG WHERE TITLE='Drift and Die'),2);
INSERT INTO CDTRACK(MUSICCD_ID,SONG_ID,TRACK_SEQ_NO)
VALUES ((SELECT MUSICCD_ID FROM MUSICCD WHERE TITLE='Come Clean')
,(SELECT SONG_ID FROM SONG WHERE TITLE='Out Of My Head'),3);
INSERT INTO CDTRACK(MUSICCD_ID,SONG_ID,TRACK_SEQ_NO)
VALUES ((SELECT MUSICCD_ID FROM MUSICCD WHERE TITLE='Come Clean')
,(SELECT SONG_ID FROM SONG WHERE TITLE='Nobody Told Me'),4);
INSERT INTO CDTRACK(MUSICCD_ID,SONG_ID,TRACK_SEQ_NO)
VALUES ((SELECT MUSICCD_ID FROM MUSICCD WHERE TITLE='Come Clean')
,(SELECT SONG_ID FROM SONG WHERE TITLE='Blurry'),5);
INSERT INTO CDTRACK(MUSICCD_ID,SONG_ID,TRACK_SEQ_NO)
VALUES ((SELECT MUSICCD_ID FROM MUSICCD WHERE TITLE='Come Clean')
,(SELECT SONG_ID FROM SONG WHERE TITLE='She Hates Me'),6);
INSERT INTO CDTRACK(MUSICCD_ID,SONG_ID,TRACK_SEQ_NO)
VALUES ((SELECT MUSICCD_ID FROM MUSICCD WHERE TITLE='Come Clean')
,(SELECT SONG_ID FROM SONG WHERE TITLE='Bring Me Down'),7);
INSERT INTO CDTRACK(MUSICCD_ID,SONG_ID,TRACK_SEQ_NO)
VALUES ((SELECT MUSICCD_ID FROM MUSICCD WHERE TITLE='Come Clean')
,(SELECT SONG_ID FROM SONG WHERE TITLE='Never Change'),8);
INSERT INTO CDTRACK(MUSICCD_ID,SONG_ID,TRACK_SEQ_NO)
VALUES ((SELECT MUSICCD_ID FROM MUSICCD WHERE TITLE='Come Clean')
,(SELECT SONG_ID FROM SONG WHERE TITLE='Basement'),9);
INSERT INTO CDTRACK(MUSICCD_ID,SONG_ID,TRACK_SEQ_NO)
VALUES ((SELECT MUSICCD_ID FROM MUSICCD WHERE TITLE='Come Clean')
,(SELECT SONG_ID FROM SONG WHERE TITLE='Said'),10);
INSERT INTO CDTRACK(MUSICCD_ID,SONG_ID,TRACK_SEQ_NO)
VALUES ((SELECT MUSICCD_ID FROM MUSICCD WHERE TITLE='Come Clean')
,(SELECT SONG_ID FROM SONG WHERE TITLE='It All Away'),11);
COMMIT;

--Silver Side Up by Nickelback
INSERT INTO SONG(SONG_ID,ARTIST_ID,TITLE,PLAYING_TIME)
VALUES(SONG_ID_SEQ.NEXTVAL
,(SELECT ARTIST_ID FROM ARTIST WHERE NAME='Nickelback')
,'Never Again','4:20');
INSERT INTO SONG(SONG_ID,ARTIST_ID,TITLE,PLAYING_TIME)
VALUES(SONG_ID_SEQ.NEXTVAL
,(SELECT ARTIST_ID FROM ARTIST WHERE NAME='Nickelback')
,'How You Remind Me','3:43');
INSERT INTO SONG(SONG_ID,ARTIST_ID,TITLE,PLAYING_TIME)
VALUES(SONG_ID_SEQ.NEXTVAL
,(SELECT ARTIST_ID FROM ARTIST WHERE NAME='Nickelback')
,'Woke Up This Morning','3:50');
INSERT INTO SONG(SONG_ID,ARTIST_ID,TITLE,PLAYING_TIME)
VALUES(SONG_ID_SEQ.NEXTVAL
,(SELECT ARTIST_ID FROM ARTIST WHERE NAME='Nickelback')
,'Too Bad','3:52');
INSERT INTO SONG(SONG_ID,ARTIST_ID,TITLE,PLAYING_TIME)
VALUES(SONG_ID_SEQ.NEXTVAL
,(SELECT ARTIST_ID FROM ARTIST WHERE NAME='Nickelback')
,'Just For','4:03');
INSERT INTO SONG(SONG_ID,ARTIST_ID,TITLE,PLAYING_TIME)
VALUES(SONG_ID_SEQ.NEXTVAL
,(SELECT ARTIST_ID FROM ARTIST WHERE NAME='Nickelback')
,'Hollywood','3:04');
INSERT INTO SONG(SONG_ID,ARTIST_ID,TITLE,PLAYING_TIME)
VALUES(SONG_ID_SEQ.NEXTVAL
,(SELECT ARTIST_ID FROM ARTIST WHERE NAME='Nickelback')
,'Money Bought','3:24');
INSERT INTO SONG(SONG_ID,ARTIST_ID,TITLE,PLAYING_TIME)
VALUES(SONG_ID_SEQ.NEXTVAL
,(SELECT ARTIST_ID FROM ARTIST WHERE NAME='Nickelback')
,'Where Do I Hide','3:38');
INSERT INTO SONG(SONG_ID,ARTIST_ID,TITLE,PLAYING_TIME)
VALUES(SONG_ID_SEQ.NEXTVAL
,(SELECT ARTIST_ID FROM ARTIST WHERE NAME='Nickelback')
,'Hangnail','3:54');
INSERT INTO SONG(SONG_ID,ARTIST_ID,TITLE,PLAYING_TIME)
VALUES(SONG_ID_SEQ.NEXTVAL
,(SELECT ARTIST_ID FROM ARTIST WHERE NAME='Nickelback')
,'Good Times Gone','5:20');
COMMIT;

INSERT INTO CDTRACK(MUSICCD_ID,SONG_ID,TRACK_SEQ_NO)
VALUES ((SELECT MUSICCD_ID FROM MUSICCD WHERE TITLE='Silver Side Up')
,(SELECT SONG_ID FROM SONG WHERE TITLE='Never Again'),1);
INSERT INTO CDTRACK(MUSICCD_ID,SONG_ID,TRACK_SEQ_NO)
VALUES ((SELECT MUSICCD_ID FROM MUSICCD WHERE TITLE='Silver Side Up')
,(SELECT SONG_ID FROM SONG WHERE TITLE='How You Remind Me'),2);
INSERT INTO CDTRACK(MUSICCD_ID,SONG_ID,TRACK_SEQ_NO)
VALUES ((SELECT MUSICCD_ID FROM MUSICCD WHERE TITLE='Silver Side Up')
,(SELECT SONG_ID FROM SONG WHERE TITLE='Woke Up This Morning'),3);
INSERT INTO CDTRACK(MUSICCD_ID,SONG_ID,TRACK_SEQ_NO)
VALUES ((SELECT MUSICCD_ID FROM MUSICCD WHERE TITLE='Silver Side Up')
,(SELECT SONG_ID FROM SONG WHERE TITLE='Too Bad'),4);
INSERT INTO CDTRACK(MUSICCD_ID,SONG_ID,TRACK_SEQ_NO)
VALUES ((SELECT MUSICCD_ID FROM MUSICCD WHERE TITLE='Silver Side Up')
,(SELECT SONG_ID FROM SONG WHERE TITLE='Just For'),5);
INSERT INTO CDTRACK(MUSICCD_ID,SONG_ID,TRACK_SEQ_NO)
VALUES ((SELECT MUSICCD_ID FROM MUSICCD WHERE TITLE='Silver Side Up')
,(SELECT SONG_ID FROM SONG WHERE TITLE='Hollywood'),6);
INSERT INTO CDTRACK(MUSICCD_ID,SONG_ID,TRACK_SEQ_NO)
VALUES ((SELECT MUSICCD_ID FROM MUSICCD WHERE TITLE='Silver Side Up')
,(SELECT SONG_ID FROM SONG WHERE TITLE='Money Bought'),7);
INSERT INTO CDTRACK(MUSICCD_ID,SONG_ID,TRACK_SEQ_NO)
VALUES ((SELECT MUSICCD_ID FROM MUSICCD WHERE TITLE='Silver Side Up')
,(SELECT SONG_ID FROM SONG WHERE TITLE='Where Do I Hide'),8);
INSERT INTO CDTRACK(MUSICCD_ID,SONG_ID,TRACK_SEQ_NO)
VALUES ((SELECT MUSICCD_ID FROM MUSICCD WHERE TITLE='Silver Side Up')
,(SELECT SONG_ID FROM SONG WHERE TITLE='Hangnail'),9);
INSERT INTO CDTRACK(MUSICCD_ID,SONG_ID,TRACK_SEQ_NO)
VALUES ((SELECT MUSICCD_ID FROM MUSICCD WHERE TITLE='Silver Side Up')
,(SELECT SONG_ID FROM SONG WHERE TITLE='Good Times Gone'),10);
COMMIT;

--Ultimate Manilow by Barry Manilow
INSERT INTO SONG(SONG_ID,ARTIST_ID,TITLE,PLAYING_TIME) 
VALUES(SONG_ID_SEQ.NEXTVAL
,(SELECT ARTIST_ID FROM ARTIST WHERE NAME='Barry Manilow')
,'Mandy','3:17');
INSERT INTO SONG(SONG_ID,ARTIST_ID,TITLE,PLAYING_TIME) 
VALUES(SONG_ID_SEQ.NEXTVAL
,(SELECT ARTIST_ID FROM ARTIST WHERE NAME='Barry Manilow')
,'It''s A Miracle','3:51');
INSERT INTO SONG(SONG_ID,ARTIST_ID,TITLE,PLAYING_TIME) 
VALUES(SONG_ID_SEQ.NEXTVAL
,(SELECT ARTIST_ID FROM ARTIST WHERE NAME='Barry Manilow')
,'Could It Be Magic','6:47');
INSERT INTO SONG(SONG_ID,ARTIST_ID,TITLE,PLAYING_TIME) 
VALUES(SONG_ID_SEQ.NEXTVAL
,(SELECT ARTIST_ID FROM ARTIST WHERE NAME='Barry Manilow')
,'I Write The Songs','3:50');
INSERT INTO SONG(SONG_ID,ARTIST_ID,TITLE,PLAYING_TIME) 
VALUES(SONG_ID_SEQ.NEXTVAL
,(SELECT ARTIST_ID FROM ARTIST WHERE NAME='Barry Manilow')
,'Bandstand Boogie','2:50');
INSERT INTO SONG(SONG_ID,ARTIST_ID,TITLE,PLAYING_TIME) 
VALUES(SONG_ID_SEQ.NEXTVAL
,(SELECT ARTIST_ID FROM ARTIST WHERE NAME='Barry Manilow')
,'Tryin'' To Get The Feeling Again','3:50');
INSERT INTO SONG(SONG_ID,ARTIST_ID,TITLE,PLAYING_TIME) 
VALUES(SONG_ID_SEQ.NEXTVAL
,(SELECT ARTIST_ID FROM ARTIST WHERE NAME='Barry Manilow')
,'This One''s For You','3:26');
INSERT INTO SONG(SONG_ID,ARTIST_ID,TITLE,PLAYING_TIME) 
VALUES(SONG_ID_SEQ.NEXTVAL
,(SELECT ARTIST_ID FROM ARTIST WHERE NAME='Barry Manilow')
,'Weekend In New England','3:45');
INSERT INTO SONG(SONG_ID,ARTIST_ID,TITLE,PLAYING_TIME) 
VALUES(SONG_ID_SEQ.NEXTVAL
,(SELECT ARTIST_ID FROM ARTIST WHERE NAME='Barry Manilow')
,'Looks Like We Made It','3:32');
INSERT INTO SONG(SONG_ID,ARTIST_ID,TITLE,PLAYING_TIME) 
VALUES(SONG_ID_SEQ.NEXTVAL
,(SELECT ARTIST_ID FROM ARTIST WHERE NAME='Barry Manilow')
,'Daybreak','3:05');
INSERT INTO SONG(SONG_ID,ARTIST_ID,TITLE,PLAYING_TIME) 
VALUES(SONG_ID_SEQ.NEXTVAL
,(SELECT ARTIST_ID FROM ARTIST WHERE NAME='Barry Manilow')
,'Can''t Smile Without You','3:07');
INSERT INTO SONG(SONG_ID,ARTIST_ID,TITLE,PLAYING_TIME) 
VALUES(SONG_ID_SEQ.NEXTVAL
,(SELECT ARTIST_ID FROM ARTIST WHERE NAME='Barry Manilow')
,'Even Now','3:26');
INSERT INTO SONG(SONG_ID,ARTIST_ID,TITLE,PLAYING_TIME) 
VALUES(SONG_ID_SEQ.NEXTVAL
,(SELECT ARTIST_ID FROM ARTIST WHERE NAME='Barry Manilow')
,'Copacabana (At The Copa)','5:40');
INSERT INTO SONG(SONG_ID,ARTIST_ID,TITLE,PLAYING_TIME) 
VALUES(SONG_ID_SEQ.NEXTVAL
,(SELECT ARTIST_ID FROM ARTIST WHERE NAME='Barry Manilow')
,'Somewhere In The Night','3:23');
INSERT INTO SONG(SONG_ID,ARTIST_ID,TITLE,PLAYING_TIME) 
VALUES(SONG_ID_SEQ.NEXTVAL
,(SELECT ARTIST_ID FROM ARTIST WHERE NAME='Barry Manilow')
,'Ready To Take A Chance','2:57');
INSERT INTO SONG(SONG_ID,ARTIST_ID,TITLE,PLAYING_TIME) 
VALUES(SONG_ID_SEQ.NEXTVAL
,(SELECT ARTIST_ID FROM ARTIST WHERE NAME='Barry Manilow')
,'Ships','4:00');
INSERT INTO SONG(SONG_ID,ARTIST_ID,TITLE,PLAYING_TIME) 
VALUES(SONG_ID_SEQ.NEXTVAL
,(SELECT ARTIST_ID FROM ARTIST WHERE NAME='Barry Manilow')
,'I Made It Through The Rain','4:19');
INSERT INTO SONG(SONG_ID,ARTIST_ID,TITLE,PLAYING_TIME) 
VALUES(SONG_ID_SEQ.NEXTVAL
,(SELECT ARTIST_ID FROM ARTIST WHERE NAME='Barry Manilow')
,'The Old Songs','4:41');
INSERT INTO SONG(SONG_ID,ARTIST_ID,TITLE,PLAYING_TIME) 
VALUES(SONG_ID_SEQ.NEXTVAL
,(SELECT ARTIST_ID FROM ARTIST WHERE NAME='Barry Manilow')
,'When October Goes','3:58');
INSERT INTO SONG(SONG_ID,ARTIST_ID,TITLE,PLAYING_TIME) 
VALUES(SONG_ID_SEQ.NEXTVAL
,(SELECT ARTIST_ID FROM ARTIST WHERE NAME='Barry Manilow')
,'Somewhere Down The Road','3:59');
COMMIT;

INSERT INTO CDTRACK(MUSICCD_ID,SONG_ID,TRACK_SEQ_NO)
VALUES ((SELECT MUSICCD_ID FROM MUSICCD WHERE TITLE='Ultimate Manilow')
,(SELECT SONG_ID FROM SONG WHERE TITLE='Mandy'),1);
INSERT INTO CDTRACK(MUSICCD_ID,SONG_ID,TRACK_SEQ_NO)
VALUES ((SELECT MUSICCD_ID FROM MUSICCD WHERE TITLE='Ultimate Manilow')
,(SELECT SONG_ID FROM SONG WHERE TITLE='It''s A Miracle'),2);
INSERT INTO CDTRACK(MUSICCD_ID,SONG_ID,TRACK_SEQ_NO)
VALUES ((SELECT MUSICCD_ID FROM MUSICCD WHERE TITLE='Ultimate Manilow')
,(SELECT SONG_ID FROM SONG WHERE TITLE='Could It Be Magic'),3);
INSERT INTO CDTRACK(MUSICCD_ID,SONG_ID,TRACK_SEQ_NO)
VALUES ((SELECT MUSICCD_ID FROM MUSICCD WHERE TITLE='Ultimate Manilow')
,(SELECT SONG_ID FROM SONG WHERE TITLE='I Write The Songs'),4);
INSERT INTO CDTRACK(MUSICCD_ID,SONG_ID,TRACK_SEQ_NO)
VALUES ((SELECT MUSICCD_ID FROM MUSICCD WHERE TITLE='Ultimate Manilow')
,(SELECT SONG_ID FROM SONG WHERE TITLE='Bandstand Boogie'),5);
INSERT INTO CDTRACK(MUSICCD_ID,SONG_ID,TRACK_SEQ_NO)
VALUES ((SELECT MUSICCD_ID FROM MUSICCD WHERE TITLE='Ultimate Manilow')
,(SELECT SONG_ID FROM SONG
WHERE TITLE='Tryin'' To Get The Feeling Again'),6);
INSERT INTO CDTRACK(MUSICCD_ID,SONG_ID,TRACK_SEQ_NO)
VALUES ((SELECT MUSICCD_ID FROM MUSICCD WHERE TITLE='Ultimate Manilow')
,(SELECT SONG_ID FROM SONG WHERE TITLE='This One''s For You'),7);
INSERT INTO CDTRACK(MUSICCD_ID,SONG_ID,TRACK_SEQ_NO)
VALUES ((SELECT MUSICCD_ID FROM MUSICCD WHERE TITLE='Ultimate Manilow')
,(SELECT SONG_ID FROM SONG WHERE TITLE='Weekend In New England'),8);
INSERT INTO CDTRACK(MUSICCD_ID,SONG_ID,TRACK_SEQ_NO)
VALUES ((SELECT MUSICCD_ID FROM MUSICCD WHERE TITLE='Ultimate Manilow')
,(SELECT SONG_ID FROM SONG WHERE TITLE='Looks Like We Made It'),9);
INSERT INTO CDTRACK(MUSICCD_ID,SONG_ID,TRACK_SEQ_NO)
VALUES ((SELECT MUSICCD_ID FROM MUSICCD WHERE TITLE='Ultimate Manilow')
,(SELECT SONG_ID FROM SONG WHERE TITLE='Daybreak'),10);
INSERT INTO CDTRACK(MUSICCD_ID,SONG_ID,TRACK_SEQ_NO)
VALUES ((SELECT MUSICCD_ID FROM MUSICCD WHERE TITLE='Ultimate Manilow')
,(SELECT SONG_ID FROM SONG WHERE TITLE='Can''t Smile Without You'),11);
INSERT INTO CDTRACK(MUSICCD_ID,SONG_ID,TRACK_SEQ_NO)
VALUES ((SELECT MUSICCD_ID FROM MUSICCD WHERE TITLE='Ultimate Manilow')
,(SELECT SONG_ID FROM SONG WHERE TITLE='Even Now'),12);
INSERT INTO CDTRACK(MUSICCD_ID,SONG_ID,TRACK_SEQ_NO)
VALUES ((SELECT MUSICCD_ID FROM MUSICCD WHERE TITLE='Ultimate Manilow')
,(SELECT SONG_ID FROM SONG WHERE TITLE='Copacabana (At The Copa)'),13);
INSERT INTO CDTRACK(MUSICCD_ID,SONG_ID,TRACK_SEQ_NO)
VALUES ((SELECT MUSICCD_ID FROM MUSICCD WHERE TITLE='Ultimate Manilow')
,(SELECT SONG_ID FROM SONG WHERE TITLE='Somewhere In The Night'),14);
INSERT INTO CDTRACK(MUSICCD_ID,SONG_ID,TRACK_SEQ_NO)
VALUES ((SELECT MUSICCD_ID FROM MUSICCD WHERE TITLE='Ultimate Manilow')
,(SELECT SONG_ID FROM SONG WHERE TITLE='Ready To Take A Chance'),15);
INSERT INTO CDTRACK(MUSICCD_ID,SONG_ID,TRACK_SEQ_NO)
VALUES ((SELECT MUSICCD_ID FROM MUSICCD WHERE TITLE='Ultimate Manilow')
,(SELECT SONG_ID FROM SONG WHERE TITLE='Ships'),16);
INSERT INTO CDTRACK(MUSICCD_ID,SONG_ID,TRACK_SEQ_NO)
VALUES ((SELECT MUSICCD_ID FROM MUSICCD WHERE TITLE='Ultimate Manilow')
,(SELECT SONG_ID FROM SONG
WHERE TITLE='I Made It Through The Rain'),17);
INSERT INTO CDTRACK(MUSICCD_ID,SONG_ID,TRACK_SEQ_NO)
VALUES ((SELECT MUSICCD_ID FROM MUSICCD WHERE TITLE='Ultimate Manilow')
,(SELECT SONG_ID FROM SONG WHERE TITLE='The Old Songs'),18);
INSERT INTO CDTRACK(MUSICCD_ID,SONG_ID,TRACK_SEQ_NO)
VALUES ((SELECT MUSICCD_ID FROM MUSICCD WHERE TITLE='Ultimate Manilow')
,(SELECT SONG_ID FROM SONG WHERE TITLE='When October Goes'),19);
INSERT INTO CDTRACK(MUSICCD_ID,SONG_ID,TRACK_SEQ_NO)
VALUES ((SELECT MUSICCD_ID FROM MUSICCD WHERE TITLE='Ultimate Manilow')
,(SELECT SONG_ID FROM SONG WHERE TITLE='Somewhere Down The Road'),20);
COMMIT;

--Mad Season By Matchbox Twenty
INSERT INTO SONG(SONG_ID,ARTIST_ID,TITLE) 
VALUES(SONG_ID_SEQ.NEXTVAL
,(SELECT ARTIST_ID FROM ARTIST WHERE NAME='Matchbox Twenty'),'Angry');
INSERT INTO SONG(SONG_ID,ARTIST_ID,TITLE) 
VALUES(SONG_ID_SEQ.NEXTVAL
,(SELECT ARTIST_ID FROM ARTIST WHERE NAME='Matchbox Twenty')
,'Black and White People');
INSERT INTO SONG(SONG_ID,ARTIST_ID,TITLE) 
VALUES(SONG_ID_SEQ.NEXTVAL
,(SELECT ARTIST_ID FROM ARTIST WHERE NAME='Matchbox Twenty'),'Crutch');
INSERT INTO SONG(SONG_ID,ARTIST_ID,TITLE) 
VALUES(SONG_ID_SEQ.NEXTVAL
,(SELECT ARTIST_ID FROM ARTIST WHERE NAME='Matchbox Twenty')
,'Last Beautiful Girl');
INSERT INTO SONG(SONG_ID,ARTIST_ID,TITLE) 
VALUES(SONG_ID_SEQ.NEXTVAL
,(SELECT ARTIST_ID FROM ARTIST WHERE NAME='Matchbox Twenty')
,'If You''re Gone');
INSERT INTO SONG(SONG_ID,ARTIST_ID,TITLE) 
VALUES(SONG_ID_SEQ.NEXTVAL
,(SELECT ARTIST_ID FROM ARTIST WHERE NAME='Matchbox Twenty')
,'Mad Season');
INSERT INTO SONG(SONG_ID,ARTIST_ID,TITLE) 
VALUES(SONG_ID_SEQ.NEXTVAL
,(SELECT ARTIST_ID FROM ARTIST WHERE NAME='Matchbox Twenty')
,'Rest Stop');
INSERT INTO SONG(SONG_ID,ARTIST_ID,TITLE) 
VALUES(SONG_ID_SEQ.NEXTVAL
,(SELECT ARTIST_ID FROM ARTIST WHERE NAME='Matchbox Twenty')
,'The Burn');
INSERT INTO SONG(SONG_ID,ARTIST_ID,TITLE) 
VALUES(SONG_ID_SEQ.NEXTVAL
,(SELECT ARTIST_ID FROM ARTIST WHERE NAME='Matchbox Twenty'),'Bent');
INSERT INTO SONG(SONG_ID,ARTIST_ID,TITLE) 
VALUES(SONG_ID_SEQ.NEXTVAL
,(SELECT ARTIST_ID FROM ARTIST WHERE NAME='Matchbox Twenty')
,'Bed Of Lies');
INSERT INTO SONG(SONG_ID,ARTIST_ID,TITLE) 
VALUES(SONG_ID_SEQ.NEXTVAL
,(SELECT ARTIST_ID FROM ARTIST WHERE NAME='Matchbox Twenty'),'Leave');
INSERT INTO SONG(SONG_ID,ARTIST_ID,TITLE) 
VALUES(SONG_ID_SEQ.NEXTVAL
,(SELECT ARTIST_ID FROM ARTIST WHERE NAME='Matchbox Twenty'),'Stop');
INSERT INTO SONG(SONG_ID,ARTIST_ID,TITLE) 
VALUES(SONG_ID_SEQ.NEXTVAL
,(SELECT ARTIST_ID FROM ARTIST WHERE NAME='Matchbox Twenty')
,'You Won''t Be Mine');
COMMIT;

INSERT INTO CDTRACK(MUSICCD_ID,SONG_ID,TRACK_SEQ_NO)
VALUES ((SELECT MUSICCD_ID FROM MUSICCD WHERE TITLE='Mad Season')
,(SELECT SONG_ID FROM SONG WHERE TITLE='Angry'),1);
INSERT INTO CDTRACK(MUSICCD_ID,SONG_ID,TRACK_SEQ_NO)
VALUES ((SELECT MUSICCD_ID FROM MUSICCD WHERE TITLE='Mad Season')
,(SELECT SONG_ID FROM SONG WHERE TITLE='Black and White People'),2);
INSERT INTO CDTRACK(MUSICCD_ID,SONG_ID,TRACK_SEQ_NO)
VALUES ((SELECT MUSICCD_ID FROM MUSICCD WHERE TITLE='Mad Season')
,(SELECT SONG_ID FROM SONG WHERE TITLE='Crutch'),3);
INSERT INTO CDTRACK(MUSICCD_ID,SONG_ID,TRACK_SEQ_NO)
VALUES ((SELECT MUSICCD_ID FROM MUSICCD WHERE TITLE='Mad Season')
,(SELECT SONG_ID FROM SONG WHERE TITLE='Last Beautiful Girl'),4);
INSERT INTO CDTRACK(MUSICCD_ID,SONG_ID,TRACK_SEQ_NO)
VALUES ((SELECT MUSICCD_ID FROM MUSICCD WHERE TITLE='Mad Season')
,(SELECT SONG_ID FROM SONG WHERE TITLE='If You''re Gone'),5);
INSERT INTO CDTRACK(MUSICCD_ID,SONG_ID,TRACK_SEQ_NO)
VALUES ((SELECT MUSICCD_ID FROM MUSICCD WHERE TITLE='Mad Season')
,(SELECT SONG_ID FROM SONG WHERE TITLE='Mad Season'),6);
INSERT INTO CDTRACK(MUSICCD_ID,SONG_ID,TRACK_SEQ_NO)
VALUES ((SELECT MUSICCD_ID FROM MUSICCD WHERE TITLE='Mad Season')
,(SELECT SONG_ID FROM SONG WHERE TITLE='Rest Stop'),7);
INSERT INTO CDTRACK(MUSICCD_ID,SONG_ID,TRACK_SEQ_NO)
VALUES ((SELECT MUSICCD_ID FROM MUSICCD WHERE TITLE='Mad Season')
,(SELECT SONG_ID FROM SONG WHERE TITLE='The Burn'),8);
INSERT INTO CDTRACK(MUSICCD_ID,SONG_ID,TRACK_SEQ_NO)
VALUES ((SELECT MUSICCD_ID FROM MUSICCD WHERE TITLE='Mad Season')
,(SELECT SONG_ID FROM SONG WHERE TITLE='Bent'),9);
INSERT INTO CDTRACK(MUSICCD_ID,SONG_ID,TRACK_SEQ_NO)
VALUES ((SELECT MUSICCD_ID FROM MUSICCD WHERE TITLE='Mad Season')
,(SELECT SONG_ID FROM SONG WHERE TITLE='Bed Of Lies'),10);
INSERT INTO CDTRACK(MUSICCD_ID,SONG_ID,TRACK_SEQ_NO)
VALUES ((SELECT MUSICCD_ID FROM MUSICCD WHERE TITLE='Mad Season')
,(SELECT SONG_ID FROM SONG WHERE TITLE='Leave'),11);
INSERT INTO CDTRACK(MUSICCD_ID,SONG_ID,TRACK_SEQ_NO)
VALUES ((SELECT MUSICCD_ID FROM MUSICCD WHERE TITLE='Mad Season')
,(SELECT SONG_ID FROM SONG WHERE TITLE='Stop'),12);
INSERT INTO CDTRACK(MUSICCD_ID,SONG_ID,TRACK_SEQ_NO)
VALUES ((SELECT MUSICCD_ID FROM MUSICCD WHERE TITLE='Mad Season')
,(SELECT SONG_ID FROM SONG WHERE TITLE='You Won''t Be Mine'),13);
COMMIT;

--This Way by Jewel
INSERT INTO SONG(SONG_ID,ARTIST_ID,TITLE,PLAYING_TIME) 
VALUES(SONG_ID_SEQ.NEXTVAL
,(SELECT ARTIST_ID FROM ARTIST WHERE NAME='Jewel')
,'Standing Still','4:30');
INSERT INTO SONG(SONG_ID,ARTIST_ID,TITLE,PLAYING_TIME) 
VALUES(SONG_ID_SEQ.NEXTVAL
,(SELECT ARTIST_ID FROM ARTIST WHERE NAME='Jewel')
,'Jesus Loves You','3:20');
INSERT INTO SONG(SONG_ID,ARTIST_ID,TITLE,PLAYING_TIME) 
VALUES(SONG_ID_SEQ.NEXTVAL
,(SELECT ARTIST_ID FROM ARTIST WHERE NAME='Jewel')
,'Everybody Needs Someone Sometime','4:08');
INSERT INTO SONG(SONG_ID,ARTIST_ID,TITLE,PLAYING_TIME) 
VALUES(SONG_ID_SEQ.NEXTVAL
,(SELECT ARTIST_ID FROM ARTIST WHERE NAME='Jewel'),'Break Me','4:04');
INSERT INTO SONG(SONG_ID,ARTIST_ID,TITLE,PLAYING_TIME) 
VALUES(SONG_ID_SEQ.NEXTVAL
,(SELECT ARTIST_ID FROM ARTIST WHERE NAME='Jewel')
,'Do You Want To Play ?','2:55');
INSERT INTO SONG(SONG_ID,ARTIST_ID,TITLE,PLAYING_TIME) 
VALUES(SONG_ID_SEQ.NEXTVAL
,(SELECT ARTIST_ID FROM ARTIST WHERE NAME='Jewel')
,'Till We Run Out Of Road','4:45');
INSERT INTO SONG(SONG_ID,ARTIST_ID,TITLE,PLAYING_TIME) 
VALUES(SONG_ID_SEQ.NEXTVAL
,(SELECT ARTIST_ID FROM ARTIST WHERE NAME='Jewel')
,'Serve The Ego','4:57');
INSERT INTO SONG(SONG_ID,ARTIST_ID,TITLE,PLAYING_TIME) 
VALUES(SONG_ID_SEQ.NEXTVAL
,(SELECT ARTIST_ID FROM ARTIST WHERE NAME='Jewel'),'This Way','4:16');
INSERT INTO SONG(SONG_ID,ARTIST_ID,TITLE,PLAYING_TIME) 
VALUES(SONG_ID_SEQ.NEXTVAL
,(SELECT ARTIST_ID FROM ARTIST WHERE NAME='Jewel'),'Cleveland','4:09');
INSERT INTO SONG(SONG_ID,ARTIST_ID,TITLE,PLAYING_TIME) 
VALUES(SONG_ID_SEQ.NEXTVAL
,(SELECT ARTIST_ID FROM ARTIST WHERE NAME='Jewel')
,'I Won''t Walk Away','4:45');
INSERT INTO SONG(SONG_ID,ARTIST_ID,TITLE,PLAYING_TIME) 
VALUES(SONG_ID_SEQ.NEXTVAL
,(SELECT ARTIST_ID FROM ARTIST WHERE NAME='Jewel')
,'Love Me, Just Leave Me Alone','3:47');
INSERT INTO SONG(SONG_ID,ARTIST_ID,TITLE,PLAYING_TIME) 
VALUES(SONG_ID_SEQ.NEXTVAL
,(SELECT ARTIST_ID FROM ARTIST WHERE NAME='Jewel')
,'The New Wild West','4:47');
INSERT INTO SONG(SONG_ID,ARTIST_ID,TITLE,PLAYING_TIME) 
VALUES(SONG_ID_SEQ.NEXTVAL
,(SELECT ARTIST_ID FROM ARTIST WHERE NAME='Jewel')
,'Grey Matter (Live)','4:35');
INSERT INTO SONG(SONG_ID,ARTIST_ID,TITLE,PLAYING_TIME) 
VALUES(SONG_ID_SEQ.NEXTVAL
,(SELECT ARTIST_ID FROM ARTIST WHERE NAME='Jewel')
,'Sometimes It Be That Way (Live)','3:44');
COMMIT;

INSERT INTO CDTRACK(MUSICCD_ID,SONG_ID,TRACK_SEQ_NO)
VALUES ((SELECT MUSICCD_ID FROM MUSICCD WHERE TITLE='This Way')
,(SELECT SONG_ID FROM SONG WHERE TITLE='Standing Still'),1);
INSERT INTO CDTRACK(MUSICCD_ID,SONG_ID,TRACK_SEQ_NO)
VALUES ((SELECT MUSICCD_ID FROM MUSICCD WHERE TITLE='This Way')
,(SELECT SONG_ID FROM SONG WHERE TITLE='Jesus Loves You'),2);
INSERT INTO CDTRACK(MUSICCD_ID,SONG_ID,TRACK_SEQ_NO)
VALUES ((SELECT MUSICCD_ID FROM MUSICCD WHERE TITLE='This Way')
,(SELECT SONG_ID FROM SONG 
WHERE TITLE='Everybody Needs Someone Sometime'),3);
INSERT INTO CDTRACK(MUSICCD_ID,SONG_ID,TRACK_SEQ_NO)
VALUES ((SELECT MUSICCD_ID FROM MUSICCD WHERE TITLE='This Way')
,(SELECT SONG_ID FROM SONG WHERE TITLE='Break Me'),4);
INSERT INTO CDTRACK(MUSICCD_ID,SONG_ID,TRACK_SEQ_NO)
VALUES ((SELECT MUSICCD_ID FROM MUSICCD WHERE TITLE='This Way')
,(SELECT SONG_ID FROM SONG WHERE TITLE='Do You Want To Play ?'),5);
INSERT INTO CDTRACK(MUSICCD_ID,SONG_ID,TRACK_SEQ_NO)
VALUES ((SELECT MUSICCD_ID FROM MUSICCD WHERE TITLE='This Way')
,(SELECT SONG_ID FROM SONG WHERE TITLE='Till We Run Out Of Road'),6);
INSERT INTO CDTRACK(MUSICCD_ID,SONG_ID,TRACK_SEQ_NO)
VALUES ((SELECT MUSICCD_ID FROM MUSICCD WHERE TITLE='This Way')
,(SELECT SONG_ID FROM SONG WHERE TITLE='Serve The Ego'),7);
INSERT INTO CDTRACK(MUSICCD_ID,SONG_ID,TRACK_SEQ_NO)
VALUES ((SELECT MUSICCD_ID FROM MUSICCD WHERE TITLE='This Way')
,(SELECT SONG_ID FROM SONG WHERE TITLE='This Way'),8);
INSERT INTO CDTRACK(MUSICCD_ID,SONG_ID,TRACK_SEQ_NO)
VALUES ((SELECT MUSICCD_ID FROM MUSICCD WHERE TITLE='This Way')
,(SELECT SONG_ID FROM SONG WHERE TITLE='Cleveland'),9);
INSERT INTO CDTRACK(MUSICCD_ID,SONG_ID,TRACK_SEQ_NO)
VALUES ((SELECT MUSICCD_ID FROM MUSICCD WHERE TITLE='This Way')
,(SELECT SONG_ID FROM SONG WHERE TITLE='I Won''t Walk Away'),10);
INSERT INTO CDTRACK(MUSICCD_ID,SONG_ID,TRACK_SEQ_NO)
VALUES ((SELECT MUSICCD_ID FROM MUSICCD WHERE TITLE='This Way')
,(SELECT SONG_ID FROM SONG 
WHERE TITLE='Love Me, Just Leave Me Alone'),11);
INSERT INTO CDTRACK(MUSICCD_ID,SONG_ID,TRACK_SEQ_NO)
VALUES ((SELECT MUSICCD_ID FROM MUSICCD WHERE TITLE='This Way')
,(SELECT SONG_ID FROM SONG WHERE TITLE='The New Wild West'),12);
INSERT INTO CDTRACK(MUSICCD_ID,SONG_ID,TRACK_SEQ_NO)
VALUES ((SELECT MUSICCD_ID FROM MUSICCD WHERE TITLE='This Way')
,(SELECT SONG_ID FROM SONG WHERE TITLE='Grey Matter (Live)'),13);
INSERT INTO CDTRACK(MUSICCD_ID,SONG_ID,TRACK_SEQ_NO)
VALUES ((SELECT MUSICCD_ID FROM MUSICCD WHERE TITLE='This Way'),
(SELECT SONG_ID FROM SONG WHERE TITLE='Sometimes It Be That Way (Live)'),14);
COMMIT;

INSERT INTO CDTRACK(MUSICCD_ID,SONG_ID,TRACK_SEQ_NO)
VALUES ((SELECT MUSICCD_ID FROM MUSICCD 
WHERE TITLE='The Best of Sheryl Crow')
,(SELECT SONG_ID FROM SONG
WHERE TITLE='Soak Up The Sun (Album Version)'),1);
INSERT INTO CDTRACK(MUSICCD_ID,SONG_ID,TRACK_SEQ_NO)
VALUES ((SELECT MUSICCD_ID FROM MUSICCD 
WHERE TITLE='The Best of Sheryl Crow')
,(SELECT SONG_ID FROM SONG
WHERE TITLE='Soak Up The Sun (Sunsweep Dub)'),2);
INSERT INTO CDTRACK(MUSICCD_ID,SONG_ID,TRACK_SEQ_NO)
VALUES ((SELECT MUSICCD_ID FROM MUSICCD
WHERE TITLE='The Best of Sheryl Crow')
,(SELECT SONG_ID FROM SONG WHERE TITLE='It''s So Easy'),3);
INSERT INTO CDTRACK(MUSICCD_ID,SONG_ID,TRACK_SEQ_NO)
VALUES ((SELECT MUSICCD_ID FROM MUSICCD
WHERE TITLE='The Best of Sheryl Crow')
,(SELECT SONG_ID FROM SONG WHERE TITLE='Over You'),4);
INSERT INTO CDTRACK(MUSICCD_ID,SONG_ID,TRACK_SEQ_NO)
VALUES ((SELECT MUSICCD_ID FROM MUSICCD
WHERE TITLE='The Best of Sheryl Crow')
,(SELECT SONG_ID FROM SONG WHERE TITLE='Diamond Road'),5);
INSERT INTO CDTRACK(MUSICCD_ID,SONG_ID,TRACK_SEQ_NO)
VALUES ((SELECT MUSICCD_ID FROM MUSICCD 
WHERE TITLE='The Best of Sheryl Crow')
,(SELECT SONG_ID FROM SONG WHERE TITLE='Hole In My Pocket'),6);
INSERT INTO CDTRACK(MUSICCD_ID,SONG_ID,TRACK_SEQ_NO)
VALUES ((SELECT MUSICCD_ID FROM MUSICCD
WHERE TITLE='The Best of Sheryl Crow')
,(SELECT SONG_ID FROM SONG WHERE TITLE='Weather Channel'),7);
COMMIT;

INSERT INTO CDTRACK(MUSICCD_ID,SONG_ID,TRACK_SEQ_NO) VALUES ((SELECT MUSICCD_ID FROM MUSICCD WHERE TITLE='Requiem'),(SELECT SONG_ID FROM SONG WHERE TITLE='Requiem in D Minor: I. Introitus - Requiem'),1);
INSERT INTO CDTRACK(MUSICCD_ID,SONG_ID,TRACK_SEQ_NO) VALUES ((SELECT MUSICCD_ID FROM MUSICCD WHERE TITLE='Requiem'),(SELECT SONG_ID FROM SONG WHERE TITLE='Requiem in D Minor: II. Kyrie'),2);
INSERT INTO CDTRACK(MUSICCD_ID,SONG_ID,TRACK_SEQ_NO) VALUES ((SELECT MUSICCD_ID FROM MUSICCD WHERE TITLE='Requiem'),(SELECT SONG_ID FROM SONG WHERE TITLE='Requiem in D Minor: III. Sequenz - No.1 - Dies irae'),3);
INSERT INTO CDTRACK(MUSICCD_ID,SONG_ID,TRACK_SEQ_NO) VALUES ((SELECT MUSICCD_ID FROM MUSICCD WHERE TITLE='Requiem'),(SELECT SONG_ID FROM SONG WHERE TITLE='Requiem in D Minor: III. Sequenz - No. 2 - Tuba mirum'),4);
INSERT INTO CDTRACK(MUSICCD_ID,SONG_ID,TRACK_SEQ_NO) VALUES ((SELECT MUSICCD_ID FROM MUSICCD WHERE TITLE='Requiem'),(SELECT SONG_ID FROM SONG WHERE TITLE='Requiem in D Minor: III. Sequenz - No. 3 - Rex tremendae'),5);
INSERT INTO CDTRACK(MUSICCD_ID,SONG_ID,TRACK_SEQ_NO) VALUES ((SELECT MUSICCD_ID FROM MUSICCD WHERE TITLE='Requiem'),(SELECT SONG_ID FROM SONG WHERE TITLE='Requiem in D Minor: III. Sequenz - No. 4 - Recordare'),6);        
INSERT INTO CDTRACK(MUSICCD_ID,SONG_ID,TRACK_SEQ_NO) VALUES ((SELECT MUSICCD_ID FROM MUSICCD WHERE TITLE='Requiem'),(SELECT SONG_ID FROM SONG WHERE TITLE='Requiem in D Minor: III. Sequenz - No. 5 - Confutatis'),7);        
INSERT INTO CDTRACK(MUSICCD_ID,SONG_ID,TRACK_SEQ_NO) VALUES ((SELECT MUSICCD_ID FROM MUSICCD WHERE TITLE='Requiem'),(SELECT SONG_ID FROM SONG WHERE TITLE='Requiem in D Minor: III. Sequenz - No. 6 - Lacrimosa'),8);        
INSERT INTO CDTRACK(MUSICCD_ID,SONG_ID,TRACK_SEQ_NO) VALUES ((SELECT MUSICCD_ID FROM MUSICCD WHERE TITLE='Requiem'),(SELECT SONG_ID FROM SONG WHERE TITLE='Requiem in D Minor: IV. Offertorium - No. 1 - Domine Jesu'),9);        
INSERT INTO CDTRACK(MUSICCD_ID,SONG_ID,TRACK_SEQ_NO) VALUES ((SELECT MUSICCD_ID FROM MUSICCD WHERE TITLE='Requiem'),(SELECT SONG_ID FROM SONG WHERE TITLE='Requiem in D Minor: IV. Offertorium - No. 2 - Hostias'),10);        
INSERT INTO CDTRACK(MUSICCD_ID,SONG_ID,TRACK_SEQ_NO) VALUES ((SELECT MUSICCD_ID FROM MUSICCD WHERE TITLE='Requiem'),(SELECT SONG_ID FROM SONG WHERE TITLE='Requiem in D Minor: V. Sanctus'),11);        
INSERT INTO CDTRACK(MUSICCD_ID,SONG_ID,TRACK_SEQ_NO) VALUES ((SELECT MUSICCD_ID FROM MUSICCD WHERE TITLE='Requiem'),(SELECT SONG_ID FROM SONG WHERE TITLE='Requiem in D Minor: VI. Benedictus'),12);        
INSERT INTO CDTRACK(MUSICCD_ID,SONG_ID,TRACK_SEQ_NO) VALUES ((SELECT MUSICCD_ID FROM MUSICCD WHERE TITLE='Requiem'),(SELECT SONG_ID FROM SONG WHERE TITLE='Requiem in D Minor: VII. Agnus Dei'),13);        
INSERT INTO CDTRACK(MUSICCD_ID,SONG_ID,TRACK_SEQ_NO) VALUES ((SELECT MUSICCD_ID FROM MUSICCD WHERE TITLE='Requiem'),(SELECT SONG_ID FROM SONG WHERE TITLE='Requiem in D Minor: VIII. Communio - Lux aeterna'),14);  
COMMIT;

INSERT INTO CDTRACK(MUSICCD_ID,SONG_ID,TRACK_SEQ_NO) VALUES ((SELECT MUSICCD_ID FROM MUSICCD WHERE TITLE='Sweet Baby James'),(SELECT SONG_ID FROM SONG WHERE TITLE='Sweet Baby James'),1);
INSERT INTO CDTRACK(MUSICCD_ID,SONG_ID,TRACK_SEQ_NO) VALUES ((SELECT MUSICCD_ID FROM MUSICCD WHERE TITLE='Sweet Baby James'),(SELECT SONG_ID FROM SONG WHERE TITLE='Lo and Behold'),2);
INSERT INTO CDTRACK(MUSICCD_ID,SONG_ID,TRACK_SEQ_NO) VALUES ((SELECT MUSICCD_ID FROM MUSICCD WHERE TITLE='Sweet Baby James'),(SELECT SONG_ID FROM SONG WHERE TITLE='Sunny Skies'),3);
INSERT INTO CDTRACK(MUSICCD_ID,SONG_ID,TRACK_SEQ_NO) VALUES ((SELECT MUSICCD_ID FROM MUSICCD WHERE TITLE='Sweet Baby James'),(SELECT SONG_ID FROM SONG WHERE TITLE='Steamroller'),4);
INSERT INTO CDTRACK(MUSICCD_ID,SONG_ID,TRACK_SEQ_NO) VALUES ((SELECT MUSICCD_ID FROM MUSICCD WHERE TITLE='Sweet Baby James'),(SELECT SONG_ID FROM SONG WHERE TITLE='Country Road'),5);
INSERT INTO CDTRACK(MUSICCD_ID,SONG_ID,TRACK_SEQ_NO) VALUES ((SELECT MUSICCD_ID FROM MUSICCD WHERE TITLE='Sweet Baby James'),(SELECT SONG_ID FROM SONG WHERE TITLE='Oh Susanna'),6);       
INSERT INTO CDTRACK(MUSICCD_ID,SONG_ID,TRACK_SEQ_NO) VALUES ((SELECT MUSICCD_ID FROM MUSICCD WHERE TITLE='Sweet Baby James'),(SELECT SONG_ID FROM SONG WHERE TITLE='Fire and Rain'),7);        
INSERT INTO CDTRACK(MUSICCD_ID,SONG_ID,TRACK_SEQ_NO) VALUES ((SELECT MUSICCD_ID FROM MUSICCD WHERE TITLE='Sweet Baby James'),(SELECT SONG_ID FROM SONG WHERE TITLE='Blossom'),8);        
INSERT INTO CDTRACK(MUSICCD_ID,SONG_ID,TRACK_SEQ_NO) VALUES ((SELECT MUSICCD_ID FROM MUSICCD WHERE TITLE='Sweet Baby James'),(SELECT SONG_ID FROM SONG WHERE TITLE='Anywhere Like Heaven'),9);        
INSERT INTO CDTRACK(MUSICCD_ID,SONG_ID,TRACK_SEQ_NO) VALUES ((SELECT MUSICCD_ID FROM MUSICCD WHERE TITLE='Sweet Baby James'),(SELECT SONG_ID FROM SONG WHERE TITLE='Oh Baby, Don''t You Loose Your Lip on Me'),10);        
INSERT INTO CDTRACK(MUSICCD_ID,SONG_ID,TRACK_SEQ_NO) VALUES ((SELECT MUSICCD_ID FROM MUSICCD WHERE TITLE='Sweet Baby James'),(SELECT SONG_ID FROM SONG WHERE TITLE='Suite for 20 G'),11);  
COMMIT;

SPOOL OFF;

Music Schema Data Generation: GUESTARTIST.SQL

SPOOL log/GUESTARTIST.LOG;

INSERT INTO ARTIST(ARTIST_ID,NAME,INSTRUMENTS)
VALUES(ARTIST_ID_SEQ.NEXTVAL,'Angie Aparo'
,INSTRUMENTSCOLLECTION('Background Vocals'));
INSERT INTO ARTIST(ARTIST_ID,NAME,INSTRUMENTS)
VALUES(ARTIST_ID_SEQ.NEXTVAL,'Peter Stuart'
,INSTRUMENTSCOLLECTION('Background Vocals'));
INSERT INTO ARTIST(ARTIST_ID,NAME,INSTRUMENTS)
VALUES(ARTIST_ID_SEQ.NEXTVAL,'Sam Bacco'
,INSTRUMENTSCOLLECTION('Percussion'));
INSERT INTO ARTIST(ARTIST_ID,NAME,INSTRUMENTS)
VALUES(ARTIST_ID_SEQ.NEXTVAL,'Tony Adams'
,INSTRUMENTSCOLLECTION('Drums'));
INSERT INTO ARTIST(ARTIST_ID,NAME,INSTRUMENTS)
VALUES(ARTIST_ID_SEQ.NEXTVAL,'Paul Doucette'
,INSTRUMENTSCOLLECTION('Acoustic Guitar'));
COMMIT;

INSERT INTO GUESTAPPEARANCE(COMMENT_TEXT,SONG_ID,GUESTARTIST_ID) VALUES('Arrived late'
,(SELECT SONG_ID FROM SONG WHERE TITLE='Stop')
,(SELECT ARTIST_ID FROM ARTIST WHERE NAME='Angie Aparo'));
INSERT INTO GUESTAPPEARANCE(COMMENT_TEXT,SONG_ID,GUESTARTIST_ID) VALUES('Very professional when meeting with the band'
,(SELECT SONG_ID FROM SONG WHERE TITLE='The Burn')
,(SELECT ARTIST_ID FROM ARTIST WHERE NAME='Peter Stuart'));
INSERT INTO GUESTAPPEARANCE(SONG_ID,GUESTARTIST_ID)
VALUES((SELECT SONG_ID FROM SONG WHERE TITLE='Last Beautiful Girl')
,(SELECT ARTIST_ID FROM ARTIST WHERE NAME='Sam Bacco'));
INSERT INTO GUESTAPPEARANCE(SONG_ID,GUESTARTIST_ID)
VALUES((SELECT SONG_ID FROM SONG WHERE TITLE='Stop')
,(SELECT ARTIST_ID FROM ARTIST WHERE NAME='Tony Adams'));
INSERT INTO GUESTAPPEARANCE(COMMENT_TEXT, SONG_ID,GUESTARTIST_ID)  VALUES('Agreed to work on this song for free'
,(SELECT SONG_ID FROM SONG WHERE TITLE='Stop')
,(SELECT ARTIST_ID FROM ARTIST WHERE NAME='Paul Doucette'));
COMMIT;

INSERT INTO INSTRUMENTATION
(COMMENT_TEXT,SONG_ID,GUESTARTIST_ID,INSTRUMENT_ID)
VALUES('Best crooning on the CD'
,(SELECT SONG_ID FROM SONG WHERE TITLE='Stop')
,(SELECT ARTIST_ID FROM ARTIST WHERE NAME='Angie Aparo')
,(SELECT INSTRUMENT_ID FROM INSTRUMENT
WHERE NAME='Background Vocals'));
INSERT INTO INSTRUMENTATION
(SONG_ID,GUESTARTIST_ID,INSTRUMENT_ID)
VALUES((SELECT SONG_ID FROM SONG WHERE TITLE='The Burn')
,(SELECT ARTIST_ID FROM ARTIST WHERE NAME='Peter Stuart')
,(SELECT INSTRUMENT_ID FROM INSTRUMENT
WHERE NAME='Background Vocals'));
INSERT INTO INSTRUMENTATION(SONG_ID,GUESTARTIST_ID,INSTRUMENT_ID) VALUES((SELECT SONG_ID FROM SONG WHERE TITLE='Last Beautiful Girl')
,(SELECT ARTIST_ID FROM ARTIST WHERE NAME='Sam Bacco')
,(SELECT INSTRUMENT_ID FROM INSTRUMENT WHERE NAME='Percussion'));
INSERT INTO INSTRUMENTATION
(COMMENT_TEXT,SONG_ID,GUESTARTIST_ID,INSTRUMENT_ID)
VALUES('This song would not have happened without Tony'
,(SELECT SONG_ID FROM SONG WHERE TITLE='Stop')
,(SELECT ARTIST_ID FROM ARTIST WHERE NAME='Tony Adams')
,(SELECT INSTRUMENT_ID FROM INSTRUMENT WHERE NAME='Drums'));
INSERT INTO INSTRUMENTATION
(COMMENT_TEXT,SONG_ID,GUESTARTIST_ID,INSTRUMENT_ID)
VALUES('Great guitar solo'
,(SELECT SONG_ID FROM SONG WHERE TITLE='Stop')
,(SELECT ARTIST_ID FROM ARTIST WHERE NAME='Paul Doucette')
,(SELECT INSTRUMENT_ID FROM INSTRUMENT WHERE NAME='Acoustic Guitar'));
COMMIT;

SPOOL OFF;

Music Schema Data Generation: STUDIOTIME.SQL

SPOOL log/STUDIOTIME.LOG;

INSERT INTO STUDIOTIME
(STUDIOTIME_ID, ARTIST_ID, SESSION_DATE, DUE_DATE, MINUTES_USED)
VALUES (STUDIOTIME_ID_SEQ.NEXTVAL,4,'08-MAY-00','07-JUN-00',120);
INSERT INTO STUDIOTIME
(STUDIOTIME_ID, ARTIST_ID, SESSION_DATE, DUE_DATE, MINUTES_USED)
VALUES (STUDIOTIME_ID_SEQ.NEXTVAL,8,'08-MAY-00','07-JUN-00',280);
INSERT INTO STUDIOTIME
(STUDIOTIME_ID, ARTIST_ID, SESSION_DATE, DUE_DATE, MINUTES_USED)
VALUES (STUDIOTIME_ID_SEQ.NEXTVAL,1,'12-MAY-00','11-JUN-00',1200);
INSERT INTO STUDIOTIME
(STUDIOTIME_ID, ARTIST_ID, SESSION_DATE, DUE_DATE, MINUTES_USED)
VALUES (STUDIOTIME_ID_SEQ.NEXTVAL,1,'12-MAY-00','11-JUN-00',480);
INSERT INTO STUDIOTIME
(STUDIOTIME_ID, ARTIST_ID, SESSION_DATE, DUE_DATE, MINUTES_USED)
VALUES (STUDIOTIME_ID_SEQ.NEXTVAL,7,'12-MAY-00','11-JUN-00',348);
INSERT INTO STUDIOTIME
(STUDIOTIME_ID, ARTIST_ID, SESSION_DATE, DUE_DATE, MINUTES_USED)
VALUES (STUDIOTIME_ID_SEQ.NEXTVAL,7,'12-MAY-00','11-JUN-00',189);
INSERT INTO STUDIOTIME
(STUDIOTIME_ID, ARTIST_ID, SESSION_DATE, DUE_DATE, MINUTES_USED)
VALUES (STUDIOTIME_ID_SEQ.NEXTVAL,7,'13-MAY-00','12-JUN-00',548);
INSERT INTO STUDIOTIME
(STUDIOTIME_ID, ARTIST_ID, SESSION_DATE, DUE_DATE, MINUTES_USED)
VALUES (STUDIOTIME_ID_SEQ.NEXTVAL,1,'11-NOV-00','11-DEC-00',760);
INSERT INTO STUDIOTIME
(STUDIOTIME_ID, ARTIST_ID, SESSION_DATE, DUE_DATE, MINUTES_USED)
VALUES (STUDIOTIME_ID_SEQ.NEXTVAL,1,'15-DEC-00','14-JAN-01',885.5);
INSERT INTO STUDIOTIME
(STUDIOTIME_ID, ARTIST_ID, SESSION_DATE, DUE_DATE, MINUTES_USED)
VALUES (STUDIOTIME_ID_SEQ.NEXTVAL,5,'15-JAN-01','14-FEB-01',332.25);
INSERT INTO STUDIOTIME
(STUDIOTIME_ID, ARTIST_ID, SESSION_DATE, DUE_DATE, MINUTES_USED)
VALUES (STUDIOTIME_ID_SEQ.NEXTVAL,1,'19-JAN-01','18-FEB-01',110.5);
INSERT INTO STUDIOTIME
(STUDIOTIME_ID, ARTIST_ID, SESSION_DATE, DUE_DATE, MINUTES_USED)
VALUES (STUDIOTIME_ID_SEQ.NEXTVAL,5,'19-JAN-01','18-FEB-01',100);
INSERT INTO STUDIOTIME
(STUDIOTIME_ID, ARTIST_ID, SESSION_DATE, DUE_DATE, MINUTES_USED)
VALUES (STUDIOTIME_ID_SEQ.NEXTVAL,5,'20-JAN-01','19-FEB-01',230);
INSERT INTO STUDIOTIME
(STUDIOTIME_ID, ARTIST_ID, SESSION_DATE, DUE_DATE, MINUTES_USED)
VALUES (STUDIOTIME_ID_SEQ.NEXTVAL,5,'21-JAN-01','20-FEB-01',350);
INSERT INTO STUDIOTIME
(STUDIOTIME_ID, ARTIST_ID, SESSION_DATE, DUE_DATE, MINUTES_USED)
VALUES (STUDIOTIME_ID_SEQ.NEXTVAL,6,'21-JAN-01','20-FEB-01',567);
INSERT INTO STUDIOTIME
(STUDIOTIME_ID, ARTIST_ID, SESSION_DATE, DUE_DATE, MINUTES_USED)
VALUES (STUDIOTIME_ID_SEQ.NEXTVAL,6,'22-JAN-01','21-FEB-01',875);
INSERT INTO STUDIOTIME
(STUDIOTIME_ID, ARTIST_ID, SESSION_DATE, DUE_DATE, MINUTES_USED)
VALUES (STUDIOTIME_ID_SEQ.NEXTVAL,6,'22-JAN-01','21-FEB-01',125);
INSERT INTO STUDIOTIME
(STUDIOTIME_ID, ARTIST_ID, SESSION_DATE, DUE_DATE, MINUTES_USED)
VALUES (STUDIOTIME_ID_SEQ.NEXTVAL,6,'23-JAN-01','22-FEB-01',106);
INSERT INTO STUDIOTIME
(STUDIOTIME_ID, ARTIST_ID, SESSION_DATE, DUE_DATE, MINUTES_USED)
VALUES (STUDIOTIME_ID_SEQ.NEXTVAL,6,'23-JAN-01','22-FEB-01',600);
INSERT INTO STUDIOTIME
(STUDIOTIME_ID, ARTIST_ID, SESSION_DATE, DUE_DATE, MINUTES_USED)
VALUES (STUDIOTIME_ID_SEQ.NEXTVAL,6,'24-JAN-01','23-FEB-01',750.4);
INSERT INTO STUDIOTIME
(STUDIOTIME_ID, ARTIST_ID, SESSION_DATE, DUE_DATE, MINUTES_USED)
VALUES (STUDIOTIME_ID_SEQ.NEXTVAL,1,'01-FEB-01','03-MAR-01',800);
INSERT INTO STUDIOTIME
(STUDIOTIME_ID, ARTIST_ID, SESSION_DATE, DUE_DATE, MINUTES_USED)
VALUES (STUDIOTIME_ID_SEQ.NEXTVAL,1,'12-FEB-01','14-MAR-01',1000);
INSERT INTO STUDIOTIME
(STUDIOTIME_ID, ARTIST_ID, SESSION_DATE, DUE_DATE, MINUTES_USED)
VALUES (STUDIOTIME_ID_SEQ.NEXTVAL,7,'20-FEB-01','22-MAR-01',850.5);
INSERT INTO STUDIOTIME
(STUDIOTIME_ID, ARTIST_ID, SESSION_DATE, DUE_DATE, MINUTES_USED)
VALUES (STUDIOTIME_ID_SEQ.NEXTVAL,1,'11-MAR-01','10-APR-01',245);
INSERT INTO STUDIOTIME
(STUDIOTIME_ID, ARTIST_ID, SESSION_DATE, DUE_DATE, MINUTES_USED)
VALUES (STUDIOTIME_ID_SEQ.NEXTVAL,5,'11-MAR-01','10-APR-01',650);
INSERT INTO STUDIOTIME
(STUDIOTIME_ID, ARTIST_ID, SESSION_DATE, DUE_DATE, MINUTES_USED)
VALUES (STUDIOTIME_ID_SEQ.NEXTVAL,2,'11-MAR-01','10-APR-01',122);
INSERT INTO STUDIOTIME
(STUDIOTIME_ID, ARTIST_ID, SESSION_DATE, DUE_DATE, MINUTES_USED)
VALUES (STUDIOTIME_ID_SEQ.NEXTVAL,1,'13-MAR-01','12-APR-01',540);
INSERT INTO STUDIOTIME
(STUDIOTIME_ID, ARTIST_ID, SESSION_DATE, DUE_DATE, MINUTES_USED)
VALUES (STUDIOTIME_ID_SEQ.NEXTVAL,2,'13-MAR-01','12-APR-01',300);
INSERT INTO STUDIOTIME
(STUDIOTIME_ID, ARTIST_ID, SESSION_DATE, DUE_DATE, MINUTES_USED)
VALUES (STUDIOTIME_ID_SEQ.NEXTVAL,4,'17-MAR-01','16-APR-01',90);
INSERT INTO STUDIOTIME
(STUDIOTIME_ID, ARTIST_ID, SESSION_DATE, DUE_DATE, MINUTES_USED)
VALUES (STUDIOTIME_ID_SEQ.NEXTVAL,4,'17-MAR-01','16-APR-01',45.5);
INSERT INTO STUDIOTIME
(STUDIOTIME_ID, ARTIST_ID, SESSION_DATE, DUE_DATE, MINUTES_USED)
VALUES (STUDIOTIME_ID_SEQ.NEXTVAL,6,'01-MAY-01','31-MAY-01',900);
INSERT INTO STUDIOTIME
(STUDIOTIME_ID, ARTIST_ID, SESSION_DATE, DUE_DATE, MINUTES_USED)
VALUES (STUDIOTIME_ID_SEQ.NEXTVAL,2,'01-MAY-01','31-MAY-01',345);
INSERT INTO STUDIOTIME
(STUDIOTIME_ID, ARTIST_ID, SESSION_DATE, DUE_DATE, MINUTES_USED)
VALUES (STUDIOTIME_ID_SEQ.NEXTVAL,2,'04-MAY-01','03-JUN-01',450.5);
INSERT INTO STUDIOTIME
(STUDIOTIME_ID, ARTIST_ID, SESSION_DATE, DUE_DATE, MINUTES_USED)
VALUES (STUDIOTIME_ID_SEQ.NEXTVAL,2,'05-MAY-01','04-JUN-01',396);
INSERT INTO STUDIOTIME
(STUDIOTIME_ID, ARTIST_ID, SESSION_DATE, DUE_DATE, MINUTES_USED)
VALUES (STUDIOTIME_ID_SEQ.NEXTVAL,2,'06-MAY-01','05-JUN-01',200);
INSERT INTO STUDIOTIME
(STUDIOTIME_ID, ARTIST_ID, SESSION_DATE, DUE_DATE, MINUTES_USED)
VALUES (STUDIOTIME_ID_SEQ.NEXTVAL,2,'07-MAY-01','06-JUN-01',690);
INSERT INTO STUDIOTIME
(STUDIOTIME_ID, ARTIST_ID, SESSION_DATE, DUE_DATE, MINUTES_USED)
VALUES (STUDIOTIME_ID_SEQ.NEXTVAL,2,'18-MAY-01','17-JUN-01',400);
INSERT INTO STUDIOTIME
(STUDIOTIME_ID, ARTIST_ID, SESSION_DATE, DUE_DATE, MINUTES_USED)
VALUES (STUDIOTIME_ID_SEQ.NEXTVAL,5,'02-JUN-01','02-JUL-01',300);
INSERT INTO STUDIOTIME
(STUDIOTIME_ID, ARTIST_ID, SESSION_DATE, DUE_DATE, MINUTES_USED)
VALUES (STUDIOTIME_ID_SEQ.NEXTVAL,2,'11-JUN-01','11-JUL-01',441);
INSERT INTO STUDIOTIME
(STUDIOTIME_ID, ARTIST_ID, SESSION_DATE, DUE_DATE, MINUTES_USED)
VALUES (STUDIOTIME_ID_SEQ.NEXTVAL,2,'12-JUN-01','12-JUL-01',450);
INSERT INTO STUDIOTIME
(STUDIOTIME_ID, ARTIST_ID, SESSION_DATE, DUE_DATE, MINUTES_USED)
VALUES (STUDIOTIME_ID_SEQ.NEXTVAL,2,'13-JUN-01','13-JUL-01',200);
INSERT INTO STUDIOTIME
(STUDIOTIME_ID, ARTIST_ID, SESSION_DATE, DUE_DATE, MINUTES_USED)
VALUES (STUDIOTIME_ID_SEQ.NEXTVAL,2,'14-JUN-01','14-JUL-01',795.5);
INSERT INTO STUDIOTIME
(STUDIOTIME_ID, ARTIST_ID, SESSION_DATE, DUE_DATE, MINUTES_USED)
VALUES (STUDIOTIME_ID_SEQ.NEXTVAL,7,'15-JUN-01','15-JUL-01',328);
INSERT INTO STUDIOTIME
(STUDIOTIME_ID, ARTIST_ID, SESSION_DATE, DUE_DATE, MINUTES_USED)
VALUES (STUDIOTIME_ID_SEQ.NEXTVAL,7,'15-JUN-01','15-JUL-01',200);
INSERT INTO STUDIOTIME
(STUDIOTIME_ID, ARTIST_ID, SESSION_DATE, DUE_DATE, MINUTES_USED)
VALUES (STUDIOTIME_ID_SEQ.NEXTVAL,7,'16-JUN-01','16-JUL-01',440);
INSERT INTO STUDIOTIME
(STUDIOTIME_ID, ARTIST_ID, SESSION_DATE, DUE_DATE, MINUTES_USED)
VALUES (STUDIOTIME_ID_SEQ.NEXTVAL,1,'05-JUL-01','04-AUG-01',820);
INSERT INTO STUDIOTIME
(STUDIOTIME_ID, ARTIST_ID, SESSION_DATE, DUE_DATE, MINUTES_USED)
VALUES (STUDIOTIME_ID_SEQ.NEXTVAL,7,'05-JUL-01','04-AUG-01',100);
INSERT INTO STUDIOTIME
(STUDIOTIME_ID, ARTIST_ID, SESSION_DATE, DUE_DATE, MINUTES_USED)
VALUES (STUDIOTIME_ID_SEQ.NEXTVAL,1,'05-JUL-01','04-AUG-01',15);
INSERT INTO STUDIOTIME
(STUDIOTIME_ID, ARTIST_ID, SESSION_DATE, DUE_DATE, MINUTES_USED)
VALUES (STUDIOTIME_ID_SEQ.NEXTVAL,2,'09-AUG-01','08-SEP-01',1000);
INSERT INTO STUDIOTIME
(STUDIOTIME_ID, ARTIST_ID, SESSION_DATE, DUE_DATE, MINUTES_USED)
VALUES (STUDIOTIME_ID_SEQ.NEXTVAL,4,'30-AUG-01','29-SEP-01',460);
INSERT INTO STUDIOTIME
(STUDIOTIME_ID, ARTIST_ID, SESSION_DATE, DUE_DATE, MINUTES_USED)
VALUES (STUDIOTIME_ID_SEQ.NEXTVAL,4,'30-AUG-01','29-SEP-01',200);
INSERT INTO STUDIOTIME
(STUDIOTIME_ID, ARTIST_ID, SESSION_DATE, DUE_DATE, MINUTES_USED)
VALUES (STUDIOTIME_ID_SEQ.NEXTVAL,6,'30-AUG-01','29-SEP-01',30);
INSERT INTO STUDIOTIME
(STUDIOTIME_ID, ARTIST_ID, SESSION_DATE, DUE_DATE, MINUTES_USED)
VALUES (STUDIOTIME_ID_SEQ.NEXTVAL,8,'12-SEP-01','12-OCT-01',159);
INSERT INTO STUDIOTIME
(STUDIOTIME_ID, ARTIST_ID, SESSION_DATE, DUE_DATE, MINUTES_USED)
VALUES (STUDIOTIME_ID_SEQ.NEXTVAL,1,'15-SEP-01','15-OCT-01',345.45);
INSERT INTO STUDIOTIME
(STUDIOTIME_ID, ARTIST_ID, SESSION_DATE, DUE_DATE, MINUTES_USED)
VALUES (STUDIOTIME_ID_SEQ.NEXTVAL,5,'15-SEP-01','15-OCT-01',20.5);
INSERT INTO STUDIOTIME
(STUDIOTIME_ID, ARTIST_ID, SESSION_DATE, DUE_DATE, MINUTES_USED)
VALUES (STUDIOTIME_ID_SEQ.NEXTVAL,4,'25-SEP-01','25-OCT-01',340.25);
INSERT INTO STUDIOTIME
(STUDIOTIME_ID, ARTIST_ID, SESSION_DATE, DUE_DATE, MINUTES_USED)
VALUES (STUDIOTIME_ID_SEQ.NEXTVAL,5,'25-SEP-01','25-OCT-01',100.5);
INSERT INTO STUDIOTIME
(STUDIOTIME_ID, ARTIST_ID, SESSION_DATE, DUE_DATE, MINUTES_USED)
VALUES (STUDIOTIME_ID_SEQ.NEXTVAL,1,'25-SEP-01','25-OCT-01',223.25);
INSERT INTO STUDIOTIME
(STUDIOTIME_ID, ARTIST_ID, SESSION_DATE, DUE_DATE, MINUTES_USED)
VALUES (STUDIOTIME_ID_SEQ.NEXTVAL,3,'12-OCT-01','11-NOV-01',410);
INSERT INTO STUDIOTIME
(STUDIOTIME_ID, ARTIST_ID, SESSION_DATE, DUE_DATE, MINUTES_USED)
VALUES (STUDIOTIME_ID_SEQ.NEXTVAL,7,'14-OCT-01','13-NOV-01',210);
INSERT INTO STUDIOTIME
(STUDIOTIME_ID, ARTIST_ID, SESSION_DATE, DUE_DATE, MINUTES_USED)
VALUES (STUDIOTIME_ID_SEQ.NEXTVAL,7,'14-OCT-01','13-NOV-01',120.5);
INSERT INTO STUDIOTIME
(STUDIOTIME_ID, ARTIST_ID, SESSION_DATE, DUE_DATE, MINUTES_USED)
VALUES (STUDIOTIME_ID_SEQ.NEXTVAL,8,'15-OCT-01','14-NOV-01',1000);
INSERT INTO STUDIOTIME
(STUDIOTIME_ID, ARTIST_ID, SESSION_DATE, DUE_DATE, MINUTES_USED)
VALUES (STUDIOTIME_ID_SEQ.NEXTVAL,8,'16-OCT-01','15-NOV-01',100);
INSERT INTO STUDIOTIME
(STUDIOTIME_ID, ARTIST_ID, SESSION_DATE, DUE_DATE, MINUTES_USED)
VALUES (STUDIOTIME_ID_SEQ.NEXTVAL,8,'18-OCT-01','17-NOV-01',210);
INSERT INTO STUDIOTIME
(STUDIOTIME_ID, ARTIST_ID, SESSION_DATE, DUE_DATE, MINUTES_USED)
VALUES (STUDIOTIME_ID_SEQ.NEXTVAL,8,'19-OCT-01','18-NOV-01',90);
INSERT INTO STUDIOTIME
(STUDIOTIME_ID, ARTIST_ID, SESSION_DATE, DUE_DATE, MINUTES_USED)
VALUES (STUDIOTIME_ID_SEQ.NEXTVAL,8,'20-OCT-01','19-NOV-01',360);
INSERT INTO STUDIOTIME
(STUDIOTIME_ID, ARTIST_ID, SESSION_DATE, DUE_DATE, MINUTES_USED)
VALUES (STUDIOTIME_ID_SEQ.NEXTVAL,1,'21-OCT-01','20-NOV-01',250);
INSERT INTO STUDIOTIME
(STUDIOTIME_ID, ARTIST_ID, SESSION_DATE, DUE_DATE, MINUTES_USED)
VALUES (STUDIOTIME_ID_SEQ.NEXTVAL,2,'21-OCT-01','20-NOV-01',101.35);
INSERT INTO STUDIOTIME
(STUDIOTIME_ID, ARTIST_ID, SESSION_DATE, DUE_DATE, MINUTES_USED)
VALUES (STUDIOTIME_ID_SEQ.NEXTVAL,1,'21-OCT-01','20-NOV-01',90.25);
INSERT INTO STUDIOTIME
(STUDIOTIME_ID, ARTIST_ID, SESSION_DATE, DUE_DATE, MINUTES_USED)
VALUES (STUDIOTIME_ID_SEQ.NEXTVAL,8,'21-OCT-01','20-NOV-01',30);
INSERT INTO STUDIOTIME
(STUDIOTIME_ID, ARTIST_ID, SESSION_DATE, DUE_DATE, MINUTES_USED)
VALUES (STUDIOTIME_ID_SEQ.NEXTVAL,8,'22-OCT-01','21-NOV-01',458);
INSERT INTO STUDIOTIME
(STUDIOTIME_ID, ARTIST_ID, SESSION_DATE, DUE_DATE, MINUTES_USED)
VALUES (STUDIOTIME_ID_SEQ.NEXTVAL,8,'23-OCT-01','22-NOV-01',333.5);
INSERT INTO STUDIOTIME
(STUDIOTIME_ID, ARTIST_ID, SESSION_DATE, DUE_DATE, MINUTES_USED)
VALUES (STUDIOTIME_ID_SEQ.NEXTVAL,2,'17-NOV-01','17-DEC-01',249);
INSERT INTO STUDIOTIME
(STUDIOTIME_ID, ARTIST_ID, SESSION_DATE, DUE_DATE, MINUTES_USED)
VALUES (STUDIOTIME_ID_SEQ.NEXTVAL,5,'20-NOV-01','20-DEC-01',100);
INSERT INTO STUDIOTIME
(STUDIOTIME_ID, ARTIST_ID, SESSION_DATE, DUE_DATE, MINUTES_USED)
VALUES (STUDIOTIME_ID_SEQ.NEXTVAL,8,'25-NOV-01','25-DEC-01',120);
INSERT INTO STUDIOTIME
(STUDIOTIME_ID, ARTIST_ID, SESSION_DATE, DUE_DATE, MINUTES_USED)
VALUES (STUDIOTIME_ID_SEQ.NEXTVAL,1,'03-DEC-01','02-JAN-02',1200);
INSERT INTO STUDIOTIME
(STUDIOTIME_ID, ARTIST_ID, SESSION_DATE, DUE_DATE, MINUTES_USED)
VALUES (STUDIOTIME_ID_SEQ.NEXTVAL,8,'03-DEC-01','02-JAN-02',199);
INSERT INTO STUDIOTIME
(STUDIOTIME_ID, ARTIST_ID, SESSION_DATE, DUE_DATE, MINUTES_USED)
VALUES (STUDIOTIME_ID_SEQ.NEXTVAL,5,'03-DEC-01','02-JAN-02',439.26);
INSERT INTO STUDIOTIME
(STUDIOTIME_ID, ARTIST_ID, SESSION_DATE, DUE_DATE, MINUTES_USED)
VALUES (STUDIOTIME_ID_SEQ.NEXTVAL,2,'03-DEC-01','02-JAN-02',25);
INSERT INTO STUDIOTIME
(STUDIOTIME_ID, ARTIST_ID, SESSION_DATE, DUE_DATE, MINUTES_USED)
VALUES (STUDIOTIME_ID_SEQ.NEXTVAL,1,'19-DEC-01','18-JAN-02',230);
INSERT INTO STUDIOTIME
(STUDIOTIME_ID, ARTIST_ID, SESSION_DATE, DUE_DATE, MINUTES_USED)
VALUES (STUDIOTIME_ID_SEQ.NEXTVAL,7,'04-JAN-02','03-FEB-02',220);
INSERT INTO STUDIOTIME
(STUDIOTIME_ID, ARTIST_ID, SESSION_DATE, DUE_DATE, MINUTES_USED)
VALUES (STUDIOTIME_ID_SEQ.NEXTVAL,4,'11-JAN-02','10-FEB-02',450);
INSERT INTO STUDIOTIME
(STUDIOTIME_ID, ARTIST_ID, SESSION_DATE, DUE_DATE, MINUTES_USED)
VALUES (STUDIOTIME_ID_SEQ.NEXTVAL,7,'13-JAN-02','12-FEB-02',340);
INSERT INTO STUDIOTIME
(STUDIOTIME_ID, ARTIST_ID, SESSION_DATE, DUE_DATE, MINUTES_USED)
VALUES (STUDIOTIME_ID_SEQ.NEXTVAL,5,'08-JAN-02','07-FEB-02',224);
INSERT INTO STUDIOTIME
(STUDIOTIME_ID, ARTIST_ID, SESSION_DATE, DUE_DATE, MINUTES_USED)
VALUES (STUDIOTIME_ID_SEQ.NEXTVAL,8,'09-JAN-02','08-FEB-02',553);
INSERT INTO STUDIOTIME
(STUDIOTIME_ID, ARTIST_ID, SESSION_DATE, DUE_DATE, MINUTES_USED)
VALUES (STUDIOTIME_ID_SEQ.NEXTVAL,7,'29-DEC-01','29-JAN-02',100);
COMMIT;

SPOOL OFF;

Music Schema Data Generation: UPDATEDATA.SQL

SPOOL log/UPDATES.LOG

PROMPT ARTIST

UPDATE MUSIC.ARTIST 
    SET STREET = '122 North Wells' , CITY = 'Corvalis' , 
    STATE_PROVINCE = 'OR' , COUNTRY = 'USA' , ZIP = '99887'
    , EMAIL = 'ccc@sheryl.net' 
    WHERE NAME='Sheryl Crow';
UPDATE MUSIC.ARTIST 
    SET STREET = '102341 High Road' , POBOX = 'PO Box 195' , 
    CITY = 'West Palm Beach' , STATE_PROVINCE = 'FL' , 
    COUNTRY = 'USA' , ZIP = '21987' , EMAIL = 
    'gogo@whoknew.org' 
    WHERE NAME= 'Barry Manilow';
UPDATE MUSIC.ARTIST 
   SET STREET = '5A North Queens Ave' , CITY = 'London' , 
   COUNTRY = 'England' , ZIP = '1A4-5RA' , EMAIL = 'wendsday@thursday.com' 
   WHERE NAME= 'Avril Lavigne';
UPDATE MUSIC.ARTIST SET STREET = '400 West Hollywood Blvd' , 
   CITY = 'Hollywood' , STATE_PROVINCE = 'CA' , COUNTRY = 'USA' , 
   ZIP = '87654' , EMAIL = 'googoo@googoo.net' 
  WHERE NAME= 'Goo Goo Dolls';
UPDATE MUSIC.ARTIST SET STREET = '3498 S. Barnes Rd.' ,
   POBOX = 'PO Box 982356' , CITY = 'Treeville' , STATE_PROVINCE = 'NH' , 
  COUNTRY = 'USA' , ZIP = '10098-4998' , EMAIL = 'pompom@mmm.org' 
  WHERE NAME= 'Puddle of Mudd';
UPDATE MUSIC.ARTIST SET STREET = 'PO Box 332244', POBOX = 'PO Box 332244' , CITY = 'South Emery' , 
   STATE_PROVINCE = 'Quebec' , COUNTRY = 'CAN' , ZIP = '4DQ-A3E' , 
   EMAIL = 'buddy@pals.pal'   
   WHERE NAME= 'Nickelback';
UPDATE MUSIC.ARTIST SET STREET = '4398 SE 415th Ave' , POBOX = 'Suite 134' ,
    CITY = 'Portland' , STATE_PROVINCE = 'OR' , COUNTRY = 'USA' , 
    ZIP = '98765-0134' , EMAIL = 'm20@matchesboxes.org' 
    WHERE NAME= 'Matchbox Twenty';
UPDATE MUSIC.ARTIST SET STREET = '10049 Sunset Blvd' , CITY = 'Los Angeles' ,
   STATE_PROVINCE = 'CA' , COUNTRY = 'USA' , ZIP = '60292' ,
   EMAIL = 'jjjewel@jewel.hk' 
   WHERE NAME= 'Jewel';
UPDATE MUSIC.ARTIST SET STREET = '539 Smithsonian Rd' , POBOX = 'Apt 400' ,
   CITY = 'New York' , STATE_PROVINCE = 'NY' , COUNTRY = 'USA' , 
   ZIP = '10022' , EMAIL = 'Angie@parao.tk' 
   WHERE NAME= 'Angie Aparo';
UPDATE MUSIC.ARTIST SET STREET = '100 North Wells Place' , 
   POBOX = 'PO Box 100' , CITY = 'Dallas' , STATE_PROVINCE = 'TX' , 
   COUNTRY = 'USA' , ZIP = '43455' , EMAIL = 'pstuart@dallas.mr' 
   WHERE NAME= 'Peter Stuart';
UPDATE MUSIC.ARTIST SET STREET = '98-B Hillside Lane' , CITY = 'Charlotte' , 
   STATE_PROVINCE = 'NC' , COUNTRY = 'USA' , ZIP = '54098' , 
   EMAIL = 'sambacco@shatsup.org' 
   WHERE NAME= 'Sam Bacco';
UPDATE MUSIC.ARTIST 
    SET STREET = '159 Browning Drive' , CITY = 'Madison' , 
    STATE_PROVINCE = 'WI' , COUNTRY = 'USA' , ZIP = '53998' ,
    EMAIL = 'tony@adamshouse.com' 
    WHERE NAME= 'Tony Adams';
UPDATE MUSIC.ARTIST SET STREET = '544 156th Ave' , CITY = 'Seattle' ,
    STATE_PROVINCE = 'WA' , COUNTRY = 'USA' , ZIP = '96777' , 
    EMAIL = 'pdoucette@pdoucette.com' 
    WHERE NAME= 'Paul Doucette';
UPDATE MUSIC.ARTIST SET STREET = 'The JT Fan Club' , CITY = 'Boston' ,
    STATE_PROVINCE = 'MA' , COUNTRY = 'USA' , ZIP = '' , 
    EMAIL = 'info@jamestaylor.com' 
    WHERE NAME= 'James Taylor';
UPDATE MUSIC.ARTIST SET STREET = 'Wien Strasse' , CITY = 'Vienna' ,
    STATE_PROVINCE = '' , COUNTRY = 'Austria' , ZIP = '' , 
    EMAIL = 'info@friendsofmozart.com' 
    WHERE NAME= 'Mozart';
COMMIT;

PROMPT STUDIOTIME

UPDATE STUDIOTIME
SET AMOUNT_CHARGED = MINUTES_USED*1.5,
    AMOUNT_PAID = MINUTES_USED*1.5*TO_NUMBER(SUBSTR(MINUTES_USED,1,1))*.1;
COMMIT;

PROMPT SONG
PROMPT UPDATE SONG
UPDATE MUSIC.SONG SET RECORDING_DATE='19-JAN-01' WHERE TITLE='Abilene';
UPDATE MUSIC.SONG SET RECORDING_DATE='20-FEB-01' WHERE TITLE='Angry';
UPDATE MUSIC.SONG SET RECORDING_DATE='11-MAR-01'
WHERE TITLE='Bandstand Boogie';
UPDATE MUSIC.SONG SET RECORDING_DATE='15-JAN-01' WHERE TITLE='Basement';
UPDATE MUSIC.SONG SET RECORDING_DATE='12-MAY-00' WHERE TITLE='Bed Of Lies';
UPDATE MUSIC.SONG SET RECORDING_DATE='04-JAN-02' WHERE TITLE='Bent';
UPDATE MUSIC.SONG SET RECORDING_DATE='05-JUL-01'
WHERE TITLE='Black and White People';
UPDATE MUSIC.SONG SET RECORDING_DATE='11-MAR-01' WHERE TITLE='Blurry';
UPDATE MUSIC.SONG SET RECORDING_DATE='25-NOV-01' WHERE TITLE='Break Me';
UPDATE MUSIC.SONG SET RECORDING_DATE='20-NOV-01' WHERE TITLE='Bring Me Down';
UPDATE MUSIC.SONG SET RECORDING_DATE='11-JAN-02' WHERE TITLE='Burnin Up';
UPDATE MUSIC.SONG SET RECORDING_DATE='19-DEC-01'
WHERE TITLE='C''mon, C''mon';
UPDATE MUSIC.SONG SET RECORDING_DATE='21-OCT-01'
WHERE TITLE='Can''t Smile Without You';
UPDATE MUSIC.SONG SET RECORDING_DATE='15-OCT-01' WHERE TITLE='Cleveland';
UPDATE MUSIC.SONG SET RECORDING_DATE='12-OCT-01' WHERE TITLE='Complicated';
UPDATE MUSIC.SONG SET RECORDING_DATE='02-JUN-01' WHERE TITLE='Control';
UPDATE MUSIC.SONG SET RECORDING_DATE='17-NOV-01'
WHERE TITLE='Copacabana (At The Copa)';
UPDATE MUSIC.SONG SET RECORDING_DATE='13-MAR-01'
WHERE TITLE='Could It Be Magic';
UPDATE MUSIC.SONG SET RECORDING_DATE='13-JAN-02' WHERE TITLE='Crutch';
UPDATE MUSIC.SONG SET RECORDING_DATE='03-DEC-01' WHERE TITLE='Daybreak';
UPDATE MUSIC.SONG SET RECORDING_DATE='15-SEP-01' WHERE TITLE='Diamond Road';
UPDATE MUSIC.SONG SET RECORDING_DATE='03-DEC-01'
WHERE TITLE='Do You Want To Play ?';
UPDATE MUSIC.SONG SET RECORDING_DATE='25-SEP-01' WHERE TITLE='Drift and Die';
UPDATE MUSIC.SONG SET RECORDING_DATE='09-AUG-01' WHERE TITLE='Even Now';
UPDATE MUSIC.SONG SET RECORDING_DATE='08-MAY-00'
WHERE TITLE='Everybody Needs Someone Sometime';
UPDATE MUSIC.SONG SET RECORDING_DATE='17-MAR-01'
WHERE TITLE='Girl Right Next To Me';
UPDATE MUSIC.SONG SET RECORDING_DATE='30-AUG-01'
WHERE TITLE='Good Times Gone';
UPDATE MUSIC.SONG SET RECORDING_DATE='12-SEP-01'
WHERE TITLE='Grey Matter (Live)';
UPDATE MUSIC.SONG SET RECORDING_DATE='01-MAY-01' WHERE TITLE='Hangnail';
UPDATE MUSIC.SONG SET RECORDING_DATE='08-MAY-00' WHERE TITLE='Here Is Gone';
UPDATE MUSIC.SONG SET RECORDING_DATE='30-AUG-01'
WHERE TITLE='Here Is Gone Reprise';
UPDATE MUSIC.SONG SET RECORDING_DATE='13-MAR-01'
WHERE TITLE='Hole In My Pocket';
UPDATE MUSIC.SONG SET RECORDING_DATE='24-JAN-01' WHERE TITLE='Hollywood';
UPDATE MUSIC.SONG SET RECORDING_DATE='22-JAN-01'
WHERE TITLE='How You Remind Me';
UPDATE MUSIC.SONG SET RECORDING_DATE='12-JUN-01'
WHERE TITLE='I Made It Through The Rain';
UPDATE MUSIC.SONG SET RECORDING_DATE='21-OCT-01'
WHERE TITLE='I Won''t Walk Away';
UPDATE MUSIC.SONG SET RECORDING_DATE='06-MAY-01'
WHERE TITLE='I Write The Songs';
UPDATE MUSIC.SONG SET RECORDING_DATE='15-JUN-01'
WHERE TITLE='If You''re Gone';
UPDATE MUSIC.SONG SET RECORDING_DATE='21-JAN-01' WHERE TITLE='It All Away';
UPDATE MUSIC.SONG SET RECORDING_DATE='05-MAY-01'
WHERE TITLE='It''s A Miracle';
UPDATE MUSIC.SONG SET RECORDING_DATE='21-OCT-01'
WHERE TITLE='It''s Only Love';
UPDATE MUSIC.SONG SET RECORDING_DATE='05-JUL-01' WHERE TITLE='It''s So Easy';
UPDATE MUSIC.SONG SET RECORDING_DATE='16-OCT-01'
WHERE TITLE='Jesus Loves You';
UPDATE MUSIC.SONG SET RECORDING_DATE='23-JAN-01' WHERE TITLE='Just For';
UPDATE MUSIC.SONG SET RECORDING_DATE='15-JUN-01'
WHERE TITLE='Last Beautiful Girl';
UPDATE MUSIC.SONG SET RECORDING_DATE='13-MAY-00' WHERE TITLE='Leave';
UPDATE MUSIC.SONG SET RECORDING_DATE='18-MAY-01'
WHERE TITLE='Looks Like We Made It';
UPDATE MUSIC.SONG SET RECORDING_DATE='22-OCT-01'
WHERE TITLE='Love Me, Just Leave Me Alone';
UPDATE MUSIC.SONG SET RECORDING_DATE='21-OCT-01' WHERE TITLE='Lucky Kid';
UPDATE MUSIC.SONG SET RECORDING_DATE='16-JUN-01' WHERE TITLE='Mad Season';
UPDATE MUSIC.SONG SET RECORDING_DATE='04-MAY-01' WHERE TITLE='Mandy';
UPDATE MUSIC.SONG SET RECORDING_DATE='01-MAY-01' WHERE TITLE='Money Bought';
UPDATE MUSIC.SONG SET RECORDING_DATE='21-JAN-01' WHERE TITLE='Never Again';
UPDATE MUSIC.SONG SET RECORDING_DATE='19-JAN-01' WHERE TITLE='Never Change';
UPDATE MUSIC.SONG SET RECORDING_DATE='03-DEC-01'
WHERE TITLE='Out Of My Head';
UPDATE MUSIC.SONG SET RECORDING_DATE='11-MAR-01' WHERE TITLE='Over You';
UPDATE MUSIC.SONG SET RECORDING_DATE='11-JUN-01'
WHERE TITLE='Ready To Take A Chance';
UPDATE MUSIC.SONG SET RECORDING_DATE='05-JUL-01'
WHERE TITLE='Safe And Sound';
UPDATE MUSIC.SONG SET RECORDING_DATE='20-JAN-01' WHERE TITLE='Said';
UPDATE MUSIC.SONG SET RECORDING_DATE='19-OCT-01' WHERE TITLE='Serve The Ego';
UPDATE MUSIC.SONG SET RECORDING_DATE='15-SEP-01' WHERE TITLE='She Hates Me';
UPDATE MUSIC.SONG SET RECORDING_DATE='11-JUN-01' WHERE TITLE='Ships';
UPDATE MUSIC.SONG SET RECORDING_DATE='12-MAY-00'
WHERE TITLE='Soak Up The Sun';
UPDATE MUSIC.SONG SET RECORDING_DATE='11-NOV-00'
WHERE TITLE='Soak Up The Sun (Album Version)';
UPDATE MUSIC.SONG SET RECORDING_DATE='01-FEB-01'
WHERE TITLE='Soak Up The Sun (Sunsweep Club Mix)';
UPDATE MUSIC.SONG SET RECORDING_DATE='12-FEB-01'
WHERE TITLE='Soak Up The Sun (Sunsweep Dub)';
UPDATE MUSIC.SONG SET RECORDING_DATE='15-DEC-00'
WHERE TITLE='Soak Up The Sun (Sunsweep Radio Mix)';
UPDATE MUSIC.SONG SET RECORDING_DATE='14-JUN-01'
WHERE TITLE='Somewhere Down The Road';
UPDATE MUSIC.SONG SET RECORDING_DATE='01-MAY-01'
WHERE TITLE='Somewhere In The Night';
UPDATE MUSIC.SONG SET RECORDING_DATE='15-OCT-01'
WHERE TITLE='Standing Still';
UPDATE MUSIC.SONG SET RECORDING_DATE='25-SEP-01' WHERE TITLE='Steve McQueen';
UPDATE MUSIC.SONG SET RECORDING_DATE='14-OCT-01' WHERE TITLE='Stop';
UPDATE MUSIC.SONG SET RECORDING_DATE='12-MAY-00' WHERE TITLE='The Burn';
UPDATE MUSIC.SONG SET RECORDING_DATE='23-OCT-01'
WHERE TITLE='The New Wild West';
UPDATE MUSIC.SONG SET RECORDING_DATE='11-JUN-01' WHERE TITLE='The Old Songs';
UPDATE MUSIC.SONG SET RECORDING_DATE='07-MAY-01'
WHERE TITLE='This One''s For You';
UPDATE MUSIC.SONG SET RECORDING_DATE='20-OCT-01' WHERE TITLE='This Way';
UPDATE MUSIC.SONG SET RECORDING_DATE='18-OCT-01'
WHERE TITLE='Till We Run Out Of Road';
UPDATE MUSIC.SONG SET RECORDING_DATE='23-JAN-01' WHERE TITLE='Too Bad';
UPDATE MUSIC.SONG SET RECORDING_DATE='07-MAY-01'
WHERE TITLE='Tryin'' To Get The Feeling Again';
UPDATE MUSIC.SONG SET RECORDING_DATE='25-SEP-01'
WHERE TITLE='Two Days In February';
UPDATE MUSIC.SONG SET RECORDING_DATE='30-AUG-01' WHERE TITLE='Video';
UPDATE MUSIC.SONG SET RECORDING_DATE='17-MAR-01'
WHERE TITLE='We Are The Normal';
UPDATE MUSIC.SONG SET RECORDING_DATE='03-DEC-01'
WHERE TITLE='Weather Channel';
UPDATE MUSIC.SONG SET RECORDING_DATE='01-MAY-01'
WHERE TITLE='Weekend In New England';
UPDATE MUSIC.SONG SET RECORDING_DATE='13-JUN-01'
WHERE TITLE='When October Goes';
UPDATE MUSIC.SONG SET RECORDING_DATE='01-MAY-01'
WHERE TITLE='Where Do I Hide';
UPDATE MUSIC.SONG SET RECORDING_DATE='22-JAN-01'
WHERE TITLE='Woke Up This Morning';
UPDATE MUSIC.SONG SET RECORDING_DATE='14-OCT-01'
WHERE TITLE='You Won''t Be Mine';
UPDATE MUSIC.SONG SET RECORDING_DATE='12-MAY-00'
WHERE TITLE='You''re An Original';
COMMIT;

SPOOL OFF;

Music Schema Data Generation: DIMENSIONS.SQL

SPOOL log/DIMENSIONS.LOG;

--continent

INSERT INTO CONTINENT(CONTINENT_ID,NAME) VALUES(CONTINENT_ID_SEQ.NEXTVAL,'North America');
INSERT INTO CONTINENT(CONTINENT_ID,NAME) VALUES(CONTINENT_ID_SEQ.NEXTVAL,'Europe');
INSERT INTO CONTINENT(CONTINENT_ID,NAME) VALUES(CONTINENT_ID_SEQ.NEXTVAL,'Central America');
INSERT INTO CONTINENT(CONTINENT_ID,NAME) VALUES(CONTINENT_ID_SEQ.NEXTVAL,'South America');
INSERT INTO CONTINENT(CONTINENT_ID,NAME) VALUES(CONTINENT_ID_SEQ.NEXTVAL,'Oceania');
INSERT INTO CONTINENT(CONTINENT_ID,NAME) VALUES(CONTINENT_ID_SEQ.NEXTVAL,'Africa');
INSERT INTO CONTINENT(CONTINENT_ID,NAME) VALUES(CONTINENT_ID_SEQ.NEXTVAL,'Asia');
INSERT INTO CONTINENT(CONTINENT_ID,NAME) VALUES(CONTINENT_ID_SEQ.NEXTVAL,'Australasia');
COMMIT;

--country

INSERT INTO COUNTRY(COUNTRY_ID,CONTINENT_ID,NAME) VALUES(COUNTRY_ID_SEQ.NEXTVAL,(SELECT CONTINENT_ID FROM CONTINENT WHERE NAME='North America'),'United States');
INSERT INTO COUNTRY(COUNTRY_ID,CONTINENT_ID,NAME) VALUES(COUNTRY_ID_SEQ.NEXTVAL,(SELECT CONTINENT_ID FROM CONTINENT WHERE NAME='North America'),'Canada');
INSERT INTO COUNTRY(COUNTRY_ID,CONTINENT_ID,NAME) VALUES(COUNTRY_ID_SEQ.NEXTVAL,(SELECT CONTINENT_ID FROM CONTINENT WHERE NAME='North America'),'Mexico');

INSERT INTO COUNTRY(COUNTRY_ID,CONTINENT_ID,NAME) VALUES(COUNTRY_ID_SEQ.NEXTVAL,(SELECT CONTINENT_ID FROM CONTINENT WHERE NAME='Europe'),'United Kingdom');
INSERT INTO COUNTRY(COUNTRY_ID,CONTINENT_ID,NAME) VALUES(COUNTRY_ID_SEQ.NEXTVAL,(SELECT CONTINENT_ID FROM CONTINENT WHERE NAME='Europe'),'France');
INSERT INTO COUNTRY(COUNTRY_ID,CONTINENT_ID,NAME) VALUES(COUNTRY_ID_SEQ.NEXTVAL,(SELECT CONTINENT_ID FROM CONTINENT WHERE NAME='Europe'),'Czech Republic');
INSERT INTO COUNTRY(COUNTRY_ID,CONTINENT_ID,NAME) VALUES(COUNTRY_ID_SEQ.NEXTVAL,(SELECT CONTINENT_ID FROM CONTINENT WHERE NAME='Europe'),'Germany');
INSERT INTO COUNTRY(COUNTRY_ID,CONTINENT_ID,NAME) VALUES(COUNTRY_ID_SEQ.NEXTVAL,(SELECT CONTINENT_ID FROM CONTINENT WHERE NAME='Europe'),'Netherlands');
INSERT INTO COUNTRY(COUNTRY_ID,CONTINENT_ID,NAME) VALUES(COUNTRY_ID_SEQ.NEXTVAL,(SELECT CONTINENT_ID FROM CONTINENT WHERE NAME='Europe'),'Spain');
INSERT INTO COUNTRY(COUNTRY_ID,CONTINENT_ID,NAME) VALUES(COUNTRY_ID_SEQ.NEXTVAL,(SELECT CONTINENT_ID FROM CONTINENT WHERE NAME='Europe'),'Sweden');

INSERT INTO COUNTRY(COUNTRY_ID,CONTINENT_ID,NAME) VALUES(COUNTRY_ID_SEQ.NEXTVAL,(SELECT CONTINENT_ID FROM CONTINENT WHERE NAME='South America'),'Argentina');
INSERT INTO COUNTRY(COUNTRY_ID,CONTINENT_ID,NAME) VALUES(COUNTRY_ID_SEQ.NEXTVAL,(SELECT CONTINENT_ID FROM CONTINENT WHERE NAME='South America'),'Brazil');
INSERT INTO COUNTRY(COUNTRY_ID,CONTINENT_ID,NAME) VALUES(COUNTRY_ID_SEQ.NEXTVAL,(SELECT CONTINENT_ID FROM CONTINENT WHERE NAME='South America'),'Chile');
INSERT INTO COUNTRY(COUNTRY_ID,CONTINENT_ID,NAME) VALUES(COUNTRY_ID_SEQ.NEXTVAL,(SELECT CONTINENT_ID FROM CONTINENT WHERE NAME='South America'),'Colombia');
INSERT INTO COUNTRY(COUNTRY_ID,CONTINENT_ID,NAME) VALUES(COUNTRY_ID_SEQ.NEXTVAL,(SELECT CONTINENT_ID FROM CONTINENT WHERE NAME='South America'),'Peru');
INSERT INTO COUNTRY(COUNTRY_ID,CONTINENT_ID,NAME) VALUES(COUNTRY_ID_SEQ.NEXTVAL,(SELECT CONTINENT_ID FROM CONTINENT WHERE NAME='South America'),'Venezuela');

INSERT INTO COUNTRY(COUNTRY_ID,CONTINENT_ID,NAME) VALUES(COUNTRY_ID_SEQ.NEXTVAL,(SELECT CONTINENT_ID FROM CONTINENT WHERE NAME='Asia'),'Singapore');
INSERT INTO COUNTRY(COUNTRY_ID,CONTINENT_ID,NAME) VALUES(COUNTRY_ID_SEQ.NEXTVAL,(SELECT CONTINENT_ID FROM CONTINENT WHERE NAME='Asia'),'South Korea');
INSERT INTO COUNTRY(COUNTRY_ID,CONTINENT_ID,NAME) VALUES(COUNTRY_ID_SEQ.NEXTVAL,(SELECT CONTINENT_ID FROM CONTINENT WHERE NAME='Asia'),'Taiwan');
INSERT INTO COUNTRY(COUNTRY_ID,CONTINENT_ID,NAME) VALUES(COUNTRY_ID_SEQ.NEXTVAL,(SELECT CONTINENT_ID FROM CONTINENT WHERE NAME='Asia'),'Israel');
INSERT INTO COUNTRY(COUNTRY_ID,CONTINENT_ID,NAME) VALUES(COUNTRY_ID_SEQ.NEXTVAL,(SELECT CONTINENT_ID FROM CONTINENT WHERE NAME='Asia'),'Kuwait');
INSERT INTO COUNTRY(COUNTRY_ID,CONTINENT_ID,NAME) VALUES(COUNTRY_ID_SEQ.NEXTVAL,(SELECT CONTINENT_ID FROM CONTINENT WHERE NAME='Asia'),'Qatar');
INSERT INTO COUNTRY(COUNTRY_ID,CONTINENT_ID,NAME) VALUES(COUNTRY_ID_SEQ.NEXTVAL,(SELECT CONTINENT_ID FROM CONTINENT WHERE NAME='Asia'),'United Arab Emirates');
INSERT INTO COUNTRY(COUNTRY_ID,CONTINENT_ID,NAME) VALUES(COUNTRY_ID_SEQ.NEXTVAL,(SELECT CONTINENT_ID FROM CONTINENT WHERE NAME='Asia'),'India');

INSERT INTO COUNTRY(COUNTRY_ID,CONTINENT_ID,NAME) VALUES(COUNTRY_ID_SEQ.NEXTVAL,(SELECT CONTINENT_ID FROM CONTINENT WHERE NAME='Australasia'),'Australia');
INSERT INTO COUNTRY(COUNTRY_ID,CONTINENT_ID,NAME) VALUES(COUNTRY_ID_SEQ.NEXTVAL,(SELECT CONTINENT_ID FROM CONTINENT WHERE NAME='Australasia'),'New Zealand');

COMMIT;

--retailer

INSERT INTO RETAILER(RETAILER_ID,NAME,DISCOUNT,URL) VALUES(RETAILER_ID_SEQ.NEXTVAL,'Amazon',0.2,'http://www.amazon.com');
INSERT INTO RETAILER(RETAILER_ID,NAME,DISCOUNT,URL) VALUES(RETAILER_ID_SEQ.NEXTVAL,'Barnes and Noble',0.05,'http://www.barnesandnoble.com');
INSERT INTO RETAILER(RETAILER_ID,NAME,DISCOUNT,URL) VALUES(RETAILER_ID_SEQ.NEXTVAL,'CD Shop',0,NULL);

COMMIT;

SPOOL OFF;

Music Schema Data Generation: FACTS.SQL

--
--select year,country,sum(sales) from salessum group by country,year;
--select TO_DATE('01-01-2003','DD-MM-YYYY') + ROUND(((to_number(to_char(SYSTIMESTAMP,'FF3'))+1)/1000)*700) AS DTE from dual;
--select country,year,sum(sales) from salessum group by country,year;
--

SPOOL log/FACTS.LOG;

create or replace procedure delay(limit IN integer) as 
	i integer;
begin
	for i in 1..limit loop
		null;
	end loop;
end;
/

create or replace function rand(n IN NUMBER DEFAULT 1) return integer is
        f float default 0;
	rand integer default 0;
begin
        --gives a random number between 1 and 1000000000
        select to_number(to_char(SYSTIMESTAMP,'FF9'))+1 into f from dual;
        f := (f*n)/1000000000;
	rand := ROUND(f,0);
        if rand = 0 then rand := 1; end if;
	if rand > n then rand := n; end if;
        return ROUND(rand,0);
exception when others then
        dbms_output.put_line('FUNC: rand '||SQLERRM(SQLCODE));
end;
/

@@lastname.sql;
@@firstname.sql;

create or replace function getRetailer return integer is
	i integer;
begin
	select max(retailer_id) into i from retailer;
	return (rand(i));
exception when others then
        dbms_output.put_line('FUNC: getRetailer '||SQLERRM(SQLCODE));
end;
/

create or replace function getMusicCDID return integer is
	 i integer;
begin
	select max(musiccd_id) into i from musiccd;
	return (rand(i));
exception when others then
        dbms_output.put_line('FUNC: getMusicCDID '||SQLERRM(SQLCODE));
end;
/

create or replace function getGenreID (i IN integer) return integer is
	 j integer;
begin
	select genre_id into j from musiccd where MUSICCD_ID = i;
	return (j);
exception when others then
        dbms_output.put_line('FUNC: getGenreID '||SQLERRM(SQLCODE));
end;
/

create or replace function getListPrice (i IN integer) return float is
	 f float;
begin
	select list_price into f from musiccd where MUSICCD_ID = i;
	return (f);
exception when others then
        dbms_output.put_line('FUNC: getListPrice '||SQLERRM(SQLCODE));
end;
/

create or replace function getGenre (i IN integer) return varchar is
	v varchar2(32);
begin
	select genre into v from genre where GENRE_ID = i;
	return (v);
exception when others then
        dbms_output.put_line('FUNC: getGenre '||SQLERRM(SQLCODE));
end;
/

create or replace function getCountryID return integer is
	 i integer;
begin
	select max(country_id) into i from country;
	return (rand(i));
exception when others then
        dbms_output.put_line('FUNC: getCountryID '||SQLERRM(SQLCODE));
end;
/

create or replace function getContinentID (i IN integer) return integer is
	j integer;
begin
	select continent_id into j from country where COUNTRY_ID = i;
	return (j);
exception when others then
        dbms_output.put_line('FUNC: getContinentID '||SQLERRM(SQLCODE));
end;
/

create or replace function getCustomerName return varchar2 is
	i integer;
	fname varchar2(32);
	lname varchar2(32);
begin
	select count(*) into i from firstname;
	select name into fname from firstname where ID = rand(i);
	select count(*) into i from lastname;
	select name into lname from lastname where ID = rand(i);
	return (fname||' '||lname);
exception when others then
        dbms_output.put_line('FUNC: getCustomerName '||SQLERRM(SQLCODE));
end;
/

create or replace function getDiscount (i IN integer) return float is
	f float;
begin
	select discount into f from retailer where RETAILER_ID = i;
	return (f);
exception when others then
        dbms_output.put_line('FUNC: getDiscount '||SQLERRM(SQLCODE));
end;
/

--customer
create or replace procedure factsGenerate as
	id integer;
	vmusiccd_id integer default 0;
	vgenre_id number;
	vlist_price float;
	vcustomer_id integer;
	vretailer_id integer;
	vcontinent_id integer;
	vcountry_id integer;
	vdiscount float;
	vgenre varchar2(32);
	vfullname varchar2(64);
	vPreferences PreferencesCollection;
	i integer;
	j integer default 0;
	dte date;
begin

	vmusiccd_id := getMusicCDID();
	vgenre_id := getGenreID(vmusiccd_id);
	vlist_price := getListPrice(vmusiccd_id);
	vgenre := getGenre(vgenre_id);
	vretailer_id := getRetailer();
	vcountry_id := getCountryID;

	vcontinent_id := getContinentID(vcountry_id);
	vdiscount := getDiscount(vretailer_id);
	vfullname := getCustomerName(); 

	begin
		select customer_id into id from customer where NAME = vfullname;
		select preferences into vPreferences from customer where CUSTOMER_ID = id;
		j := 0; for i in vPreferences.first..vPreferences.last loop
			if vPreferences(i) = vgenre then j := 1; end if;
		end loop;
		if j = 0 then
			insert into table(select preferences from customer where CUSTOMER_ID = id) values(vgenre);
		end if;
	exception when NO_DATA_FOUND then
		insert into customer(customer_id,name,preferences)
		values(customer_id_seq.nextval,vfullname,PREFERENCESCOLLECTION(vgenre))
		returning customer_id into id;
	end;

	vcustomer_id := id;

	--dte := TO_DATE('31-12-2004','DD-MM-YYYY') - rand(500);
	--dbms_output.put_line(to_char(vcountry_id));
	dte := (SYSDATE + 300) - rand(500);
	dbms_output.put_line(to_char(vcountry_id)||','||dte);

	insert into sales
	(
		 sales_id
		,musiccd_id
		,customer_id
		,retailer_id
		,continent_id
		,country_id
		,list_price
		,discount
		,sale_price
		,sale_date
		,sale_qty
		,shipping_cost
	)
	values
	(
		 sales_id_seq.nextval
		,vmusiccd_id
		,vcustomer_id
		,vretailer_id
		,vcontinent_id
		,vcountry_id
		,vlist_price
		,vdiscount
		,ROUND(vlist_price * (1 - vdiscount),2)
		,dte
		,1
		,0	
	);
	commit;

exception when others then
        dbms_output.put_line('PROC: factGenerate '||SQLERRM(SQLCODE));
	rollback;
end;
/

create or replace procedure facts (i IN integer) is
	j integer;
begin
	for j in 1..i loop
		factsGenerate;
		delay(10000000);
		--dbms_output.put_line('Facts: '||to_char(j));
	end loop;
end;
/

set serveroutput on;
exec dbms_output.enable(10000000);
set timing on;
truncate table sales;
exec facts(1000);
exec dbms_output.disable;
set serveroutput off;

declare
	cursor cSales is select * from sales order by sale_qty;
begin
	for rSales in cSales loop
		update sales set sale_date = (SYSDATE + 300) - rand(500);
		commit;
	end loop;
end;
/

SPOOL OFF;

Music Schema Data Generation: FACTS.SQL subset script (firstname.sql)

drop table firstname;
create table firstname(id integer,name varchar2(32));
drop sequence fseq;
CREATE SEQUENCE fSEQ START WITH 1 INCREMENT BY 1 NOMAXVALUE NOCYCLE;

insert into firstname values(fseq.nextval,'Jim');
insert into firstname values(fseq.nextval,'Jack');
insert into firstname values(fseq.nextval,'Joe');
insert into firstname values(fseq.nextval,'Eric');
insert into firstname values(fseq.nextval,'Jacky');
insert into firstname values(fseq.nextval,'Laura');
insert into firstname values(fseq.nextval,'Susan');
insert into firstname values(fseq.nextval,'Christine');
insert into firstname values(fseq.nextval,'Angela');
insert into firstname values(fseq.nextval,'Janet');

drop sequence fseq;

COMMIT;

Music Schema Data Generation: FACTS.SQL subset script (lastname.sql)

drop table lastname;
create table lastname(id integer,name varchar2(32));
drop sequence lseq;
CREATE SEQUENCE lSEQ START WITH 1 INCREMENT BY 1 NOMAXVALUE NOCYCLE;

insert into lastname values(lseq.nextval,'Jones');
insert into lastname values(lseq.nextval,'Smith');
insert into lastname values(lseq.nextval,'Perez');
insert into lastname values(lseq.nextval,'Baum');
insert into lastname values(lseq.nextval,'Jacobs');
insert into lastname values(lseq.nextval,'Goldblatt');
insert into lastname values(lseq.nextval,'Powell');
insert into lastname values(lseq.nextval,'Depardeau');
insert into lastname values(lseq.nextval,'Price');
insert into lastname values(lseq.nextval,'Howells');

drop sequence lseq;

COMMIT;

Utilities

Music Schema

showTables.sql

set wrap off linesize 132 pages 80

column tab format a20
column col format a15
column pos format 990
column typ format a10
column tbs format a25
BREAK ON tab NODUPLICATES SKIP 2 ON NAME NODUPLICATES 

select	 t.table_name "Tab"
	,c.column_name "Col"
	,c.column_id "Pos"
	,c.data_type "Typ"
	,DECODE(c.nullable,'N','NOT NULL',NULL) "Null"
	,t.tablespace_name "Tbs"
from user_tables t, user_tab_columns c
where t.table_name = c.table_name
order by t.table_name, c.column_id;

showIndexes.sql

set wrap off linesize 132 pages 80
column tab format a25
column typ format a5
column ind format a25
column col format a20
column pos format 990
column tbs format a25
BREAK ON tab NODUPLICATES SKIP 2 ON NAME NODUPLICATES 
select	 t.table_name "Tab"
	,decode(t.index_type,'NORMAL','BTree','BITMAP','Bitmap','FUNCTION-BASED NORMAL','Function-Based BTree',t.index_type) "Typ"
	,t.index_name "Ind"
	,c.column_name "Col"
	,c.column_position "Pos"
	,t.tablespace_name "Tbs"
from user_indexes t, user_ind_columns c
where t.table_name = c.table_name
and t.index_name = c.index_name
and t.index_type not in ('IOT - TOP','LOB')
order by t.table_name, t.index_name, c.column_position;

showConstraints.sql

set wrap off linesize 132 pages 80
column tab format a20
column key format a10
column cons format a20
column col format a10
column pos format 990
BREAK ON tab NODUPLICATES SKIP 2 ON NAME NODUPLICATES 
select	 t.table_name "Tab"
	,decode(t.constraint_type,'P','Primary','R','Foreign','U','Alternate','Unknown') "Key"
	,t.constraint_name "Cons"
	,c.column_name "Col"
	,c.position "Pos"
from user_constraints t, user_cons_columns c
where t.constraint_type in ('P','R','U')
and t.table_name = c.table_name
and t.constraint_name = c.constraint_name
order by t.table_name, t.constraint_type, c.position;