0% found this document useful (0 votes)
45 views

SQL Lab Exercise - (Lab Test)

This document contains the schema definitions for tables used in an Oracle database lab exercise including tables for items, customers, orders, and order details. It also lists questions to retrieve and analyze data from these tables including listing customer orders for the current fiscal year, identifying the highest value items ordered, and generating reports and stored procedures to analyze orders by customer, item, quantity, cost and group for a given period.

Uploaded by

KIRAN
Copyright
© © All Rights Reserved
Available Formats
Download as DOC, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
45 views

SQL Lab Exercise - (Lab Test)

This document contains the schema definitions for tables used in an Oracle database lab exercise including tables for items, customers, orders, and order details. It also lists questions to retrieve and analyze data from these tables including listing customer orders for the current fiscal year, identifying the highest value items ordered, and generating reports and stored procedures to analyze orders by customer, item, quantity, cost and group for a given period.

Uploaded by

KIRAN
Copyright
© © All Rights Reserved
Available Formats
Download as DOC, PDF, TXT or read online on Scribd
You are on page 1/ 1

Oracle Lab Exercise for Day 3

ITEM
ITEM_NO
ITEM_DESCRIPTION
ITEM_GROUP
ITEM_FAMILY
ITEM_UNIT_OF_MEASURE
ITEM_UNIT_PRICE

NUMBER(5)
VARCHAR2(50)
VARCHAR2(10)
VARCHAR2(20)
VARCHAR2(5)
NUMBER

NOT NULL (PK)


NOT NULL
NOT NULL
NOT NULL
NOT NULL
NOT NULL

CUSTOMER_MASTER
CUST_ID
CUST_NAME
CUST_LOCATION

NUMBER(5)
VARCHAR2(50)
VARCHAR2(10)

NOT NULL (PK)


NOT NULL
NOT NULL

ORDER_HEADER
ORDER_ID
ORDER_DT
ORDER_CUST_ID

NUMBER(5)
DATE
NUMBER(5)

NOT NULL (PK)


NOT NULL
NOT NULL (FK)

ORDER_DETAIL
ORDER_ID
ITEM_NO
ORDER_QTY

NUMBER (5)
NUMBER(5)
NUMBER (5)

NOT NULL (PK)


NOT NULL (PK)
NOT NULL

Lab Questions Set1


List the customer details and their order details for the current fiscal year
List the item details which has been ordered for maximum value
Write a stored procedure to find the total value of all the orders received during a specific
period
Lab Questions Set2
Find the customer who has not placed any order so far
Generate the order report which contains the following
CUST_NAME
ITEM_NAME
QTY
TOTAL_COST
Write a PL/SQL function that generates the orders that has been placed for that item
group

You might also like