Você está na página 1de 10

Table Manipulation in SQL

The following SQL statements are showing the use of opening a table,
and inserting records in it.

-- USE <student_ID>_SOLUTION;
/*This file contains some starting inserts that will help with the
second ITECH1006/5006 Database Assignment 2
for summer semester (201527) @ Federation University.
The only table that might need changing is the EVENT_ORDER_ITEM
table since the Order_ID values
refer to event_orders and, by reference, events and customers that you
need to create.
For your information, order 1 was set up for a birthday party for 100
people, order 2 for a wedding with 150 people
order 3 for a citizenship ceremony with 50 people, order 4 for a
school end of year function with 200 people
and order 5 for a conference with 20 people. You might fashion your
other inserts around that information.
All other tables should stand on their own if you would like to use
them. Tom Keogh
*/

INSERT INTO ADDRESS_TYPE (Address_Type, Address_Type_Desc) VALUES


("L","location"),
("P","postal"),
("K","pickup" ),
("D","delivery");

INSERT INTO PRODUCT_TYPE (Product_Type, Product_Type_Desc) VALUES


("f","food"),
("a","alcohol"),
("e", "equipment");

INSERT INTO ADDRESS


(Address_ID,Address_Type,Street_Dtls,City,State,Postcode) VALUES
(1,"L","54 Railway Ct., Peachman Industrial
Estate","Branxholme","VIC","3366"),
(1,"K","Rear, 56 Railway Ct., Peachman Industrial
Estate","Branxholme","VIC","3366"),
(2,"L","28 Havelock Street","Bofficer","VIC","3388"),
(3,"L","25 Sturt Street","Thurgin","VIC","3377"),
(3,"P","PO BOX 655 Brown Hill Mail Centre","Thurgin","VIC","3378"),
(3,"K","87 Tram Crescent, Menhen Industrial
Park","Thurgin","VIC","3377"),
(4,"L","13 Sturt Street","Thurgin","VIC","3377"),
(4,"P","PO BOX 685 Brown Hill Mail Centre","Thurgin","VIC","3378"),
(5,"K","Shed 28,Blandglen Markets, Tran
Avenue","Blandglen","VIC","3344"),
(5,"L","Shop 20,Blandglen Markets, Tran
Avenue","Blandglen","VIC","3344"),
(6,"L","54 Trueman Street","Branxholme","VIC","3366"),
(6,"K","80 Railway Ct., Peachman Industrial
Estate","Branxholme","VIC","3366");

-- don't need Supplier_ID as it is auto-incremented


INSERT INTO SUPPLIER
(Supplier_Bus_Name,Supplier_URL,Supplier_Email,Supplier_Phone,Supplier
_Contact_Name,Supplier_Contact_Phone,Supplier_Contact_Email,Address_ID
) VALUES
("Smith Catering
Warehouse","http://www.Smith_Catering.com.au","s.catering@smithcat.com
.au","3355333355","Richard
Smith","0448678916","r.smith@smithcat.com.au",1),
("Ronson Liquor
Store","http://www.RonsonLiquor.com.au","r.liquor@ronliq.com.au","4466
444466","Hugh Spirits","0448567805","h.spirits@ronliq.com.au",2),
("Jackson Meat
Supplies","http://www.JacksonMeats.com.au","contact@jackson.com.au","2
244222244","Ronald
Jackson","0445789234","r.jackson@jackson.com.au",3),
("Paris
Patisserie","http://www.ParisPatisserie.com.au","contact@parpat.com.au
","3355333388","Gayle Hollande","0448256765","",4),
("Unique Fruit and Vegetable
Wholesalers","http://www.Unique_Fruit_nd_Vegetables.com.au","ufavw@ufa
vw.com.au","3355666655","Mark
Riccardo","0445769861","m.riccardo@ufavw.com.au",5),
("Pierre's
Kitchen","http://www.Kitchen_Pierre.com.au","kp@uvw.com.au","335577668
8","Pierre Guillame","0445999321","p.guillame@uvw.com.au",6);

-- -- don't need Product_ID as it is auto-incremented


INSERT INTO PRODUCT (Product_Type,Product_Desc) VALUES
("f","10kg crate mixed salad vegetables"),
("f","20kg crate mixed salad vegetables"),
("f","50kg crate mixed salad vegetables"),
("f","10kg crate mixed fresh fruit"),
("f","20kg crate mixed fresh fruit"),
("f","50kg crate mixed fresh fruit"),
("f","10kg standard barbeque meat pack"),
("f","20kg standard barbeque meat pack"),
("f","50kg standard barbeque meat pack"),
("f","10kg deluxe barbeque meat pack"),
("f","20kg deluxe barbeque meat pack"),
("f","50kg deluxe barbeque meat pack"),
("f","6 roast chickens"),
("f","12 roast chickens"),
("f","1 roast lamb - 2 kg"),
("f","1 roast pork - 2 kg"),
("f","1 roast beef - 2 kg"),
("f","10kg roast vegetables"),
("f","1 hors d'oeuvres standard tray for 12 adults"),
("f","1 hors d'oeuvres premium tray for 12 adults"),
("f","1 french pastries standard tray for 12 adults"),
("f","1 french pastries premium tray for 12 adults"),
("f","12 french sticks"),
("f","24 french sticks"),
("f","12 white bread rolls"),
("f","24 white bread rolls"),
("f","12 brown bread rolls"),
("f","24 brown bread rolls"),
("f","12 multigrain bread rolls"),
("f","24 multigrain bread rolls"),
("f","6 white bread loaves"),
("f","12 white bread loaves"),
("f","6 brown bread loaves"),
("f","12 brown bread loaves"),
("f","6 multigrain bread loaves"),
("f","12 multigrain bread loaves"),
("f","2kg of standard tea blend"),
("f","2kg of premium tea blend"),
("f","50 standard tea bags"),
("f","50 premium tea bags"),
("f","100 standard tea bags"),
("f","100 premium tea bags"),
("f","2kg of standard ground coffee"),
("f","2kg of premium ground coffee"),
("f","carton of sparkling mineral water"),
("f","carton of lime soda"),
("f","carton of lemon soda"),
("f","carton of orange soda"),
("f","carton of raspberry soda"),
("f","crate of lime soda"),
("f","crate of lemon soda"),
("f","crate of orange soda"),
("f","crate of raspberry soda"),
("f","standard birthday cake"),
("f","premium birthday cake"),
("f","standard wedding cake"),
("f","premium wedding cake"),
("f","standard christening cake"),
("f","premium christening cake"),
("a","carton of light house beer - cans"),
("a","carton of light house beer - stubbies"),
("a","carton of light house beer - bottles"),
("a","keg of light house beer"),
("a","carton of heavy house beer - cans"),
("a","carton of heavy house beer - stubbies"),
("a","carton of heavy house beer - bottles"),
("a","keg of heavy house beer"),
("a","crate of house wine - red"),
("a","crate of house wine - white"),
("a","crate of standard champagne"),
("a","crate of premium champagne"),
("e","off tap portable bar hire"),
("e","standardbainmarie hire"),
("e","1 deluxe bainmarie hire"),
("e","1 standard barbeque with utensils hire"),
("e","1 deluxe barbeque with utensils hire"),
("e","1 standard urn hire"),
("e","1 deluxe urn hire"),
("e","1 standard coffee machine hire"),
("e","1 deluxe coffee machine hire"),
("e","1 disposable cutlery pack - 50"),
("e","1 disposable crockery pack - 50"),
("e","1 disposable cups pack - 50"),
("e","1 standard cutlery pack - 12 hire"),
("e","1 standard crockery pack - 12 hire"),
("e","1 premium cutlery pack - 12 hire"),
("e","1 premium crockery pack - 12 hire"),
("e","1 food serving bowls set hire"),
("e","1 food serving utensils set hire"),
("e","1 standard glasses pack - 12 hire"),
("e","1 premium glasses pack - 12 hire"),
("e","1 spit roast unit hire"),
("f","1 10kg suckling pig for roasting"),
("f","1 15kg lamb for roasting"),
("e","1 750 litre fridge for hire"),
("f","mixed sandwich platter to suit 10"),
("f","mixed sandwich platter to suit 20"),
("f","mixed sandwich platter to suit 50"),
("f","crate of orange juice"),
("f","crate of apple and blackcurrant juice"),
("f","crate of pineapple juice");

INSERT INTO SUPP_PROD (Supplier_ID,Product_ID,SP_Price,SP_Cost) VALUES


(1,37,5.00,4.00),
(1,38,9.50,8.00),
(1,39,3.00,2.00),
(1,40,5.00,4.00),
(1,41,4.00,3.00),
(1,42,6.00,5.00),
(1,43,6.00,5.00),
(1,44,12.00,10.00),
(1,45,28.00,24.00),
(1,46,28.00,24.00),
(1,47,28.00,24.00),
(1,48,28.00,24.00),
(1,49,28.00,24.00),
(1,50,28.00,24.00),
(1,51,28.00,24.00),
(1,52,28.00,24.00),
(1,53,28.00,24.00),
(1,72,150.00,130.00),
(1,73,60.00,50.00),
(1,74,100.00,80.00),
(1,75,22.00,20.00),
(1,76,45.00,40.00),
(1,77,12.00,10.00),
(1,78,20.00,15.00),
(1,79,60.00,50.00),
(1,80,90.00,80.00),
(1,81,12.00,10.00),
(1,82,24.00,20.00),
(1,83,12.00,10.00),
(1,84,12.00,10.00),
(1,85,20.00,15.00),
(1,86,20.00,15.00),
(1,87,23.00,20.00),
(1,88,18.00,15.00),
(1,89,18.00,15.00),
(1,90,18.00,15.00),
(1,91,24.00,20.00),
(1,92,200.00,150.00),
(1,95,220.00,150.00),
(2,46,28.00,23.00),
(2,47,28.00,23.00),
(2,48,28.00,23.00),
(2,49,28.00,23.00),
(2,50,28.00,24.00),
(2,51,28.00,24.00),
(2,52,28.00,23.00),
(2,53,28.00,23.00),
(2,60,33.00,30.00),
(2,61,33.00,30.00),
(2,62,33.00,30.00),
(2,63,370.00,320.00),
(2,64,38.00,34.00),
(2,65,38.00,34.00),
(2,66,38.00,34.00),
(2,67,470.00,410.00),
(2,68,130.00,100.00),
(2,69,130.00,100.00),
(2,70,250.00,200.00),
(2,71,750.00,500.00),
(2,72,150.00,120.00),
(2,90,18.00,14.50),
(2,91,24.00,19.50),
(3,7,60.00,50.00),
(3,8,108.00,90.00),
(3,9,264.00,220.00),
(3,10,90.00,75.00),
(3,11,163.00,135.00),
(3,12,396.00,330.00),
(3,92,200.00,145.00),
(3,93,200.00,150.00),
(3,94,200.00,150.00),
(4,19,30.00,24.00),
(4,20,46.00,36.00),
(4,21,60.00,48.00),
(4,22,90.00,72.00),
(4,23,28.00,24.00),
(4,24,52.00,45.00),
(4,25,12.00,10.00),
(4,26,21.00,18.00),
(4,27,14.00,12.00),
(4,28,24.00,20.00),
(4,29,14.00,12.00),
(4,30,26.00,22.00),
(4,31,28.00,24.00),
(4,32,53.00,46.00),
(4,33,32.00,28.00),
(4,34,56.00,50.00),
(4,35,34.00,30.00),
(4,36,65.00,58.00),
(4,54,38.00,30.00),
(4,55,65.00,50.00),
(4,56,65.00,50.00),
(4,57,130.00,100.00),
(4,58,50.00,40.00),
(4,59,100.00,80.00),
(5,1,50.00,40.00),
(5,2,100.00,78.00),
(5,3,175.00,140.00),
(5,4,55.00,45.00),
(5,5,110.00,80.00),
(5,6,180.00,150.00),
(6,13,35.00,30.00),
(6,14,65.00,55.00),
(6,15,25.00,20.00),
(6,16,25.00,20.00),
(6,17,25.00,20.00),
(6,18,25.00,20.00),
(6,19,30.00,24.00),
(6,20,45.00,36.00),
(6,54,38.00,29.00),
(6,55,65.00,49.00),
(6,56,65.00,50.00),
(6,57,130.00,100.00),
(6,58,50.00,39.00),
(6,59,100.00,79.00),
(4,96,30.00,25.00),
(4,97,58.00,48.00),
(4,98,150.00,120.00),
(6,96,30.00,24.50),
(6,97,58.00,47.50),
(6,98,150.00,119.00),
(1,99,25.00,18.00),
(1,100,25.00,18.00),
(1,101,25.00,18.00),
(2,99,25.00,18.00),
(2,100,25.00,18.00),
(2,101,25.00,18.00);

INSERT INTO EVENT_ORDER_ITEM


(Order_ID,Supplier_ID,Product_ID,EOI_Price,EOI_Quantity) VALUES
(1,5,2,78.00,1),
(1,5,5,110.00,1),
(1,6,14,65.00,1),
(1,6,16,25.00,2),
(1,6,17,25.00,2),
(1,6,18,25.00,2),
(1,4,24,52.00,1),
(1,4,26,24.00,2),
(1,1,41,4.00,1),
(1,1,43,6.00,1),
(1,2,50,28.00,1),
(1,2,51,28.00,1),
(1,4,54,38.00,1),
(1,2,62,33.00,2),
(1,2,66,38.00,2),
(1,2,68,130.00,1),
(1,2,69,130.00,1),
(1,1,74,100.00,2),
(1,1,78,20.00,2),
(1,1,84,12.00,9),
(1,1,85,20.00,9),
(1,2,90,18.00,9),
(2,5,1,50.00,1),
(2,5,2,78.00,1),
(2,5,4,55.00,1),
(2,5,5,110.00,1),
(2,6,14,65.00,1),
(2,6,16,25.00,3),
(2,6,17,25.00,3),
(2,6,18,25.00,3),
(2,4,24,52.00,2),
(2,4,26,24.00,6),
(2,1,41,4.00,1),
(2,1,43,6.00,1),
(2,2,50,28.00,2),
(2,2,51,28.00,2),
(2,4,57,130.00,1),
(2,2,62,33.00,2),
(2,2,66,38.00,2),
(2,2,68,130.00,1),
(2,2,69,130.00,1),
(2,1,74,100.00,2),
(2,1,78,20.00,2),
(2,1,84,12.00,13),
(2,1,85,20.00,13),
(2,2,90,18.00,13),
(2,2,72,150.00,1),
(2,2,67,470.00,1),
(2,2,70,250.00,2),
(3,4,24,52.00,1),
(3,1,41,4.00,1),
(3,1,43,6.00,1),
(3,2,52,28.00,1),
(3,2,53,28.00,1),
(3,6,19,30.00,2),
(3,4,21,60.00,2),
(3,6,97,58.00,1),
(3,2,99,25.00,1),
(3,1,82,24.00,1),
(3,1,83,12.00,1),
(4,5,2,100.00,1),
(4,5,5,110.00,1),
(4,3,9,264.00,1),
(4,6,14,65.00,1),
(4,4,32,53.00,1),
(4,4,34,56.00,1),
(4,2,46,28.00,1),
(4,2,47,28.00,1),
(4,2,48,28.00,1),
(4,2,49,28.00,1),
(4,2,50,28.00,1),
(4,2,51,28.00,1),
(4,2,52,28.00,1),
(4,1,73,60.00,1),
(4,1,81,12.00,4),
(4,1,82,24.00,4),
(4,1,83,12.00,4),
(4,2,99,25.00,1),
(4,2,100,25.00,1),
(5,4,23,28.00,1),
(5,1,40,5.00,1),
(5,1,44,12.00,1),
(5,4,21,60.00,2),
(5,6,97,58.00,1),
(5,2,99,25.00,1),
(5,1,83,12.00,1),
(5,6,96,30.00,1),
(5,2,100,25.00,1),
(5,1,86,20.00,2),
(5,1,87,23.00,2),
(5,1,91,24.00,2),
(5,1,80,90.00,1);

Você também pode gostar