Professional Documents
Culture Documents
Updated ADBMS Practical IA
Updated ADBMS Practical IA
Updated ADBMS Practical IA
Program: MCA
Subject: Advance Database Management System – Practical
Course Code: DCA6131
Maximum Marks: 70
Practical Assignment start date: 16/09/2021
Practical Assignment submission date 30/09/2021
Problem Statement 1
Exercise Objective: The objective of this exercise is to enable you to understand SQL
relational concepts – Primary Key and Foreign Key and the concept of normalization
Problem Statement 1: Consider the Insurance database given below. The primary keys
are underlined, and the data types are specified:
Create the above tables by properly specifying the primary keys and the foreign keys.
Enter at least five tuples for each relation. Display the details of the people and their
cars that were involved in accidents in certain years (say 2008).
Instructions
- Avoid too many & unnecessary usage of white spaces (newline, spaces, tabs, …)
Hints/ Tips:
Step – 1: Start
Step – 2: Create Database, tables using CREATE commands with its essential attributes.
Step – 3: Insert the values using INSERT INTO statements. (Insert the suitable values
(tuples) so that queries are executed correctly.)
Step – 4: Execute different Commands and extract information from the table. (Hint: use
keywords like PRIMARY, FOREIGN, FROM, WHERE, DISTINCT, MINUS, GROUP BY,
ORDERBY etc. You can use suitable operators like AND & OR for certain conditions to
meet)
Expected Output:
Creation of database, tables with the use of primary keys, foreign keys and its
extraction/modification of required data through SQL commands.
Name = DB_rollnumber
Username = rollnumber
password = rollnumber
Port = 3306
Problem Statement 2
Exercise Objective: The objective of this exercise is to enable you to understand and use
SQL relational concepts along with the concepts of Joins.
Create the above tables by properly specifying the primary keys and the foreign keys.
Enter at least five tuples for each relation.
Illustrate inner join, Left join, right join, by joining STUDENT and ENROLL table.
And also List any department that has all its adopted books published by a specific
publisher.
Instructions
- Use descriptive variables in your PL/SQL code (Name of the variables shou ld show their
purposes).
- Avoid too many & unnecessary usage of white spaces (newline, spaces, tabs, …)
Hints/ Tips:
Step – 1: Start
Step – 2: Create Database, tables using CREATE commands with its essential attributes.
Step – 3: Insert the values using INSERT INTO statements. (Insert the suitable values
(tuples) so that queries are executed correctly.)
Step – 4: Execute different Commands and extract information from the table. (Hint: use
keywords like PRIMARY, FOREIGN, FROM, WHERE, DISTINCT, MINUS, GROUP BY,
ORDERBY etc. You can use suitable operators like AND & OR for certain conditions to
meet)
Expected Output:
Creation of database, tables with the use of primary keys, foreign keys and its
extraction/modification of required data through SQL commands.
Name = DB_rollnumber
Username = rollnumber
password = rollnumber
Port = 3306
Problem Statement 3
Exercise Objective: The objective of this program is to enable you to use the Pl/SQL block.
Problem Statement 3: Write a PL/SQL code block that will calculate the sum of two
given numbers x = 5 and y = 9.
Instructions
- Write comment to make your PL/SQL code readable.
- Use descriptive variables in your PL/SQL code (Name of the variables shou ld show their
purposes).
- Avoid too many & unnecessary usage of white spaces (newline, spaces, tabs, …)
Hints/ Tips:
Expected Output
declare
-- declare variable x, y
-- and z of datatype number
begin
--Assign values to variables
z:=x+y;
-- Print the Result
dbms_output.put_line(………….);
end;
/
Expected Output: Display the Sum
Exercise Objective: The objective of this exercise is to enable you to use while loop in
PL/SQL.
- Use descriptive variables in your PL/SQL code (Name of the variables shou ld show their
purposes).
- Avoid too many & unnecessary usage of white spaces (newline, spaces, tabs, …)
Hints/ Tips:
DECLARE
-- declare variable x
BEGIN
num:= 243;
rev:=0;
WHILE num>0 LOOP
-- Execution statements
END LOOP;
DBMS_OUTPUT.PUT_LINE(………………………….);
END;
Exercise Objectives: The objective of this exercise is to enable you to make use of
If construct in PL/SQL.
Problem Statement 5: Write a program to find greatest of three given numbers a= 10,
b= 12, c= 5.
Instructions
- Use descriptive variables in your PL/SQL code (Name of the variables shou ld show their
purposes).
- Avoid too many & unnecessary usage of white spaces (newline, spaces, tabs, …)
Hints/ Tips:
Declare
-- declare variable a,b,c
begin
dbms_output.put_line('a='||a||' b='||b||' c='||c);
if condition AND condition
then
dbms_output.put_line('a is greatest');
else
…………………
end if;
end;