Database Creation and SQL Assignment

Added on - 20 Sep 2019

  • 30

    Pages

  • 4222

    Words

  • 236

    Views

  • 0

    Downloads

Trusted by +2 million users,
1000+ happy students everyday
Showing pages 1 to 6 of 30 pages
CREATE database UP654321db; //Create database with UP654321db nameParticipation//SQL query to create tableCreate table Participant(partID integer PRIMARY KEY,partTitle varchar(30),partFName varchar(10),partLName varchar(10),partDOB Date,partAddress1 varchar(50),partCity varchar(30),partPhone integer(10),partEmail varchar(30),amountReleased decimal);This table contains all information of the participant of the event like their ID, address,city, phonenumber1
// SQL Query to Insert dataINSERT INTO participant VALUES('12345',"DB","Margaret","Emily",'1992-05-12',"Acton","London",'8181818181',"xyz@gmail.com",2000);INSERT INTO participant VALUES('23456',"CO","Ann","Poppy",'1991-03-09',"Anerley","London",'8282828282',"abc@gmail.com",2100);INSERT INTO participant VALUES('34567',"OS","Jane","Ava",'1993-06-09',"Beckon","London",'8383838383',"pqr@gmail.com",2050);INSERT INTO participant VALUES('45678',"Server","Alice","Isabella",'1994-08-25',"WhiteField","Manchester",'8484848484',"bcd@gmail.com",2030);INSERT INTO participant VALUES('56789',"Network","Ellen","Jessica",'1993-05-26',"Prestwich","Manchester",'8585858585',"cde@gmail.com",2150);INSERT INTO participant VALUES('67890',"Algo","Annie","Lily",'1989-06-22',"Altrincham","Manchester",'8686868686',"def@gmail.com",2180);INSERT INTO participant VALUES('78901',"DS","Florence","Sophie",'1990-07-23',"Catford","London",'8787878787',"efg@gmail.com",2020);INSERT INTO participant VALUES('89012',"CP","Emma","Grace",'1991-09-27',"Charlton","London",'8888888888',"fgh@gmail.com",2190);INSERT INTO participant VALUES('90123',"Com","Robert","Thomas",'1991-10-27',"Barbon","London",'8989898989',"ghi@gmail.com",1900);INSERT INTO participant VALUES('01234',"gom","George","Jacob",'1990-11-28',"Fronzr","Manchester",'8080808080',"hij@gmail.com",2010);2
Register//SQL Query to Create Register TableCREATE TABLE Register(PartID integer,eventID integer,regDate date,regDatePage date,PRIMARY KEY(PartID,eventID));This table contains all information about the registration of the participants like on which date theyhave registered for the event and on which date they have paid the fee for the event along with theirID3
//SQL Query to insert data in TableINSERT INTO Register VALUES('1234','1234560','2017-02-12','2017-03-15');INSERT INTO Register VALUES('12345','1234567','2017-02-18','2017-03-16');INSERT INTO Register VALUES('23456','2345678','2017-02-20','2017-03-15');INSERT INTO Register VALUES('34567','3456789','2017-02-15','2017-03-17');INSERT INTO Register VALUES('45678','4567890','2017-02-16','2017-03-18');INSERT INTO Register VALUES('56789','5678901','2017-02-17','2017-03-16');INSERT INTO Register VALUES('67890','6789012','2017-02-11','2017-03-18');INSERT INTO Register VALUES('78901','7890123','2017-02-21','2017-03-20');INSERT INTO Register VALUES('89012','8901234','2017-02-06','2017-03-19');INSERT INTO Register VALUES('90123','9012345','2017-02-23','2017-03-21');4
EventSupplier//SQL Query to create EventSupplier TableCREATE TABLE EventSupplier(supplierID integer(10),eventID integer(10),evSuppCost decimal,PRIMARY KEY(supplierID,eventID));This table contain all information about the supplier who provide all things at the event5
//SQL Query to Insert the data in TableINSERT INTO EventSupplier VALUES('123456','1234567','22000');INSERT INTO EventSupplier VALUES('234567','2345678','21000');INSERT INTO EventSupplier VALUES('345678','3456789','21200');INSERT INTO EventSupplier VALUES('456789','4567890','20500');INSERT INTO EventSupplier VALUES('567890','5678901','20100');INSERT INTO EventSupplier VALUES('678901','6789012','20200');INSERT INTO EventSupplier VALUES('789012','7890123','20700');INSERT INTO EventSupplier VALUES('890123','8901234','22300');INSERT INTO EventSupplier VALUES('901234','9012345','22200');INSERT INTO EventSupplier VALUES('012345','0123456','22600');6
desklib-logo
You’re reading a preview
Preview Documents

To View Complete Document

Click the button to download
Subscribe to our plans

Download This Document