Open-Ended Lab (OEL) – Database Management Systems Lab
Environment: SQL Server Management Studio (SSMS)
Duration: 1.5 Hours
Instructions: Rabbiya Younas
You are required to design, implement, and query a relational database system based on the
case study provided below. This lab is open-ended, so demonstrate your understanding of
database schema design, data insertion, query writing, and transaction control.
- Chatgpt and internet is allowed
- You should be able to make modifications when required during viva [Without internet]
- Create Complete Report along the way
Case Study: Student Internship System
The university’s career office wants a database system to manage student internship
applications. You are tasked with designing and building this database. Your system should
be capable of storing and managing:
• Students
• Companies
• Internship opportunities
• Applications from students for internships
Requirements and Tasks
1. Design & Create Tables (DDL)
Design and create the following tables with appropriate data types, primary keys, and
foreign key relationships:
• Students: StudentID, Name, Program, CGPA
• Companies: CompanyID, Name, Location
• Internships: InternshipID, Title, Stipend, CompanyID (linked to Companies)
• Applications: AppID, StudentID, InternshipID, Status (Applied/Selected/Rejected),
DateApplied
Use CREATE TABLE, PRIMARY KEY, and FOREIGN KEY constraints.
2. Insert Sample Data
Insert at least 3 to 5 meaningful rows in each of the created tables using INSERT INTO.
3. Write the Following Queries
a. List all students who have applied for internships with a stipend above 15,000
b. Show the number of applications received for each internship title
c. Display the average stipend per company
d. Find students who haven’t applied for any internship
e. Display names of selected students along with their internship title and company name
4. Perform Aggregation
• Show how many students applied for internships at each company
• Show the CGPA-wise count of selected students
5. Create a View –
Create a view that shows the following information:
Student Name, Internship Title, Company Name, Application
Status
6. Implement a Transaction –
Perform the following updates inside a single transaction block:
• Update a student's CGPA
• Update their application status to “Selected”
Use BEGIN TRANSACTION, COMMIT, and ROLLBACK appropriately.
--------------------------------------------- Best Of Luck -----------------------------------------------