Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

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

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Entrepreneurship

Authors: Andrew Zacharakis, William D Bygrave

5th Edition

1119563097, 9781119563099

More Books

Students also viewed these Databases questions

Question

14. Let X be uniform over (0, 1). Find E[X|X Answered: 1 week ago

Answered: 1 week ago

Question

What is the second law of thermodynamics?

Answered: 1 week ago