CE246 DBMS Practical List - 2022-23
CE246 DBMS Practical List - 2022-23
CE246 DBMS Practical List - 2022-23
Practical List
Instructions:
Practical Format: Aim, Practical Implementation, Output (Screenshot), Conclusion.
CO1 Apply the concepts of engineering i.e collecting data, organize the data in the systematic form, and arrange the data in a computational way and applying
mathematics formation.
CO2 Analyze how data are stored and maintained using data models. Ready to assimilate the concept of data abstraction and design queries using SQL. Identify
how data is represented in the relational model and create relations using SQL language
CO3 Identify and evaluate the constructs in the E-R model and issues involved in developing an E-R diagram. Convert an E-R diagram into a relational database
schema. Declare and enforce integrity constraints on database using a state-of art RDBMS.
CO4 Produce aggregate operators to write SQL queries which are not expressible in relational algebra. “More mathematical” notation may apply and also used in
research and other venues. Combining these concepts allows production of sophisticated queries.
Decompose un-normalized tables into normalized compliant tables. Design and implement a normalize database schema for a given problem-domain.
CO5 Produce strategies to minimize risks of security breaches in a range of network environments and data storage systems. Compute retrieval time and
concluding with suitable indexing technique.
Compare transactions and their properties with (ACID) and without ACID. Apply locking protocol to ensure isolation. Develop logging technique to ensure
CO6 atomicity and durability. Design a logical view which can be used for analytical tasks. Develop practical experience of the design and implement scalable,
secure
Sr.
Aim of the Practical Hrs. Cos
No.
1 To Demonstrate DDL-create and DML-insert commands.
(i) Create tables according to the following definition.
● CREATE TABLE DEPOSIT (ACTNO VARCHAR2(5), CNAME VARCHAR2(18), BNAME VARCHAR2(18), AMOUNT
NUMBER (8,2), ADATE DATE);
● CREATE TABLE BRANCH (BNAME VARCHAR2(18), CITY VARCHAR2(18));
● CREATE TABLE CUSTOMERS (CNAME VARCHAR2(19), CITY VARCHAR2(18));
● CREATE TABLE BORROW (LOANNO VARCHAR2(5), CNAME VARCHAR2(18), BNAME VARCHAR2(18),
AMOUNT NUMBER (8,2));
(ii) Insert the data as shown below.
DEPOSIT
ACTNO CNAME BNAME AMOUNT ADATE
100 ANIL VRCE 1000.00 1-MAR-95
101 SUNIL AJNI 5000.00 4-JAN-96
102 MEHUL KAROLBAGH 3500.00 17-NOV-95
104 MADHURI CHANDI 1200.00 17-DEC-95
105 PRMOD M.G.ROAD 3000.00 27-MAR-96
106 SANDIP ANDHERI 2000.00 31-MAR-96
107 SHIVANI VIRAR 1000.00 5-SEP-95 4 CO2
108 KRANTI NEHRU PLACE 5000.00 2-JUL-95
109 MINU POWAI 7000.00 10-AUG-95
BRANCH CUSTOMERS
BNAME CITY CNAME CITY
VRCE NAGPUR ANIL CALCUTTA
AJNI NAGPUR SUNIL DELHI
KAROLBAGH DELHI MEHUL BARODA
CHANDI DELHI MANDAR PATNA
DHARAMPETH NAGPUR MADHURI NAGPUR
M.G.ROAD BANGLORE PRAMOD NAGPUR
ANDHERI BOMBAY SANDIP SURAT
VIRAR BOMBAY SHIVANI BOMBAY
NEHRU PLACE DELHI KRANTI BOMBAY
POWAI BOMBAY NAREN BOMBAY
BORROW
LOANNO CNAME BNAME AMOUNT
201 ANIL VRCE 1000.00
206 MEHUL AJNI 5000.00
311 SUNIL DHARAMPETH 3000.00
321 MADHURI ANDHERI 2000.00
375 PRMOD VIRAR 8000.00
481 KRANTI NEHRU PLACE 3000.00
2 Create the below given table and insert the data accordingly.
Create Table Job (job_id, job_title, min_sal, max_sal)
COLUMN NAME DATA TYPE
job_id Varchar2(15)
job_title Varchar2(30)
min_sal Number(7,2)
max_sal Number(7,2)
Create table Employee (emp_no, emp_name, emp_sal, emp_comm, dept_no, l_name, dept_name, job_id, location,
manager_id, hiredate)
COLUMN NAME DATA TYPE
emp_no Number(3)
emp_name Varchar2(30)
emp_sal Number(8,2)
emp_comm Number(6,1)
dept_no Number(3)
l_name Varchar2(30)
dept_name Varchar2(30)
job_id Varchar2(15)
location Varchar2(15)
manager_id Number(5)
hiredate Date
Create table deposit(a_no,cname,bname,amount,a_date). 4 CO2
COLUMN NAME DATA TYPE
a_no Varchar2(5)
cname Varchar2(15)
bname Varchar2(10)
amount Number(7,2)
a_date Date
Create table borrow (loanno, cname, bname, amount).
COLUMN NAME DATA TYPE
loanno Varchar2(5)
cname Varchar2(15)
bname Varchar2(10)
amount Varchar2(7,2)
Insert following values in the table Employee.
emp_n emp_ emp_ emp_ dept l_ dept_ Manage Hire
job_id location
o name sal comm _no name name r_id date
102 Snehal 1600 300 25 gupta data science lec las vegas 14-mar-96
103 Adama 1100 0 20 machine
wales mk_mgr ontario 105 30-nov-95
learning
8 Manipulating Data
(1) Give 10% interest to all depositors.
(2) Give 10% interest to all depositors having branch vrce
(3) Give 10% interest to all depositors living in nagpur and having branch city bombay.
(4) Write a query which changes the department number of all employees with empno 7788’s job to employee
7844’current department number.
(5) Transfer 10 Rs from account of anil to sunil if both are having same branch.
4 CO3
(6) Give 100 Rs more to all depositors if they are maximum depositors in their respective branch.
(7) Delete depositors of branches having number of customers between 1 to 3.
(8) Delete deposit of vijay.
(9) Delete borrower of branches having average loan less than 1000.
1. Create a package specification and package body called EMP_PACK that contains your NEW_EMP procedure as a
public construct, and your VALID_DEPTID function as a private construct. (You can save the specification and body 2 CO5
into separate files.)
2. Invoke the NEW_EMP procedure, using 40 as a department number. Because the dept_no 40 does not exist in the
DEPT table, you should get an error message as specified in the exception handler of your procedure.
3. Invoke the NEW_EMP procedure, using an existing department ID 80.
18 Case Study:
CO1
1 Download and compile PostgreSQL, and open in Eclipse, using instructions provided here. Physical Storage in CO2
PostgreSQL, Look inside above link for information on file layout, database page layout, and free space map (and lots 2
CO3
more details src/backend/storage/freespace/README) and how PostgreSQL stores oversized attributes using the
TOAST technique. CO4