Вы находитесь на странице: 1из 1

a) Write an SQL query to create the table “Items“ with the b) Write an SQL query to create the table

table “Customer
following structure- with the following structure-
CUSTOMER Data Type Size Constraint
Field Type Constraint Column Name
Item_Id Varchar(5) Primary Key Cust_id Number 7 Primary key
Item_Name Varchar(25) Custname Varchar2 30 Not null
Manufacturer Varchar(15) Permanent_address Varchar2 20 Not less
Color Varchar(15) Postall_address Varchar2 20 than 2000
Price Integer Must between 399 and 4999 Tot_purchase_cost number 7,2
Quantity Integer Not Null

(c). Create a table employee as per following Table Instance Chart: 2


Column Name Empid empname Empaddress empphone empsal deptid
Key Type Primary
Nulls/Unique Not null
DataType number varchar varchar Varchar number varchar
Length 6 20 30 10 9,2 2

d) Write the SQL command to create the table Group1 including the constraints.
Column Name Data Size Constraint Description
Type
Group_code Number 4 Primary key Group Code
Group_Symbol Char 1 Default value ‘’ Symbol of Group
Group_name Varchar 25 Not null Name of the Group
Memberfees Number 8,2 Fees of each member
Noofmembers Number 3 Should not exceed 20 Members in the Group
Dt_Join date Date of Joining

b) Write an SQL query to create the table “Items“ with the b) Write an SQL query to create the table “Customer
following structure- with the following structure-
CUSTOMER Data Type Size Constraint
Field Type Constraint Column Name
Item_Id Varchar(5) Primary Key Cust_id Number 7 Primary key
Item_Name Varchar(25) Custname Varchar2 30 Not null
Manufacturer Varchar(15) Permanent_address Varchar2 20 Not less
Color Varchar(15) Postall_address Varchar2 20 than 2000
Price Integer Must between 399 and 4999 Tot_purchase_cost number 7,2
Quantity Integer Not Null

(c). Create a table employee as per following Table Instance Chart: 2


Column Name Empid empname Empaddress empphone empsal deptid
Key Type Primary
Nulls/Unique Not null
DataType number varchar varchar Varchar number varchar
Length 6 20 30 10 9,2 2

d) Write the SQL command to create the table Group1 including the constraints.
Column Name Data Size Constraint Description
Type
Group_code Number 4 Primary key Group Code
Group_Symbol Char 1 Default value ‘’ Symbol of Group
Group_name Varchar 25 Not null Name of the Group
Memberfees Number 8,2 Fees of each member
Noofmembers Number 3 Should not exceed 20 Members in the Group
Dt_Join date Date of Joining

Вам также может понравиться