Question
Write SQL code to set up table FW TransportRequirement according to the following Relational Schema: FW TransportRequirement(number,order no,lorry,transport quantity) primary key (number,order no) foreign key
Write SQL code to set up table FW TransportRequirement according to the following Relational Schema:
FW TransportRequirement(number,order no,lorry,transport quantity) primary key (number,order no) foreign key order no references FW SalesOrder(order no) foreign key lorry references FW Lorry(vehicleRegNo) You must accommodate the following requirements:
(a) For table and column names you must pick the names used in the schema above (otherwise you will lose marks as tests will fail). (b) For each order there are never more than 255 transport requirements. (c) The type of the transport quantity column must be like the one for the maximum load for lorries given in the question 1e) above, however the default must now be 0. (d) When an order is deleted, all transportation requirement records for this order shall be deleted automatically as well. (e) When an orders order number changes (which will rarely happen), then the change is automatically and consistently performed in the affected transport requirements. (f) When a lorry is deleted from the database, the transport requirements affected should remain on the database (not affecting the deletion of the lorry otherwise). (g) If and where applicable equip the foreign constraints with constraint names of your choosing.
Your code must execute without syntax error and without runtime error
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started