Question

In: Computer Science

Insert at least three rows of data to each table. Make sure you keep the primary...

Insert at least three rows of data to each table. Make sure you keep the primary key and foreign key constraints.

Tables:

Cust Table:

cid, -- customer id

cname, --- customer name

cphone, --- customer phone

cemail, --- customer email

Category table:

ctid, --- category id

ctname, --- category name

parent, --- parent category id since category has a hierarchy structure, power washers, electric power washers, gas power washers. You can assume that there are only two levels.

Tool:

tid, --- tool id

tname, --- tool name

ctid, --- category id, the bottom level.

quantity, --- number of this tools

Time_unit table allowed renting unit

tuid, --- time unit id

len, --- length of period, can be 1 hour, 1 day, etc.

min_len, --- minimal #of time unit, e.g., hourly rental but minimal 4 hours.

Tool_Price:

tid, --- tool id

tuid, --- time unit id

price, -- price per period

Rental:

rid, --- rental id

cid, --- customer id

tid, --- tool id

tuid, --- time unit id

num_unit, --- number of time unit of rental, e.g., if num_unit = 5 and unit is hourly, it means 5 hours.

start_time, -- rental start time

end_time, --- suppose rental end_time

return_time, --- time to return the tool

credit_card, --- credit card number

total, --- total charge

Solutions

Expert Solution

Cust Table: Insert Querys

INSERT INTO Cust (cid,cname,cphone,cemail) VALUES ("C1001","John",1234567890,"[email protected]");

INSERT INTO Cust (cid,cname,cphone,cemail) VALUES ("C1002","Abraham",9876543210,"[email protected]");

INSERT INTO Cust (cid,cname,cphone,cemail) VALUES ("C1003","Joe",6543219870,"[email protected]");

Category Table :Insert Querys :

INSERT INTO Cust (ctid,ctname,parent) VALUES ("CT1001","Electronics","CT1002");

INSERT INTO Cust (ctid,ctname,parent) VALUES ("CT1002","Power Electronics","CT1001");

INSERT INTO Cust (ctid,ctname,parent) VALUES ("CT1003"," Gas Electronics","CT1001");

Tool Table:Insert Querys:

INSERT INTO TOOL (tid,tname,ctid,quantity) VALUES ("T1001","Desktop","CT1002",10);

INSERT INTO TOOL (tid,tname,ctid,quantity) VALUES ("T1002","laptop","CT1002",100);

INSERT INTO TOOL (tid,tname,ctid,quantity) VALUES ("T1003","Iron box","CT1001",40);

Time_unit:Insert Querys:

// Considering that length will be in hours

INSERT INTO Time_unit (tuid,len,min_len) VALUES ("TU1001",72,4);

INSERT INTO Time_unit (tuid,len,min_len) VALUES ("TU1002",48,6);

INSERT INTO Time_unit (tuid,len,min_len) VALUES ("TU1003",24,2);

Tool_Price:INSERT Querys:

INSERT INTO Tool_Price(tid,tuid,price) VALUES ("T1001","TU1001",100);

INSERT INTO Tool_Price(tid,tuid,price) VALUES ("T1002","TU1002",400);

INSERT INTO Tool_Price(tid,tuid,price) VALUES ("T1003","TU1003",900);

Rental :INSERT Querys:

INSERT INTO Rental(rid,cid,tid,tuid,num_unit,start_time,end_time,return_time,credit_card,total)

VALUES ("R1001","C1001","T1001","TU1001",4,"9-12-2019 15:32PM","10-12-2019 15:32PM","10-12-2019 12:32PM",1012365478,600);

INSERT INTO Rental(rid,cid,tid,tuid,num_unit,start_time,end_time,return_time,credit_card,total)

VALUES ("R1002","C1002","T1002","TU1002",3,"9-12-2019 12:32PM","10-12-2019 12:32PM","10-12-2019 10:32PM",2012365488,4800);

INSERT INTO Rental(rid,cid,tid,tuid,num_unit,start_time,end_time,return_time,credit_card,total)

VALUES ("R1003","C1003","T1003","TU1003",2,"9-12-2019 10:32PM","10-12-2019 10:32PM","10-12-2019 10:32PM",2012325896,1600);


Related Solutions

Create a Word document and title it “College Expenses”. In the Word document, insert a table with at least 5 rows and 5 columns. Insert>Table.
Assignment 3 – Incorporating a Table into a Document.Create a Word document and title it “College Expenses”. In the Word document, insert a table with at least 5 rows and 5 columns. Insert>Table.Tell me about your college expenses you have by filling this table with subjects and data. Then write two paragraphs telling me about the information you provided in the table. Bold and color table heading.  Example of table:College ExpensesTuitionBooksComputer/InternetOther suppliesScience ClassMath classC.I.S. ClassEnglish ClassGive the page a proper title....
What you see as the challenges of globalization. Make sure that you mentioned at least three...
What you see as the challenges of globalization. Make sure that you mentioned at least three challenges and pick one of those challenges to go further in depth. Mention an organization that struggled within their globalization strategy and explain exactly why they failed. Additionally, you need to explain why the cultural, legal, political and economic systems will be different from one part of the world compared to another part of the world. When explaining this it is imperative to show...
You will be building a linked list. Make sure to keep track of both the head...
You will be building a linked list. Make sure to keep track of both the head and tail nodes. (1) Create three files to submit. PlaylistNode.h - Class declaration PlaylistNode.cpp - Class definition main.cpp - main() function Build the PlaylistNode class per the following specifications. Note: Some functions can initially be function stubs (empty functions), to be completed in later steps. Default constructor (1 pt) Parameterized constructor (1 pt) Public member functions InsertAfter() - Mutator (1 pt) SetNext() - Mutator...
Be sure you ANSWER ALL PARTS OF EACH QUESTION. INSERT YOUR ANSWERS UNDER EACH QUESTION –...
Be sure you ANSWER ALL PARTS OF EACH QUESTION. INSERT YOUR ANSWERS UNDER EACH QUESTION – FIVE LINES MAXIMUM 1. A hypothetical economy is simultaneously experiencing an average propensity to consume of .90 and a marginal propensity to consume of .80. Explain in detail what this means. Be specific. 2. Who or what is the active participant in the fiscal policy model discussed in the text. Be sure to explain the appropriate response to a recessionary downturn and an inflation....
Use C++ please You will be building a linked list. Make sure to keep track of...
Use C++ please You will be building a linked list. Make sure to keep track of both the head and tail nodes. (1) Create three files to submit. PlaylistNode.h - Class declaration PlaylistNode.cpp - Class definition main.cpp - main() function Build the PlaylistNode class per the following specifications. Note: Some functions can initially be function stubs (empty functions), to be completed in later steps. Default constructor (1 pt) Parameterized constructor (1 pt) Public member functions InsertAfter() - Mutator (1 pt)...
Please be sure you ANSWER ALL PARTS OF EACH QUESTION. Thanks INSERT YOUR ANSWERS UNDER EACH...
Please be sure you ANSWER ALL PARTS OF EACH QUESTION. Thanks INSERT YOUR ANSWERS UNDER EACH QUESTION – FIVE LINES MAXIMUM 1. According to the Congressional Budget Office the Trump administration’s recent tax cuts will create budget deficits of $1,000 Billion ($1 Trillion). Explain how this deficit will be “financed” or paid for. Be specific. 3. Describe how a bank’s excess reserves are calculated and describe their importance, if any, to the individual bank.
8.13 LAB: Warm up: Contacts You will be building a linked list. Make sure to keep...
8.13 LAB: Warm up: Contacts You will be building a linked list. Make sure to keep track of both the head and tail nodes. (1) Create three files to submit. ContactNode.h - Class declaration ContactNode.cpp - Class definition main.cpp - main() function (2) Build the ContactNode class per the following specifications: Parameterized constructor. Parameters are name followed by phone number. Public member functions InsertAfter() (2 pts) GetName() - Accessor (1 pt) GetPhoneNumber - Accessor (1 pt) GetNext() - Accessor (1...
Why is it important to keep adequate records and make sure that your billing is correct?...
Why is it important to keep adequate records and make sure that your billing is correct? Why is this so important to the doctor you work for? Why is this so critical to the doctor’s success in the clinic? write 2 paragraphs Your responsibility as a Medical Office Assistant is made up of several things. Taking care of the doctor, the patients, the office, the mail, faxes and so on. Billing is the one responsibility that is first and foremost....
Make sure it works on jsfiddle and keep the code seperate html: css: javascript: -----------------------------------------------------------------------------------------------------------------------------------------------------------------------------
Make sure it works on jsfiddle and keep the code seperate html: css: javascript: ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- Assignment You should already have some experience with jQuery and some simple experience with JSON (from charting). In this assignment we will be creating some JSON data, parsing it, and displaying it. Step 1 – If you are not familiar with JSON you should complete the JSON tutorial at w3schools Step 2- You will now create a JSON file to represent some data of your...
1 – Create a webpage that contains a table with exactly three rows and two columns....
1 – Create a webpage that contains a table with exactly three rows and two columns. The first row will contain a table heading containing the name of a US National Park, that spans across all columns. Hint: use the colspan attribute inside the opening th tag Give the table heading an onmouseover that will change the text of the heading when it is moused over to read My Favorites Park! (Hint: use innerHTML). Use onmouseout to change it back....
ADVERTISEMENT
ADVERTISEMENT
ADVERTISEMENT