Menu - 634641184925996250 - CS4106 Database Management Systems Lab Assignment
Menu - 634641184925996250 - CS4106 Database Management Systems Lab Assignment
CS 4106
LAB ASSIGNMENT
(1)
(2)
(i)
(ii)
FIND THE NAME & DEPT NAME WHO DRAWS THE SECOND MAXIMUM SALARY.
(iii)
(iv)
(v)
(3)
(i)
FIND THE CUSTOMER NAME WHO HAS BOTH DEPOSIT & TAKEN LOAN FROM
"UCO" BRANCH.
(ii)
FIND CN, STREET & CITY WHO HAS DEPOSIT BUT NOT TAKEN LOAN FROM "UCO"
(iii)
(iv)
REMOVE ALL THE RECORDS FROM BRANCH TABLE LOCATED IN BRANCH WHERE
CITY IS "JAMSHEDPUR".
(v)
FIND THE NAME OF THE CUSTOMER WHO HAS DEPOSIT IN HIGHEST ASSET
BRANCH.
4.
TABLE CLIENT_MASTER
-----------------------------------------------------------------------COLUMN NAME
DATA TYPE
SIZE
-----------------------------------------------------------------------CLIENT_NO
VARCHAR2
NAME
VARCHAR2
20
ADDRESS1
VARCHAR2
30
ADDRESS2
VARCHAR2
30
CITY
VARCHAR2
15
PINCODE
NUMBER
STATE
VARCHAR2
15
BAL_DATE
NUMBER
10,2
INSERT THE FOLLOWING DATA INTO THEIR RESPECTIVE TABLE:-DATA FOR CLIENT_MASTER TABLE
-------------------------------------------------------------------------------------------------------------CLIENT_NO
NAME
CITY
PINCODE
STATE
--------------------------------------------------------------------------------------------------------------C0001
ABHISHE
MUMBAI
400054
MAHARASTRA
C0002
RADHA
CHENNAI
780001
TAMILNADU
C0003
DEEPAK
MUMBAI
400057
MAHARSTRA
C0004
RITIKA
MUMBAI
400056
MAHARSTRA
C0005
RAVI
DELHI
100001
DELHI
C0006
BIMAN
KOLKATA
700024
W.B
(ii)
(iii)
RETRIEVE THE LIST OF NAMES & THE CITIES OF ALL THE CLIENTS
(iv)
(v)
(vi)
(vii)
(viii)
6. Create Table name client_master data_types are client no.(p.k.), name (not null), address, city, pincode, state,
bal_date
1. Find name of all client having 'a' as tyhe second leter in their names
2.
Find out the clients who stay in a city whose second letter is 'a'
(i)find the names and cities of residence of all employees who work for first bank corporation
(ii)Find the names,street address and cities of residence of all employees who work for first bank corporation and
earn more than $10000
(iii)Find all employees in the database who do not work for first bank corporation
(iv)Find all employees in database who earn more than each employees of small bank corporation
(v)Assume that the companies may be located in several cities .Find all companies located in every city in which
small bank corporation is located.
(vi)Find the company that has the most employees
(vii)Find those companies whose employees earn a higher salary,on average,than the average salary at first bank
corporation.
9.Create an employee
database(EN,EC,DNO,DN,SALARY,COMMI_ON_SALARY,JOB_TYPE,DATE_OF_JOIN) perform the
following quries:--a.select all information from emp
b.List all emp having salary between 2000 to 10000
c.List dno and DN in Dno order.
d.Display different job types
e.List names and salaries all clerks in dept 20
f.Display all emp with Dr in their names.
g.Display all employees hired during 2005
h.Display names,salary and commission of all employees whose monthly salary is greater than their commission.
Works(empid,did,totaltime,projectname,hours)
Dept(Dname,did,budget,Mgrid)solve the following quries:---
a.List the names and ages of each employees who works in both H/W and S/W dept
b.Find the Mgrid of managers who manage only dept with budget greater than 100000
c.Find ename of mgrs who manage the dept with largest budget
d.For each dept with more than 20 emps,print the did together with the no of employees that work in that dept
e.Find the names of all emps ,who work in same dept as theX
f.List the name of emps who have no dept
g.List the names of emps who have 2 or more dept
h.Insert integrity constraint(domain key,foreign key,& check constraint)or assertion to ensure the following
requirement:--i.employees must make a min salary of Rs 2000/-.define a table constraint on Emp
j.Every manager must be an employee
k.A manager must have a higher salary than any employee he/she manages
l.Define a table constraint on dept to ensure that all manager have age>30.
11.Using the following inbuilt functions while retrieving information from any table.
(a)length(b)substr(c)replace(d)ltrim(e)rtrim(f)lpad(g)stddev(h)vsize(i)initcap(j)variance
12.write SQL statements for the following:-a.Convert a char to its ASCII value
b.Translate a numeric value into a string value
c.Convert default dates to strings
d.Make a outer join of two tables