1.
File Processing vs DBMS
2. SQL Query
3. Data models
4. Suppose you are given the following requirements for a simple database for the
National Hockey League (NHL):
the NHL has many teams,
each team has a name, a city, a coach, a captain, and a set of players,
each player belongs to only one team, each player has a name, a position (such as left
wing or goalie), a skill level, and a set of injury records,
a team captain is also a player,
a game is played between two teams (referred to as host_team and guest_team)
and has a date (such as May 11th, 1999) and a score (such as 4 to 2).
Construct a clean and concise ER diagram for the NHL database.
5. A university registrar’s office maintains data about the following entities:
courses, including number, title, credits, syllabus, and prerequisites;
course offerings, including course number, year, semester, section number,
instructor(s), timings, and classroom;
students, including student-id, name, and program;
instructors, including identi-cation number, name, department, and title.
Further, the enrollment of students in courses and grades awarded to students in
each course they
are enrolled for must be appropriately modeled. Construct an E-R diagram for the
registrar’s
office. Document all assumptions that you make about the mapping constraints
6. Conversion of ER diagram into table
7. Terminologies, generalization, specializations
8. An e-commerce platform maintains a database to manage customers, products, and
orders.
Database Schema:
Customers (CID, CName, Email, Address, Phone) – Stores customer details.
Products (PID, PName, Category, Price, Stock) – Stores product details.
Orders (OID, CID, PID, OrderDate, Quantity, TotalAmount, Status) – Tracks orders placed by
customers.
Sample Queries in Relational Algebra:
1. Retrieve details of customers who have placed an order for 'Laptops'.
2. Find all products in the 'Electronics' category.
3. List the names of customers who have placed more than five orders.
4. Retrieve details of products that are out of stock.
5. Find the total sales amount generated by each product.
9. At University, the administration maintains a relational database to efficiently manage
student, course, and enrollment information. The university offers a variety of
programs across multiple departments, including Computer Science, Electronics, and
Mathematics. Each department is responsible for offering specific courses that are
assigned unique course IDs, course names, and credit values. Students from different
departments enroll in these courses, and their performance is tracked through grades.
A university maintains a database with the following relations:
• Students(SID, SName, Department, Age, Gender) - Students contains details about the
students enrolled at the university.
• Courses(CID, CName, Department, Credits) - Courses contains details about all the
courses offered by the university.
• Enrollments(SID, CID, Grade) - Enrollments tracks which students are enrolled in which
courses, along with their grades.
Write the query for the following with Relational Algebra Expressions:
1.Retrieve the details of all students who enrolled in the 'Computer Science'
department.
2.Find all students enrolled in the course 'Database Systems'.
3.List the names of all students who have received 'A' grade in any course.
4.Find the names of all courses offered by the 'Electronics' department.
5.Retrieve the names of students who enrolled in more than 2 courses.
10. A hospital maintains a database to efficiently manage patient records, doctors, treatments,
and appointments.
Database Schema:
Patients (PID, PName, Age, Gender, Disease, AdmissionDate) – Stores details of
patients admitted to the hospital.
Doctors (DID, DName, Specialization, Experience, Department) – Stores
information about doctors.
Appointments (PID, DID, ADate, Time, Status) – Tracks appointments between
patients and doctors.
Treatments (TID, PID, DID, Diagnosis, Medicine, Cost) – Stores treatments given
to patients.
Sample Queries in Relational Algebra:
Retrieve the details of all patients diagnosed with 'Diabetes'.
Find the names of doctors who have more than 10 years of experience.
List the names of patients who have an appointment with 'Dr. Smith'.
Retrieve the names of all doctors in the 'Cardiology' department.
Find patients who have undergone more than two treatments.