In a software of order management, given the T_Order table with below initial attributes / fields:
id: unique identifier, auto increment field, primary key.
cd: Code of the order
name: name of the order
customer_cd: Code of the customer
customer_version: Version of the customer
received_date: Date which customer make order.
request_content: Detailed item of the order (free text)
quantity: Number of the requested item
time: deadline to finish the order
status: status of the order (int). Codes: 0: draft save; 1: wait to sign; 2: Processing; 10:
Finish
For the following requests, print out respectively the screenshots to show test data (the table data
that you create to test each query), the query results, and pack them into the zip file
Assignment2_AccountName.zip along with your answers, then handle to the evaluator via email
()
Q1: Create the tables (with the most appropriate/economic field/column constraints & types) and
add at least 10 records into each created table.
Q2: Update the table T_Order to add one more field named “received_person” which is a not-null;
add a constraint unique for triple cd, customer_cd, customer_version).
Q3: Create a VIEW which includes all the order(s) which are processing.
Q4: Query to count all the order(s) which are processing, group them into different day of the
deadline.
Q5: Query the order(s) which has the deadline in the past (deadline < today) but have not FINISH yet,
showing their order code, order name, customer code, received date, deadline with format
YYYY/MM/DD.
Barem chấm điểm:
Q1: 40% (4)
Q2: 10%(1)
Q3: 15%(1.5)
Q4: 15%(1.5)
Q5: 20%(2)