Question: Run the sql file provided, creating a table. Apply DDL and DML commands to transform that existing DB of just one table into a DB

Run the sql file provided, creating a table. Apply DDL and DML commands to transform that existing DB of just one table into a DB of 3 tables: Wine, Price, and Retailer; where Price is the junction table. You need to provide the sql script and make sure it runs.


drop table Wine;

create table Wine
(ID NUMBER(6,0) NOT NULL,
 wineID NUMBER(4,0),
 name NVARCHAR2(30),
 vintage NUMBER(4,0),
 price NUMBER(6,0),
 retailerID NUMBER(4,0),
 retailerName NVARCHAR2(30),
 PRIMARY KEY (ID));

insert into Wine values(1, 101, 'Grange', 2010, 750, 1001, 'Dan Murphys');
insert into Wine values(2, 102, 'Grange', 2006, 700, 1001, 'Dan Murphys');
insert into Wine values(3, 103, 'Reserve Shiraz', 2013, 10, 1001, 'Dan Murphys');
insert into Wine values(4, 104, 'Grey Label Shiraz', 2012, 35, 1001, 'Dan Murphys');
insert into Wine values(5, 105, 'Patricia Shiraz', 2009, 50, 1001, 'Dan Murphys');
insert into Wine values(6, 106, 'Ten Acres Shiraz', 2012, 25, 1001, 'Dan Murphys');
insert into Wine values(7, 107, 'Double Barrel Shiraz', 2012, 15, 1001, 'Dan Murphys');
insert into Wine values(8, 108, 'Platinum Label Shiraz', 2006, 170, 1001, 'Dan Murphys');
insert into Wine values(9, 103, 'Reserve Shiraz', 2013, 9, 1002, 'Woolworths');
insert into Wine values(10, 104, 'Grey Label Shiraz', 2012, 33, 1002, 'Woolworths');
insert into Wine values(11, 105, 'Patricia Shiraz', 2009, 44, 1002, 'Woolworths');
insert into Wine values(12, 106, 'Ten Acres Shiraz', 2012, 22, 1002, 'Woolworths');
insert into Wine values(13, 107, 'Double Barrel Shiraz', 2012, 12, 1002, 'Woolworths');
insert into Wine values(14, 110, 'Jacks Red', 2016, NULL, NULL, NULL);
insert into Wine values(15, 111, 'Jacks White', 2016, NULL, NULL, NULL);
insert into Wine values(16, NULL, NULL, NULL, NULL, 1003, 'Jills Hill');

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!