You are on page 1of 2

DATABASE MANAGEMENT SYSTEMS LAB INTERNAL LAB-1

SECTION: II CSE-3 BATCH-1 DATE:06/01/2017

1.Create the following tables with the mapping given 3. Create the following table with the
below. 5M mapping given below.
a. emp_details(emp_no Number(4) Primary Key, 5M
emp_name Varchar2(20) unique and must be
emp_details(emp_no number(4) Primary Key,
capitals,
DOB Date , emp_name varchar2(20) not
Address varchar2(30) not null, null and accepts only capitals,
Doj date, DOB date ,
mobile_no number(10) unique and not null, Address varchar2(30) not null,
dept_no number(4) foreign key and not null, Doj date,
salary number(10) check above 10000). mobile_no number(10) unique,
salary number(7) not null).
Define user defined constraint names to all
3M constraints
b. dept_details(dept_no Number(4) Primary key, 5*3=15M
dept_name varchar2(10) unique and not null, (i)Display month of DOJ of all employees.
location varchar2(20) unique). (ii)List out the employee names whose salary is
greater than 15000.
Define user defined constraint names to all (iii) Display the total salary of customers with same
constraints joining date.
4*3=12M (iv)Alter the table emp_details to add column city
with data type varchar2 and not null constraint.
(i) Truncate the table dept_details. (v)Drop the column DOB from table emp_details
(ii) Display the structure of the table emp_details.
(iii) Convert the first letter of emp_name into
capitals. 4. Create the following tables with the mapping
(iv) Display the emp_name getting highest salary given below.
4M
a. stu_details(reg_no number(5) Primary key,
2. Create the following table with the mapping given stu_name varchar2(20) not null and starts
below. 5M with capital letter,
Customer (Cust_id number(4) Primary key, DOB date,
Cust_name varchar2(20) not null and Address varchar2(20) not null,
check initial letter capital letter, City varchar2(20) accepts only capital letters)
Addr varchar2(20) , 4M
ph_no number(10) unique and not null, b. mark_details(reg_no number(5) foreign key ,
pan_no unique and not null mark1 number(3) not null,
city varchar2(20) not null). mark2 number(3) not null,
Define user defined constraint names to all mark3 number(3) not null,
constraints total number(4) not null)
5*3=15M
(i)Delete the row where cust_name=NANCY. Define user defined constraint names to all
(ii)Update the phone_no where constraints
Cust_name=MATHIK. 4*3=12M
(iii)Display the details of a customer named (i) Alter the table mark_details to add a column
LITHUANA average with data type as long.
(iv)Display the count of customers who are lived in (ii) Display the name of the student who has got total
Chennai city marks 200
(v) Display the total number of customers of each (iii) Drop the column address from the table
city stu_details.
(iv) Update average marks in table
DATABASE MANAGEMENT SYSTEMS LAB INTERNAL LAB-1
SECTION: II CSE-3 BATCH-1 DATE:06/01/2017

6. Create the following table with the


mapping given below.
4M
5. Create the following table with the
a.Administration(employee_salary number (7) not
mapping given below.
null,
5M
development _cost number(10) must be greater than
Product_master(product_name varchar2(10) unique 10000,
and not null , fund_amount number(10),
product_no number(4) Primary key, turn_over number(10) ,
purchase_prize number(5) not null, bonus number(4))
sell_prize number(5) not null, 4M
b.Emp_details(emp_no number (5) primary key ,
profit number(5) must be minimum 1000,
emp_name varchar2(20) notnull,
quantity number(4) ) DOB date,
Address varchar2(20),
Define user defined constraint names to all Doj date not null,
constraints 5*3=15M mobile_no number(10) unique,
(i)Change the purchase_prize into 551 for the dept_no number(5),
product_no pd3. salary number(10) not null).
(ii)Delete all products from product_master where Define user defined constraint names to all
the Quantity is equal to 40. constraints 4*3=12M
(iii)Find the product no & product name of the (i)Calculate the total and average salary amount of
product which have a purchase amount equal to the administration table.
Rs.5500 (ii)Display total salary spent for employees.
(iv) Display the product _name which has highest (iii)Display joining year of each employee
(iv)Drop the column dept_no from Emp_details
profit.
(v) Display the maximum and minimum Profit details
from the table

You might also like