0% found this document useful (0 votes)
30 views23 pages

DBMS Lab Manual 29

The document discusses experiments to be performed on database management systems. It includes creating tables, inserting data, performing queries, joins and aggregations. Functions, subqueries, security and transactions are also discussed among the topics to be covered in the experiments.
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
30 views23 pages

DBMS Lab Manual 29

The document discusses experiments to be performed on database management systems. It includes creating tables, inserting data, performing queries, joins and aggregations. Functions, subqueries, security and transactions are also discussed among the topics to be covered in the experiments.
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 23

FACULTY OF ENGINEERING & TECHNOLOGY

SUBJECT NAME: DBMS


SUBJECT CODE: 203105252
B.Tech: IT Year: 2 Semester: 4

Index
SR. Page no
Experiment Title
Date Of Date Of
NO Marks Sign.
from To Performance Submission

1. To study DDL-create and


DMLinsert commands.

2. Create the below given table


and insert the data accordingly.

3. To perform various data


manipulation commands,
aggregate functions and sorting
concept on all created tables.

4.
To study Single-row functions.

5. Displaying data from Multiple


Tables (join)

6. To apply the concept of


Aggregating Data using Group
functions.

7. To solve queries using the


concept of sub query.

8. Manipulating Data

1
NAME: vura vamsi srinivas
ENROLL NO. : 200303124539
FACULTY OF ENGINEERING & TECHNOLOGY
SUBJECT NAME: DBMS
SUBJECT CODE: 203105252
B.Tech: IT Year: 2 Semester: 4

9. To apply the concept of


security and privileges.

10. to study Transaction control


Commands.

2
NAME: vura vamsi srinivas
ENROLL NO. : 200303124539
FACULTY OF ENGINEERING & TECHNOLOGY
SUBJECT NAME: DBMS
SUBJECT CODE: 203105252
B.Tech: IT Year: 2 Semester: 4

PRACTICAL 1
AIM :To study DDL-create and DML-insert commands.

(i) Create tables according to the following definition.


(1) Create Table Deposit (ACTNO VARCHAR2 (4), CNAME VARCHAR2 (20),
BNAME VARCHAR2 (20), AMOUNT NUMBER (8, 2), ADATE DATE);

(2) Create Table Branch (BNAME VARCHAR2 (20), CITY VARCHAR2 (20));

(3) Create Table Customers (CNAME VARCHAR2 (20), CITY VARCHAR2 (20));

(4) Create Table Borrow (LOANNO VARCHAR2 (4), CNAME VARCHAR2 (20), BNAME
VARCHAR2 (20), AMOUNT NUMBER (8, 2));

(ii) Insert the data as shown below.

3
NAME: vura vamsi srinivas
ENROLL NO. : 200303124539
FACULTY OF ENGINEERING & TECHNOLOGY
SUBJECT NAME: DBMS
SUBJECT CODE: 203105252
B.Tech: IT Year: 2 Semester: 4

Table 1:DEPOSIT

Table 2: BRANCH

Table 3: CUSTOMER

Table 4: BORROW

4
NAME: vura vamsi srinivas
ENROLL NO. : 200303124539
FACULTY OF ENGINEERING & TECHNOLOGY
SUBJECT NAME: DBMS
SUBJECT CODE: 203105252
B.Tech: IT Year: 2 Semester: 4

(iii) From the above given tables perform the following queries:
(1) Describe deposit, branch.

(2) Describe borrow, customers.

(3) List all data from table DEPOSIT.

5
NAME: vura vamsi srinivas
ENROLL NO. : 200303124539
FACULTY OF ENGINEERING & TECHNOLOGY
SUBJECT NAME: DBMS
SUBJECT CODE: 203105252
B.Tech: IT Year: 2 Semester: 4

(4) List all data from table BORROW.

(5) List all data from table CUSTOMERS.

(6) List all data from table BRANCH.

6
NAME: vura vamsi srinivas
ENROLL NO. : 200303124539
FACULTY OF ENGINEERING & TECHNOLOGY
SUBJECT NAME: DBMS
SUBJECT CODE: 203105252
B.Tech: IT Year: 2 Semester: 4

(7) Give name of depositors having amount greater than 10000.

(8) Give name of customers who opened account after date '5-SEP-95.

Practical 2
AIM : Create the below given table and insert the data accordingly.

(i) Create tables according to the following definition.


(1) Create Table job (job_id, job_title, min_sal, max_sal)

7
NAME: vura vamsi srinivas
ENROLL NO. : 200303124539
FACULTY OF ENGINEERING & TECHNOLOGY
SUBJECT NAME: DBMS
SUBJECT CODE: 203105252
B.Tech: IT Year: 2 Semester: 4

(2) Create table employee (emp_no, emp_name, emp_sal, emp_comm, dept_no)

(3) Create table deposit (a_no, cname, bname, amount, a_date).

(4) Create table borrow (loanno, cname, bname, amount).

8
NAME: vura vamsi srinivas
ENROLL NO. : 200303124539
FACULTY OF ENGINEERING & TECHNOLOGY
SUBJECT NAME: DBMS
SUBJECT CODE: 203105252
B.Tech: IT Year: 2 Semester: 4

(ii) Insert the data as shown below.


(1) Insert following values in the table employee.

(2) Insert following values in the table job.

(3) Insert following values in the table deposit.

9
NAME: vura vamsi srinivas
ENROLL NO. :200303124539
FACULTY OF ENGINEERING & TECHNOLOGY
SUBJECT NAME: DBMS
SUBJECT CODE: 203105252
B.Tech: IT Year: 2 Semester: 4

(iii) Perform following queries


(1) Retrieve all data from employee, jobs and deposit.

(2) Give details of account no. and dopened between dates 01-01-12 and 25-07-16

(3) Display all jobs with minimum salary is greater than 40000.

10
NAME: vura vamsi srinivas
ENROLL NO. :200303124539
FACULTY OF ENGINEERING & TECHNOLOGY
SUBJECT NAME: DBMS
SUBJECT CODE: 203105252
B.Tech: IT Year: 2 Semester: 4

(4) Display name and salary of employee whose department no is 120. Give alias name
to name of employee.

(5)Display employee no, name and department details of those employee whose department lies
in (110,120).

(iv) To study various options of LIKE predicate


a. Display all employee whose name start with ‘A’ and third character is ‘a’.

(3) Display name, number and salary of those employees whose name is 5
characters long and first three characters are ‘Ma’.

(4) Display the non-null values of employees and also employee name second
character should be ‘n’ and string should be 5 character long.

(5) Display the null values of employee and also employee name’s third character
should be ‘r’.

11
NAME: vura vamsi srinivas
ENROLL NO. :200303124539
FACULTY OF ENGINEERING & TECHNOLOGY
SUBJECT NAME: DBMS
SUBJECT CODE: 203105252
B.Tech: IT Year: 2 Semester: 4

PRACTICAL 3
AIM: To perform various data manipulation commands, aggregate functions and
sorting concept on all created tables.
(1) List total deposit from deposit.
 Select count(*) from deposit;

(2) Give maximum loan from branch CHANDI.

(3) Count total number of customers

(4) Create table supplier from employee with all the columns.

(5) Delete all the rows from sup1.

12
NAME: vura vamsi srinivas
ENROLL NO. :200303124539
FACULTY OF ENGINEERING & TECHNOLOGY
SUBJECT NAME: DBMS
SUBJECT CODE: 203105252
B.Tech: IT Year: 2 Semester: 4

(6) Delete the detail of supplier whose sup_no is 104.

(7) Rename the table sup2.

(8) Destroy table sup1 with all the data.

(9) Update the value of employee name whose employee number is 105.

13
NAME: vura vamsi srinivas
ENROLL NO. :200303124539
FACULTY OF ENGINEERING & TECHNOLOGY
SUBJECT NAME: DBMS
SUBJECT CODE: 203105252
B.Tech: IT Year: 2 Semester: 4

(10) Give maximum amount from branch andheri.

(11) Count total number of customers

(12) Create table sup1 from employee with first two columns.

(13) Create table sup2 from employee with no data

14
NAME: vura vamsi srinivas
ENROLL NO. :200303124539
FACULTY OF ENGINEERING & TECHNOLOGY
SUBJECT NAME: DBMS
SUBJECT CODE: 203105252
B.Tech: IT Year: 2 Semester: 4

(14) Insert the data into sup2 from employee whose second character should be ‘n’
and string should be 5 characters long in employee name field.

(15) Update the value dept no to 10 where second character of emp. Name is ‘m’.

15
NAME: vura vamsi srinivas
ENROLL NO. :200303124539
FACULTY OF ENGINEERING & TECHNOLOGY
SUBJECT NAME: DBMS
SUBJECT CODE: 203105252
B.Tech: IT Year: 2 Semester: 4

PRACTICAL 4
AIM- To study Single-row functions.

(1) Write a query to display the current date. Label the column Date .

(2) For each employee, display the employee number, job, salary, and salary increased by 15%
and expressed as a whole number. Label the column New Salary

(3) Modify your query no 4.(2) to add a column that subtracts the old salary from the new salary.
Label the column Increase

(4) Write the query that display the employee’s name with the first letter capitalized and all other
letters lowercase, and the length of the names, for all employees whose name starts with J, A,
or M. Give each column an appropriate label. Sort the results by the employee’s last name.

16
NAME: vura vamsi srinivas
ENROLL NO. :200303124539
FACULTY OF ENGINEERING & TECHNOLOGY
SUBJECT NAME: DBMS
SUBJECT CODE: 203105252
B.Tech: IT Year: 2 Semester: 4

(5) Write a query that produces the following for each employee:
<employee name> earns <salary> monthly

(6) Display the name, hire date, number of months employed and day of the week on which the
employee has started. Order the results by the day of the week starting with Monday.

(7) Write a query to calculate the annual compensation of all employees (sal+comm.).

17
NAME: vura vamsi srinivas
ENROLL NO. :200303124539
FACULTY OF ENGINEERING & TECHNOLOGY
SUBJECT NAME: DBMS
SUBJECT CODE: 203105252
B.Tech: IT Year: 2 Semester: 4

Practical 5

AIM- Displaying data from Multiple Tables (join)

(1) Give details of customers SANDEEP.

(2) 5) Give name of customer who are borrowers and depositors and having living city Delhi

(3) Give city as their city name of customers having same living branch.

(4) Give details of customers SANDIP.

18
NAME: vura vamsi srinivas
ENROLL NO. :200303124539
FACULTY OF ENGINEERING & TECHNOLOGY
SUBJECT NAME: DBMS
SUBJECT CODE: 203105252
B.Tech: IT Year: 2 Semester: 4

Practical 6
AIM: To apply the concept of Aggregating Data using Group functions.

1)List total deposit of customers living in city Delhi.

2) Display the highest, lowest, sum, and average salary of all employees. Label the
columns Maximum, Minimum, Sum, and Average, respectively. Round your results to the
nearest whole number.

3) Write a query to display the total salary being paid to each job title, within each
department.

4) Find the average salaries > 2000 for each department without displaying the
respective department numbers.

Practical 7
AIM: To solve queries using the concept of sub query.

19
NAME: vura vamsi srinivas
ENROLL NO. :200303124539
FACULTY OF ENGINEERING & TECHNOLOGY
SUBJECT NAME: DBMS
SUBJECT CODE: 203105252
B.Tech: IT Year: 2 Semester: 4

1) Write a query to display the last name and hire date of any employee in the same
department as SCOTT. Exclude SCOTT.

2)Give name of customers who are depositors having same branch city of mr. sunil.

3)Give deposit details and loan details of customer in same city where pramod is living.

4)Create a query to display the employee numbers and last names of all employees who earn
more than the average salary. Sort the results in ascending order of salary.

20
NAME: vura vamsi srinivas
ENROLL NO. :200303124539
FACULTY OF ENGINEERING & TECHNOLOGY
SUBJECT NAME: DBMS
SUBJECT CODE: 203105252
B.Tech: IT Year: 2 Semester: 4

5)Display the department number, name, and job for every employee in the Accounting
department.

Practical 8
AIM: Manipulating Data.

1)Give 20% interest to all depositors.

21
NAME: vura vamsi srinivas
ENROLL NO. :200303124539
FACULTY OF ENGINEERING & TECHNOLOGY
SUBJECT NAME: DBMS
SUBJECT CODE: 203105252
B.Tech: IT Year: 2 Semester: 4

(2) Give 15% interest to all depositors living in Nagpur and having branch
city Bombay.

(3) Transfer 1000 Rupees from account of Anil to Sunil if both are having
same branch.

(4) Delete depositors of branches having number of customers between 1 to


3.

5) Delete borrower of branches having average loan less than 10000.

22
NAME: vura vamsi srinivas
ENROLL NO. :200303124539
FACULTY OF ENGINEERING & TECHNOLOGY
SUBJECT NAME: DBMS
SUBJECT CODE: 203105252
B.Tech: IT Year: 2 Semester: 4

Name : vura vamsi srinivas


Enroll no : 200303124539
Division : 3B9
Batch : 2
CSE (Al)

23
NAME: vura vamsi srinivas
ENROLL NO. :200303124539

You might also like