0% found this document useful (0 votes)
35 views3 pages

Bca 176

The document outlines the Practical-VI DBMS Lab course for the BCA program at USICT, detailing learning objectives, course outcomes, and a list of practical assignments. Students will learn SQL, RDBMS concepts, and how to design and manipulate databases through various practicals involving core and application-based tasks. The course emphasizes hands-on experience with SQL commands, database design, and data retrieval techniques.

Uploaded by

Manmeet Singh
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
35 views3 pages

Bca 176

The document outlines the Practical-VI DBMS Lab course for the BCA program at USICT, detailing learning objectives, course outcomes, and a list of practical assignments. Students will learn SQL, RDBMS concepts, and how to design and manipulate databases through various practicals involving core and application-based tasks. The course emphasizes hands-on experience with SQL commands, database design, and data retrieval techniques.

Uploaded by

Manmeet Singh
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 3

Handbook of BCA programme offered by USICT at Affiliated Institution of the University.

Course Code: BCA 176 L T/PC


Course Name: Practical-VI DBMS Lab 0 4 2

LEARNING OBJECTIVES:

The course is to provide the basics of SQL. To understand RDBMS and construct queries using SQL to design a
database and manipulate data in it.

PRE-REQUISITES: NIL

COURSE OUTCOMES:
After completion of this course, the learners will be able to:

CO # Detailed Statement of the CO BT Level Mapping to PO #

CO1 Understand the structure and design of relational databases. BT2 PO3

CO2 Write DDL statements in SQL to create, Modify and remove BTL1, BTL3,
PO3, PO5
database objects BTL4

CO3 Use constraints for the database BTL1, BTL2,


PO3,PO5
BTL3

CO4 Write DML statements in SQL to insert, Modify and remove data PO3,PO5
BTL4
from database

CO5 Write SQL statements to retrieve data based on the conditions BTL1, BTL2, PO3,PO5
provided by the user BTL3

CO6 Use index and Views in database BTL2 PO3,PO5

CO7 Use structured query language (SQL) to an intermediate/advanced


BTL5, BTL6 PO4
level

List of Practicals
S. No. Detailed Statement Mapping to
CO #
Core Practicals (Implement All the mentioned practicals )

The following are two suggestive databases. The students may use any one or both databases for their core
practicals. However, the instructor may provide any other databases for executing these practical.
1. COLLEGE DATABASE:

STUDENT (USN, SName, Address, Phone, Gender)


SEMSEC (SSID, Sem, Sec)
CLASS (USN, SSID)
SUBJECT (Subcode, Title, Sem, Credits)
IAMARKS (USN, Subcode, SSID, Test1, Test2, Test3, FinalIA)

2.COMPANY DATABASE:

EMPLOYEE (SSN, Name, Address, Sex, Salary, SuperSSN, DNo)


DEPARTMENT (DNo, DName, MgrSSN, MgrStartDate)
DLOCATION (DNo,DLoc)
PROJECT (PNo, PName, PLocation, DNo)
WORKS_ON (SSN, PNo, Hours)
Draw an E-R diagram from given entities and their attributes
1 CO1
2 Convert the E-R diagram into a Relational model with proper constraints. CO1

Implemented from Academic Session 2021-22. Page 59 of 120


Handbook of BCA programme offered by USICT at Affiliated Institution of the University.

Write queries to execute following DDL commands : CO2


CREATE :Create the structure of a table with at least five columns
ALTER:Changethesizeofa particular column.
3
Add a new column to the existing table.
Remove a column from the table.
DROP: Destroythetablealongwithitsdata.
Write queries to execute following DML commands : CO4
4 INSERT: Insertfiverecordsineachtable.
UPDATE: Modify data in single and multiple columns in a table
DELETE: Delete selective and all records from a table
Write queries to execute following DML command : CO5
SELECT: Retrievetheentirecontentsofthetable.
Retrievetheselective contents (based on provided conditions) from a table.
5
Retrieve contents from a table based on various operators i.e. string operators, logical operators
and conditional operators,Boolean operators.
Sort the data in ascending and descending order in a table on the basis of one column or more
than one column.
Create table using following integrity constraints: CO3
Primary Key
Unique Key
6 Not Null
Check
Default
Foreign Key
Write queries to execute following Aggregate functions CO7
7 Sum,Avg,Count,Minimum and Maximum value of a numeric column of a table using aggregate
function
8 Retrieve data from a table using alias names . CO5
9 Retrieve data of a table using nested queries. CO5
Retrieve data from more than one table using inner join, left outer, right outer and full outer CO5
10
joins
11 Create view from one table and more than one table. CO6
12 Create index on a column of a table. CO6

Application Based Practicals


Consider the Insurance company’s Database given below. The primary keys are underlined and CO7
the data typesare specified.
PERSON(driver_id# : string, name : string, address : string)
CAR(regno : string, model : string, year : int)
ACCIDENT(report_number : int, acc_date : date, location : string)
OWNS(driver_id# : string, regno : string)
PARTICIPATED(driver_id# : string, regno : string, report_number : int, damage_amount
:number(10,2) )
(i) Create the above tables by properly specified the primary key and the foreign key
13 (ii) Enter at least five tuples for each relation
(iii) Demonstrate how you can
a. Update the damage amount for the car with a specific regno, the accident with
report number 12 to 25000.
b. Add a new accident to the database.
(iv) Find the total number of people who owned cars that were involved in accident
in2002.
(iv) Find the number of accident in which cars belonging to a specific models were
involved

Consider the following schema of a library management system.Write the SQL queries for the CO7
questions given below;
14 Student(Stud_no : integer, Stud_name: string)
Membership(Mem_no: integer, Stud_no: integer)
Book_(book_no: integer, book_name:string, author: string)

Implemented from Academic Session 2021-22. Page 60 of 120


Handbook of BCA programme offered by USICT at Affiliated Institution of the University.

lss_rec_(iss_no:integer, iss_date: date, Mem_no: integer, book_no: integer)


(i) Create the tables with the appropriate integrity constraints
(ii) Insert around 10 records in each of the tables
(iii) Display all records for all tables
(iv) List all the student names with their membership numbers
(v) List all the issues for the current date with student and Book names
(vi) List the details of students who borrowed book whose author is Elmarsi & Navathe
(vii) Give a count of how many books have been bought by each student
(viii) Give a list of books taken by student with stud_no as 1005
(ix) Delete the List of books details which are issued as of today
(x) Create a view which lists out the iss_no, iss _date, stud_name, book name
Use the relations below to write SQL queries to solve the business problems specified. CO7
CLIENT (clientno#,name, client_referred_by#)
ORDER (orderno#, clientno#, order_date, empid#)
ORDER_LINE (orderno#, order line number#, item_number#, no_of_items, item_
cost,shipping_date)
ITEM (item_number#, item_type, cost)
EMPLOYEE (empid#, emp_type#, deptno, salary, firstname, lastname)
Notes:
a. Column followed by # is the primary key of the table.
b. Each client may be referred by another client. If so, the client number of the referring
client is stored in referred_by.
c. The total cost for a particular order line = no_of_items * item_cost.c.

Write queries for the following


(i) Create all the above tables.
(ii) Insert at least five records.
(iii) Display all the rows and columns in the CLIENT table. Sort by client name
in reverse alphabetical order.
(iv) Display the item number and total cost for each order line (total cost = no of items X
15 item cost). Name the calculated column TOTAL COST.
(v) Display all the client numbers in the ORDER table. Remove duplicates.
(vi) Display the order number and client number from the ORDER table. Output the
result in the format. Client <clientno> ordered <orderno>
(vii) Display full details from the ORDER_LINE table where the item number is (first
condition) between 1 and 200 (no > or < operators) OR the item number is greater
than1000 AND (second condition) the item cost is not in the list 1000, 2000, 3000 OR
the order number is not equal to 1000.
(viii) Display the client name and order date for all orders.
(ix) Repeat query (6) but also display all clients who have never ordered anything.
(x) Display the client name and order date for all orders using the join keywords.
(xi) Display the client name and order date for all orders using the JOIN method.
(xii) Display the client number, order date and shipping date for all orders where the
shipping date is between three and six months after the order date.
(xiii) Display the client number and name and the client number and name of the person
who referred that client.
(xiv) Display the client name in upper case only and in lower case only.
(xv) Display the second to fifth characters in each client name.

Note:
1. In total 15 practicals to be implemented.
2. This is a suggestive list of practicals. However, the instructor may add or change any other database for executing
queries as per the requirement.
REFERENCEBOOKS:

RB1. Abraham Silberschatz, Henry Korth, S. Sudarshan, “Database Systems Concepts”, 6 th Edition,
McGraw Hill, 2010.
RB2. Jim Melton, Alan Simon, “Understanding the new SQL: A complete Guide”, Morgan Kaufmann
Publishers, 1993.

Implemented from Academic Session 2021-22. Page 61 of 120

You might also like