BCA III SEM, DBMS LAB MANUAL

DBMS Lab Manual - University of Mysore SEP BCA III SEM

DBMS Lab Manual
University of Mysore SEP BCA III SEM

Overview

  • Semester: III
  • Course Code: CAM32P
  • Course Title: DBMS Lab
  • Course Credits: 02 (0-0-2)
  • Hours/Week: 04
  • Total Contact Hours: 60
  • Formative Assessment Marks: 10
  • Exam Marks: 40
  • Exam Duration: 03

Course Outcomes (COs)

  • CO1: Execute single-line SQL queries and apply group functions effectively.
  • CO2: Perform database operations using DDL, DML, DCL, and TCL commands.
  • CO3: Implement advanced SQL concepts like nested queries and join operations.
  • CO4: Create views and apply table-level locking mechanisms for data control.

Laboratory Program List

Part A

Activity 1: Database: Student (DDL, DML Statements)

Table: Student

NameReg. NoClassMajor
Smith171CS
Brown82CS

Table: Course

Course NameCourse NumberCredit HoursDepartment
Introduction to Computer ScienceCS13104CS
Data StructureCS33204CS
Discrete MathematicsMATH24103MATH
Database Management SystemCS33803CS

Table: Section

Section IdentifierCourse NumberYearInstructor
85MATH241098King
92CS131098Andreson
102CS332099Knuth
112MATH241099Chang
119CS131099Andreson
135CS338099Stone
Page 11 of 50

Table: Grade_Report

Reg. NoSection IdentifierGrade
17112B
17119C
885A
892A
8102B
8135A

Queries

  1. Create Table Using create statement.
  2. Insert rows into individual Tables using insert statement.
  3. Alter table section add new field section and update the records
  4. Delete brown’s grade report.
  5. Drop the table section.
Page 12 of 50

Activity 2: (Select clause, Arithmetic Operators)

Database: Employee - Create the following tables and insert tuples with suitable constraints.

Table: EMPLOYEE

EMPIDFIRSTNAMELASTNAMEHire DateADDRESSCITY
1001GeorgeSmith11-May-0683 First StreetParis
1002MaryJones25-Feb-08842 Vine AveLosantiville
1012SamTones12-Sep-0533 Elm St.Paris
1015PeterThompson19-Dec-0611 Red RoadParis
1016SarathSharma22-Aug-07440 MG RoadNew Delhi
1020MonikaGupta07-Jun-089 BandraMumbai

Table: EMPSALARY

EMPIDSALARYBENEFITSDESIGNATION
1001100003000Manager
100280001200Salesman
1012200005000Director
101565001300Clerk
101660001000Clerk
102080001200Salesman

Queries

  1. Display FIRSTNAME, LASTNAME, ADDRESS, and CITY of all employees living in PARIS
  2. Display the content of the employee table in descending order of FIRSTNAME
  3. Select FIRSTNAME and SALARY of salesmen
  4. Display the FIRSTNAME, LASTNAME, and TOTAL SALARY of all employees where TOTAL SALARY = SALARY + BENEFITS
  5. Count the number of distinct DESIGNATIONs from EMPSALARY
  6. List the employees whose names have exactly 6 characters
  7. Add a new column PHONE_NO to the EMPLOYEE table and update the records
  8. List employee names who have joined before 15-Jun-08 and after 16-Jun-07
  9. Generate salary slip with Name, Salary, Benefits, HRA=50%, DA=30%, PF=12%, and calculate gross salary. Order by gross salary in descending order.
Page 13 of 50

Activity 3: (Logical, Relational Operators)

Database: Library - Create the following tables and insert tuples with suitable constraints.

Table: Books

Book_IdBook_NameAuthor_NamePublishersPriceTypeQuantity
C0001The Klone and ILata KapporEPP355Novel5
F0001The TearsWilliam HopkinsFirst Publ650Fiction20
T0001My First C++Brain & BrookeFirst Publ350Text10
T0002C++ Brainwork'sA.W. RossaineTDH350Text15
F0002ThunderboltsAna RobertsFirst Publ750Fiction50

Table: Issued

Book_IdQuantity_Issued
T00014
C00015
F00012
T00025
F00028

Queries

  1. To show Book name, Author name and price of books of First Publ. publisher.
  2. Display Book id, Book name and publisher of books having quantity more than 8 and price less than 500.
  3. Select Book id, book name, author name of books which is published by other than ERP publishers and price between 300 to 700.
  4. Generate a Bill with Book_id, Book_name, Publisher, Price, Quantity, 4% of VAT “Total”.
  5. Display book details with book id's C0001, F0001, T0002, F0002 (Hint: use IN operator).
  6. Display Book list other than, type Novel and Fiction.
  7. Display book details with author name starts with letter “A”.
  8. Display book details with author name starts with letter “T” and ends with “S”.
  9. Select Book_Id, Book_Name, Author Name , Quantity Issued where Books.Books_Id = Issued.Book_Id.
  10. List the book_name, Author_name, Price. In ascending order of Book_name and then on descending order of price.
Page 14 of 50

Activity 4: (Date Functions)

Database: Lab - Create Following table and insert tuples with suitable constraints.

Table: Equipment Details

No.ItemNameCost PerItemQuantityDate ofPurchaseWarrantyOperational
1Computer30000921/5/0727
2Printer5000321/5/0642
3Scanner8000129/8/0831
4Camera7000213/6/0512
5UPS15000521/5/0814
6Hub8000131/10/0821
7Plotter25000211/1/0922

Queries

  1. To select the ItemName purchase before 31/10/07.
  2. Extend the warranty of each item by 6 months.
  3. Display ItemName , Dateof purchase and number of months between purchase date and present date.
  4. To list the ItemName in ascending order of the date of purchase where quantity is more than 3.
  5. To count the number, average of costperitem of items purchased before 1/1/08.
  6. To display the minimum warranty , maximum warranty period.
  7. To Display the day of the date , month , year of purchase in characters.
  8. To round of the warranty period to month and year format.
  9. To display the next Sunday from the date “07-JUN-96”.
  10. To list the ItemName, which are within the warranty period till present date.
Page 15 of 50

Part B

Activity 5: (Numeric, character functions)

Use Functions for the following operations.
  1. Find the mod of 165,16.
  2. Find Square Root of 5000.
  3. Truncate the value 128.3285 to 2 and -1 decimal places
  4. Round the value 92.7683 to 2 and -1 decimal places.
  5. Convert the string ‘Department’ to uppercase and lowercase.
  6. Display your address convert the first character of each word to uppercase and rest are in lowercase.
  7. Combine your first name and last name under the title Full name.
  8. A) Take a string length maximum of 15 displays your name to the left. The remaining space should be filled with '*'.
  9. Take a string length maximum of 20 displays your name to the right. The remaining space should be filled with '#'.
  10. Find the length of the string ‘JSS College, Mysore’.
  11. Display substring ‘BASE’ from ‘DATABASE’.
  12. Display the position of the first occurrence of character ‘o’ in Position and Length.
  13. Replace string Database with Data type.
  14. Display the ASCII value of ‘ ’ (Space).
  15. Display the Character equivalent of 42.
Page 16 of 50

Activity 6: Database: subject

Create the following table and insert tuples with suitable constraints.

Table: Physics

RegnoNameYearCombination
AJ00325AshwinFirstPCM
AJ00225SwaroopSecondPMCs
AJ00385SarikaThirdPME
AJ00388HamsaFirstPMCs

Table: Computer Science

RegnoNameYearCombination
AJ00225SwaroopSecondPMCs
AJ00296TejasSecondBCA
AJ00112GeethaFirstBCA
AJ00388HamsaFirstPMCs

Queries

  1. Select all students from Physics and Computer Science.
  2. Select student common in Physics and Computer Science.
  3. Display all student details who are studying in the second year.
  4. Display students who are studying both Physics and Computer Science in the second year.
  5. Display the students studying only Physics.
  6. Display the students studying only Computer Science.
  7. Select all students having PMCs combination.
  8. Select all students having BCA combination.
  9. Select all students studying in the third year.
  10. Rename table Computer Science to CS.
Page 17 of 50

Activity 7: (views)

Database: Railway Reservation System. Create the following table and insert tuples with suitable constraints.

Table: Train Details

Train_NoTrain_NameStart_PlaceDestination
RJD16Rajdhani ExpressBangaloreMumbai
UDE04Udhyan ExpressChennaiHyderabad
KKE55Karnataka ExpressBangaloreChennai
CSE3Shivaji ExpressCoimbatoreBangalore
JNS8JanashatabdiBangaloreSalem

Table: Availability

Train_NoClassStart_PlaceDestinationNo_of_seats
RJD16Sleeper ClassBangaloreMumbai15
UDE04First ClassChennaiHyderabad22
KKE55First Class ACBangaloreChennai15
CSE3Second ClassCoimbatoreBangalore8
JNS8Sleeper ClassBangaloreSalem18

Queries

  1. Create a view sleeper to display train number, start place, destination which have sleeper class and perform the following:
    • Insert new record.
    • Update destination='Manglore' where train no='RJD16'.
    • Delete a record which has train no='KKE55'
  2. Create a view detail to display train number, train name, and class.
  3. Create a view total_seats to display train number, start place, use COUNT function on No_of_seats, group by start place and perform the following:
    • Insert new record.
    • Update start place='Hubli' where train no='JNS8'.
    • Delete the last row of the view.
  4. Rename view sleeper to class.
  5. Delete view details.
Page 18 of 50

Activity 8: (group by, having clause)

Database: Bank system - Create the following table and insert tuples with suitable constraints.

Table: Account

Account_NoCust_NameBranch_ID
AE0012856ReenaSB002
AE1185698AkhilSB001
AE1203996DanielSB004
AE1225889RoySB002
AE8532166SowparnikaSB003
AE8552266AnilSB003
AE1003996SaathwikSB004
AE1100996SwarnaSB002

Table: Branch

Branch_IDBranch_NameBranch_City
SB001MalleshwaramBangalore
SB002MG RoadBangalore
SB003MG RoadMysore
SB004JayanagarMysore

Table: Depositor

Account_NoBranch_IDBalance
AE0012856SB00212000
AE1203996SB00458900
AE8532166SB00340000
AE1225889SB002150000

Table: Loan

Account_NoBranch_IDBalance
AE1185698SB001102000
AE8552266SB00340000
AE1003996SB00415000
AE1100996SB002100000
Page 19 of 50

Queries

  1. Display the total number of accounts present in each branch.
  2. Display the total loan amount in each branch.
  3. Display the total deposited amount in each branch in descending order.
  4. Display the maximum and minimum loan amount present in each city.
  5. Display the average amount deposited in each branch for each city.
  6. Display the maximum loan amount in each branch where the balance is more than 25000.
  7. Display the total number of accounts present in each city.
  8. Display all customer details in ascending order of branch ID.
  9. Update the balance to 26000 where Account_No = AE1003996.
  10. Display customer names with their branch name.

Evaluation Scheme

The laboratory program is structured around a comprehensive Evaluation Scheme for Lab Examination specified by the University of Mysore guidelines for the SEP BCA III SEM Curriculum.

Resources & Downloads

Access the complete high-quality lab manual PDF containing precise execution scripts and configurations.

Download Full Lab Manual

Prepared by: Yashavanth K

Founder and CEO of STUDY WITH YASHVANTH

© STUDY WITH YASHVANTH - YK UNIVERSE STUDIOS all rights reserved

Comments

Popular posts from this blog

ABOUT : STUDY WITH YASHVANTH

ABOUT AUTHOR

BCA III SEM, DBMS SYLLABUS & NOTES