Beruflich Dokumente
Kultur Dokumente
SQL LAB
Set I
3.Create the following tables:
TABLE : STUDENT
COLUMN NAME DATA TYPE CONSTRAINTS
Roll_no Number(5) Primary Key
Name Varchar(20) Not null
Dept_id Number(5) Foreign Key
Gender Varchar(2)
Contact_no Number(10)
TABLE : DEPARTMENT
COLUMN NAME DATA TYPE CONSTRAINTS
Dept_id Number(5) Primary Key
Dept_name Varchar(10) Not null
TABLE : INVOICE
EMPLOYEE
Column name Data type constraints
Emcode Varchar(10) Primary key
Ename Varchar(15) Not null
Dname Varchar(10)
City Varchar(10)
Designation Varchar(20)
Salary Number(15)
bonus Number(7.2)
CUSTOMER
ACCOUNT
Column name Data type constraints
Acc no Number(20) Primary key
Amount Varchar(20)
PERSONS
Column name Data type Constraints
PID Numeric(5) Primary key
Fname Varchar(15) Not null
Lname Varchar(15)
Address Varchar(20)
City Varchar(10)
ORDER
Column name Data type Constraints
OID Numeric(5) Primary key
Order qty Numeric(5) Not null
Order date Date
PID Numeric(5) Foreign key
9.Create tables with appropriate structure to store information about a number of items to be kept
in stock in a provision store and the details about the sales on a given day.Then write the needed
queries to
1. Inserting meaningful data into tables
2.Displaying the items in stock category wise
3. Details of sales made on a given day item wise
4. Display the sales bill with maximum amount on that day
10.Create the following tables
EMPLOYEE
Column name Data type Constraints
Eno Varchar(5) Primary key
Name Varchar(30) Not null
Designation Varchar(30) Trainee,team
member,team,head manager
Salary Number(7,2)
PROJECT
COLUMN NAME DATA TYPE CONSTRAINTS
PID Varchar(5) Primary key
Project name Varchar(25)
Eno Varchar(5) Foreign key
SALES
COLUMN NAME Data type Constraint
ORDERNO Varchar(6) Primary key
ORDER DATE Date
Cno Varchar(6) Foreign key