All Lab Assignment Kcs-551
All Lab Assignment Kcs-551
[SEM V] CS
LAB ASSIGNMENT-1
(Session: 2023-2024)
DBMS LAB
(KCS-551)
Experiment No. : 1 Name of Faculty (Lab In charge): Mr. Shekhar Srivastava, Mr. Vinayak
Room No.: Lab E-110 Name of Lab Instructor: Ms. Poornima Yadav
References:-
1. Korth, Silbertz, Sudarshan, McGraw Hill, Database System Concepts.
2. Date C J, Addision Wesley, An Introduction to Database Systems.
3. Ivan Bayros, BPB, SQL, PL/SQL, The programming Language of Oracle
DBMS LAB
(KCS-551)
Experiment No. : 2 Name of Faculty (Lab In charge): Mr. Shekhar Srivastava, Mr. Vinayak
Room No.: Lab E-110 Name of Lab Instructor: Ms. Poornima Yadav
(Q1) Write the queries for Data Definition and Data Manipulation Language.
A.) Create the insurance database for following, where the primary keys are underlined. Construct the
following SQL queries for this relational database.
a. Find the total number of people who owned cars that were involved in accidents in 1989.
b. Find the number of accidents in which the cars belonging to “John Smith” were involved.
B.) Create the employee database for following, where the primary keys are underlined. Construct the
following SQL queries for this relational database.
a. Find the names of all employees who work for First Bank Corporation.
b. Find the names and cities of residence of all employees who work for First
Bank Corporation.
References:-
1. Korth, Silbertz, Sudarshan, McGraw Hill, Database System Concepts.
2. Date C J, Addision Wesley, An Introduction to Database Systems.
3. Ivan Bayros, BPB, SQL, PL/SQL, The programming Language of Oracle
DBMS LAB
(KCS-551)
Experiment No. : 3 Name of Faculty (Lab In charge): Mr. Shekhar Srivastava, Mr. Vinayak
Room No.: Lab E-110 Name of Lab Instructor: Ms. Poornima Yadav
(Q1) Write SQL queries using SQL operators and logical operations (=, <,>, etc).
Create the employee database for following, where the primary keys are underlined. Construct the
following SQL queries for this relational database.
References:-
1. Korth, Silbertz, Sudarshan, McGraw Hill, Database System Concepts.
2. Date C J, Addision Wesley, An Introduction to Database Systems.
3. Ivan Bayros, BPB, SQL, PL/SQL, The programming Language of Oracle
DBMS LAB
(KCS-551)
Experiment No. : 4 Name of Faculty (Lab In charge): Mr. Shekhar Srivastava, Mr. Vinayak
Room No.: Lab E-110 Name of Lab Instructor: Ms. Poornima Yadav
(Q1) Write SQL query using character, number, date and group functions.
Create the employee database for following, where the primary keys are underlined. Construct the
following SQL queries for this relational database.
a. Find all employees in the database who earn more than every employee of Small Bank Corporation.
b. Find the company that has the smallest payroll.
c. Find those companies whose employees earn a higher salary, on average, than the average salary at First
Bank Corporation.
References:-
1. Korth, Silbertz, Sudarshan, McGraw Hill, Database System Concepts.
2. Date C J, Addision Wesley, An Introduction to Database Systems.
3. Ivan Bayros, BPB, SQL, PL/SQL, The programming Language of Oracle
DBMS LAB
(KCS-551)
Experiment No. : 5 Name of Faculty (Lab In charge): Mr. Shekhar Srivastava, Mr. Vinayak
Room No.: Lab E-110 Name of Lab Instructor: Ms. Poornima Yadav
Let relations r(R) and s(S) be given. Give an expression in SQL that is equivalent to each of the
following queries.
a. ΠA(r)
b. σB =17 (r)
c. r×s
d. ΠA,F (σC =D(r × s))
B.) Let R = (A,B,C), and let r1 and r2 both be relations on schema R. Give an expression in SQL that is
equivalent to each of the following queries.
a. r1 U r2
b. r1 ∩ r2
c. r1 − r2
d. ΠAB(r1) × ΠBC(r2)
References:-
1. Korth, Silbertz, Sudarshan, McGraw Hill, Database System Concepts.
2. Date C J, Addision Wesley, An Introduction to Database Systems.
3. Ivan Bayros, BPB, SQL, PL/SQL, The programming Language of Oracle
DBMS LAB
(KCS-551)
Experiment No. : 6 Name of Faculty (Lab In charge): Mr. Shekhar Srivastava, Mr. Vinayak
Room No.: Lab E-110 Name of Lab Instructor: Ms. Poornima Yadav
Create the employee database for following, where the primary keys are underlined. Construct the
following SQL queries for this relational database.
a. Assume that the companies may be located in several cities. Find all companies located in every
city in which Small Bank Corporation is located.
b. Give all managers of First Bank Corporation a 10-percent raise.
c. Give all managers of First Bank Corporation a 10-percent raise unless the salary becomes greater
than $100,000; in such cases, give only a 3-percent raise.
References:-
1. Korth, Silbertz, Sudarshan, McGraw Hill, Database System Concepts.
2. Date C J, Addision Wesley, An Introduction to Database Systems.
3. Ivan Bayros, BPB, SQL, PL/SQL, The programming Language of Oracle
DBMS LAB
(KCS-551)
Experiment No. : 7 Name of Faculty (Lab In charge): Mr. Shekhar Srivastava, Mr. Vinayak
Room No.: Lab E-110 Name of Lab Instructor: Ms. Poornima Yadav
A.) Write a PL/SQL block to Check the Given String is Palindrome or Not.
B.) Write a PL/SQL block to Generate Fibonacci Series.
C.) Write a PL/SQL block to find Sum of Digits of a given Number.
References:-
1. Korth, Silbertz, Sudarshan, McGraw Hill, Database System Concepts.
2. Date C J, Addision Wesley, An Introduction to Database Systems.
3. Ivan Bayros, BPB, SQL, PL/SQL, The programming Language of Oracle
DBMS LAB
(KCS-551)
Experiment No. : 8 Name of Faculty (Lab In charge): Mr. Shekhar Srivastava, Mr. Vinayak
Room No.: Lab E-110 Name of Lab Instructor: Ms. Poornima Yadav
Insurance database
person (driver-id, name, address)
car (license, model, year)
accident (report-number, date, location)
owns (driver-id, license)
participated (driver-id, car, report-number, damage-amount)
References:-
1. Korth, Silbertz, Sudarshan, McGraw Hill, Database System Concepts.
2. Date C J, Addision Wesley, An Introduction to Database Systems.
3. Ivan Bayros, BPB, SQL, PL/SQL, The programming Language of Oracle
DBMS LAB
(KCS-551)
Experiment No. : 9 Name of Faculty (Lab In charge): Mr. Shekhar Srivastava, Mr. Vinayak
Room No.: Lab E-110 Name of Lab Instructor: Ms. Poornima Yadav
References:-
1. Korth, Silbertz, Sudarshan, McGraw Hill, Database System Concepts.
2. Date C J, Addision Wesley, an Introduction to Database Systems.
3. Ivan Bayros, BPB, SQL, PL/SQL, The programming Language of Oracle
DBMS LAB
(KCS-551)
Experiment No. : 10 Name of Faculty (Lab In charge): Mr. Shekhar Srivastava, Mr. Vinayak
Room No.: Lab E-110 Name of Lab Instructor: Ms. Poornima Yadav
a) Write a Cursor to display the list of Employees and Total Salary Department wise.
b) To write a Cursor to display the list of employees who are working as a Managers or
Analyst.
c) To write a TRIGGER to ensure that DEPT TABLE does not contain duplicate of null values
in DEPTNO column.
References:-
4. Korth, Silbertz, Sudarshan, McGraw Hill, Database System Concepts.
5. Date C J, Addision Wesley, an Introduction to Database Systems.
6. Ivan Bayros, BPB, SQL, PL/SQL, The programming Language of Oracle