Professional Documents
Culture Documents
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