1140
1140
1140
Look forward,
learn modern
knowledge, and
do not waste
time in studies
of old subjects of
no values.
Lab Manual
B.Sc. (CA)
SEMESTER - III
Editor:
Dr. Aasim Zafar
COURSE DESCRIPTION
This assignment on DBMS is designed for the students of B.Sc.
(Computer Application), IV-Semester to learn the concepts of DBMS.
DBMS is actually system software that enables a user to create and
maintain a database. It facilitates the process of defining,
constructing, manipulating and sharing databases among various
users.
CONTENT
This Lab assignment course is designed to help students to
create database and apply PL/SQL to manipulate the database.
Several live scenarios have been included in the assignment to
design E-R Diagram and subsequently create database. Students are
supposed to write queries for creating, retrieving and manipulating
the database. This course is indented to develop a deep
understanding of various query languages such as DDL, DCL, DML, PL
OBJECTIVES
After completing this Lab assignment, the students should be able to:
OUTCOMES
After completing this course, the students would be able to:
PAGE NO.
SIGNATURE OF THE
PROBLEMS WITH DESCRIPTION TEACHER WITH DATE
1#
1 2#
3#
1#
2 2#
3#
1#
3 2#
3#
Note: The students should use Header and Footer mentioning their roll no. & name in footer and page no in header.
WEEK #1
OBJECTIVES
OUTCOMES
PROBLEMS
a) Authors of papers are uniquely identified by e-mail id. First and last
names are also recorded.
b) Each paper is assigned a unique identifier by the system and is described
by a title, abstract, and the name of the electronic file containing the
paper.
c) A paper may have multiple authors, but one of the authors is designated
as the contact author.
d) Reviewers of papers are uniquely identified by e-mail address. Each
reviewer‟s first name, last name, phone number, affiliation, and topics of
interest are also recorded.
e) Each paper is assigned between two and four reviewers. A reviewer rates
each paper assigned to him or her on a scale of 1 to 10 in four categories:
technical merit, readability, originality, and relevance to the conference.
Finally, each reviewer provides an overall recommendation regarding each
paper.
f) Each review contains two types of written comments: one to be seen by
the review committee only and the other as feedback to the author(s).
Design ER diagram and construct database for the above. Give logical
reasoning for the database design.
WEEK #2
OBJECTIVES
OUTCOMES
PROBLEMS
OBJECTIVES
OUTCOMES
PROBLEMS
OBJECTIVES
To learn to write queries for retrieving, updating and deleting the records.
To learn to alter table structure, delete and rename table.
OUTCOMES
PROBLEMS
1# Write the SQL queries for the following based on week #3 tables:
To learn how o write queries for creating tables with constraints and
inserting and retrieving the records.
To learn to add columns to table.
OUTCOMES
PROBLEMS
CATALOG (Book-id: int, title: string, Publisher-id: int, Category-id: int, Year:
int, Price: int)
a) Create above tables and mention primary keys and foreign keys.
b) Insert at least five relevant records in each of the created relations.
c) Write the following SQL queries based on the created Database:
i) Retrieve details of the authors who have authored 1 or more books.
ii) Retrieve details of the books whose price is greater than the average
price of the books in the catalog and the year of publication are after
2010.
iii) Retrieve details of the books which have more than 1 author.
iv) Retrieve details of publishers associated with author “John”.
v) Demonstrate how you increase the price of books published by a
specific publisher by 10%.
d) Write a SQL query to add two more columns, Association and
Qualification in AUTHOR table.
WEEK #8–9
OBJECTIVES
OUTCOMES
PROBLEMS
a) Create the above tables and mention primary keys and the foreign keys
b) Insert at least five relevant records in each of the created relations.
c) Write following SQL queries based on created Database:
i) Retrieve names and cities of all the clients.
ii) Retrieve the available products.
iii) Find the names of all clients having „a‟ as the second letter in their
names.
iv) List all the clients who are located in ALIGARH.
v) Find the products whose selling price is greater than 2000 and less
than orequal to 5000.
vi) List the products in sorted order of their description.
WEEK #10–11
OBJECTIVES
OUTCOMES
PROBLEMS
University
Department
Program
Course
Syllabus
Faculty(Teacher)
a) Create above tables and mention primary keys and foreign keys. Also
create secondary index for each table.
b) Insert at least 5 relevant records in each of the created tables.
c) Write following SQL queries based on Database created in Question
No. 8:
i) List of Universities situated at Delhi.
ii) List of all Departments of AMU.
iii) Find the location of JNU.
iv) List of all Programs run by University of Jammu.
v) List of Universities that run Program "MCA".
vi) List of Courses of "MCA" run by AMU.
vii) List of Faculties specialized in "Information Security" across
different universities.
viii)Syllabus of "Computer Architecture" of different Universities.
ix) List of all faculties of Department of Computer Science of Delhi
University.
x) Find the University which has maximum Departments.
WEEK #12
OBJECTIVES
OUTCOMES
PROBLEMS
OUTCOMES
PROBLEMS
Create a Cursor Emp_Cursor that fetches the record of employee and their
salary are incremented according to grade such as for Asst prof, the salary
increment is 10000, for Associate Prof 20,000 and for Professor 30,000.
OUTCOMES
PROBLEMS
(EMP_ID,EMP_NAME,EMP_DOB,EMP_SAL,EMP_GRADE,EMP_DNO) and an
EMPLOYEE_LOG table with columns (EMP_ID,EMP_NAME,EMP_DOB,
EMP_PRE_GRADE,EMP_PRE_SAL). EMP_GRADE contains value like
„A‟,‟B‟,‟C‟,‟D‟. Next solve the following:
2# Write a PL-SQL cursor to find second highest salary from EMPLOYEE table.
(DEPT_NO,DEPT_NAME,DEPT_LOC,DEPT_MGRID).
a) Write a PL/SQL block that selects the maximum department number in the
department table and store it in a variable and print the results to screen.
b) Create a PL/SQL block to insert a new department record into the
Departments table. Use maximum dept number fetched from above and
adds 10 to it.
c) Create a PL/SQL Block to delete the department no. 10.Print to the screen
the number of rows affected.
d) Write a Cursor to find MGRID of Departments located in “Mumbai”.
a) Write a PL/SQL block which accepts employee number and finds the
average salary of the employees working in the department where that
employee works. If his salary is more than the average salary of his
department, then display message that "employee‟s salary is more than
average salary" else display "employee‟s salary is less than average salary"
b) Write a PL/SQL block which displays the department name, total no of
employees in the department, average salary of the employees in the
department forall the departments from department 10 to department 40
in the Department table. If no employee is working in the department,then
display a message"No employees are working in that department".
Department of Computer Science
Aligarh Muslim University Aligarh