The document describes an internal viva activity for a student involving an order processing database application. It includes:
1) Relations for the database schema including customer, orders, order items, items, shipments, and warehouses tables with attributes and primary/foreign keys specified.
2) A question asking to create the tables which the student answers by writing the proper SQL commands.
3) A question asking to insert sample data into the relations, which the student provides SQL insert statements as an answer.
4) A question asking to list customer name, number of orders, and average order amount for each customer, which the student answers with the correct SQL join and aggregate functions.
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0 ratings0% found this document useful (0 votes)
75 views5 pages
DBMS (Practical) BETN1CS18084
The document describes an internal viva activity for a student involving an order processing database application. It includes:
1) Relations for the database schema including customer, orders, order items, items, shipments, and warehouses tables with attributes and primary/foreign keys specified.
2) A question asking to create the tables which the student answers by writing the proper SQL commands.
3) A question asking to insert sample data into the relations, which the student provides SQL insert statements as an answer.
4) A question asking to list customer name, number of orders, and average order amount for each customer, which the student answers with the correct SQL join and aggregate functions.
AVG_ORDER_AMT, where the middle column is the total number of orders by the customer and the last column is the average order amount for that customer. CNAME COUNT(*) AVG GHI 2 1750 MNO 1 10000 ABC 1 5000 DEF 1 5000.5 Ans. 1. select C.Cname, count(*) as NO_OF_ORDERS, avg(O.Order_Amt) as AVG_ORDER_AMT 2. from customer C, orders O 3. where (C.Cust# = O.Cust#) group by Cname;