0% found this document useful (0 votes)
2 views

dbms

The document outlines various database design projects across multiple domains, including e-commerce, inventory management, healthcare, and social media. Each project specifies objectives, scenarios, and tasks such as designing normalized schemas, implementing stored procedures, and generating reports. Advanced requirements often include triggers for real-time updates and concurrency control mechanisms to ensure data integrity.

Uploaded by

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

dbms

The document outlines various database design projects across multiple domains, including e-commerce, inventory management, healthcare, and social media. Each project specifies objectives, scenarios, and tasks such as designing normalized schemas, implementing stored procedures, and generating reports. Advanced requirements often include triggers for real-time updates and concurrency control mechanisms to ensure data integrity.

Uploaded by

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

1.

Design a Database for an E-commerce System

 Objective: Design an e-commerce system’s database and address real-world


requirements.
 Exercise:
o Scenario: Design a database schema for an e-commerce platform like
Amazon, which should include tables for products, customers, orders,
payments, shipping, reviews, and categories.
o Tasks:
1. Design the schema in 3NF, considering relationships between entities.
2. Implement referential integrity constraints (primary keys, foreign keys,
etc.).
3. Create appropriate indexes on frequently queried fields.
4. Write queries to generate reports such as "Top selling products,"
"Revenue by category," and "Customer purchase history."
5. Implement a stored procedure to generate an invoice when an order is
placed.
o Advanced Requirement: Implement a trigger to send an email notification
whenever a user places an order.

2. Building a Real-time Inventory Management System

 Objective: Develop a database schema and implement SQL queries for a real-time
inventory management system.
 Exercise:
o Scenario: You are tasked with building an inventory management system for
a warehouse. The system needs to track product quantities, product categories,
suppliers, and orders.
o Tasks:
1. Design a normalized schema with tables for products, inventory
transactions (e.g., purchases, sales), suppliers, and product categories.
2. Create a stored procedure to update inventory levels in real time when
products are purchased or sold.
3. Implement complex SQL queries to generate real-time reports, such as
“current stock of a product,” “low stock products,” and “supplier order
history.”
4. Implement an auto-update feature using triggers to decrease inventory
when a product is sold or shipped.
5. Discuss how you would handle concurrent inventory updates to avoid
issues like double selling.

3. Design a Database for a Hospital Management System

 Objective: Implement a relational database system for managing hospital records.


 Exercise:
o Scenario: You need to design a database for a hospital to manage patient
records, doctors, appointments, treatments, billing, and prescriptions.
o Tasks:
1. Design tables for patients, doctors, appointments, treatments, hospital
rooms, and billing.
2. Implement constraints to maintain data integrity (e.g., ensuring that a
patient can’t be assigned to multiple doctors simultaneously).
3. Use relational algebra and SQL to create queries such as “Get all
appointments for a particular doctor” or “Generate a bill for a patient
based on their treatments and medicines.”
4. Develop a stored procedure to generate daily reports for the number of
patients treated and the revenue generated.
5. Advanced: Implement a transaction-based system to handle billing and
appointment scheduling, ensuring that if one fails, the entire process is
rolled back.

4. Design a Database for a Social Media Platform

 Objective: Build a schema for a social media platform and apply concepts such as
joins, indexing, and user activity tracking.
 Exercise:
o Scenario: Design a database for a social media platform like Facebook or
Instagram, where users can post content, like, comment, and follow others.
o Tasks:
1. Design normalized tables for users, posts, comments, likes, followers,
and notifications.
2. Create SQL queries to retrieve feeds for a specific user (combine posts,
likes, and comments).
3. Implement a system for tracking user activities such as following users
or liking posts. Write a query to find the “most liked posts” or “most
followed users.”
4. Use indexing on frequently queried fields (e.g., user_id, post_id) to
optimize performance.
5. Advanced: Write a stored procedure that automatically sends
notifications to users when their posts are liked or commented on.

5. Implementing Data Warehousing Concepts in an OLAP System

 Objective: Design a star schema for OLAP (Online Analytical Processing) and
implement data cubes.
 Exercise:
o Scenario: You are tasked with designing a data warehouse for a retail business
to analyze sales performance across various dimensions such as time, product,
and geography.
o Tasks:
1. Design the schema using the star schema model with fact tables and
dimension tables (e.g., sales fact, product dimension, time dimension,
store dimension).
2. Write SQL queries to perform OLAP operations like slice, dice, roll-
up, and drill-down to analyze sales by different dimensions.
3. Design a query to calculate the total sales by region, month, and
product category.
4. Implement an ETL process to populate the fact and dimension tables
from transactional data.
5. Advanced: Create materialized views for frequently queried reports to
speed up query performance.

6. Design a Database for a Movie Ticket Reservation System

 Objective: Build a database for managing movie showtimes, bookings, and user
profiles.
 Exercise:
o Scenario: Build a database for a movie ticket reservation system where users
can view showtimes, book tickets, and review movies.
o Tasks:
1. Design tables for users, movies, theaters, showtimes, bookings, and
reviews.
2. Create relationships between users and bookings, and between
showtimes and movies.
3. Implement a query to get the "most booked movie" over the past
month.
4. Implement a stored procedure to automatically send reminders for
booked tickets 24 hours before the showtime.
5. Advanced: Handle concurrent seat bookings by implementing locks to
prevent double bookings during peak hours.

7. Design a Voting System Database

 Objective: Implement a database system for managing voting in elections.


 Exercise:
o Scenario: Design a voting system for a university election where students can
vote for candidates, and the votes are tracked securely.
o Tasks:
1. Create tables for students, candidates, elections, and votes.
2. Implement triggers to ensure that each student can only vote once.
3. Write SQL queries to retrieve the election results by candidate and by
student demographics.
4. Develop a stored procedure to calculate the percentage of votes for
each candidate.
5. Advanced: Implement audit trails by using triggers to log changes to
vote records and election results for security.
8. Database Design for a Real-time Sports Scoring System

 Objective: Build a system for tracking live sports scores, teams, players, and
statistics.
 Exercise:
o Scenario: You are designing a real-time sports scoring system to track the
scores, players, and statistics during live games (e.g., for soccer, basketball,
etc.).
o Tasks:
1. Design tables for teams, players, matches, scores, and statistics.
2. Implement real-time updates to the database using triggers or stored
procedures for scoring events.
3. Write queries to generate match summaries such as “Total points
scored by a player,” “Team with the most wins,” and “Player statistics
by game.”
4. Advanced: Implement concurrency control mechanisms to handle
simultaneous updates to player statistics during high-paced games.

9. Design a Database for a Travel Booking System

 Objective: Design and implement a database for booking flights, hotels, and car
rentals.
 Exercise:
o Scenario: Create a database to handle the booking process for flights, hotels,
and car rentals for a travel agency.
o Tasks:
1. Design tables for customers, flights, hotels, car rentals, reservations,
and payment transactions.
2. Implement foreign key relationships between customers and
reservations, reservations and bookings (e.g., flight, hotel, car).
3. Write SQL queries to generate a "Customer Booking History" report
and a "Revenue per Travel Package."
4. Advanced: Create a stored procedure to check availability for flights,
hotels, and cars based on customer preferences and issue a reservation.
5. Concurrency: Implement mechanisms to handle concurrent bookings
for limited resources (e.g., limited hotel rooms or flights).

10. Design a Database for an Online Learning System

 Objective: Build a system for managing courses, students, instructors, and grades in
an online learning platform.
 Exercise:
o Scenario: Design a database for an online learning system, where students can
enroll in courses, track progress, and interact with instructors.
o Tasks:
1. Design tables for students, courses, instructors, enrollments, and
assignments.
2. Create relationships for student enrollment in courses and assignment
submissions.
3. Write queries to generate reports such as "Students enrolled in a
particular course" or "Students who scored above a certain grade."
4. Advanced: Develop a stored procedure to calculate final grades based
on assignment scores, participation, and exams.
5. Normalization: Normalize the schema to remove redundancy and
ensure data integrity.

11. Database for a Library with Book Reservation System

 Objective: Build a library system that includes features like book reservations,
overdue tracking, and fine calculation.
 Exercise:
o Scenario: Create a database for a library that allows users to borrow, reserve,
and return books. The system should also track overdue books and calculate
fines.
o Tasks:
1. Design tables for books, members, reservations, borrow transactions,
and fines.
2. Implement triggers to automatically apply fines if books are not
returned by the due date.
3. Write queries to list all overdue books and calculate the total fine for
each member.
4. Advanced: Create a stored procedure to process book reservations.
The procedure should update the availability of books based on
borrowings and reservations.
5. Concurrency: Handle concurrent reservations for the same book using
appropriate locking mechanisms or checks.

12. Design a Job Portal Database

 Objective: Design a database to manage job listings, applicants, employers, and


application statuses for a job portal.
 Exercise:
o Scenario: You need to design a database for a job portal that includes
information about job listings, applicants, and employers.
o Tasks:
1. Design tables for employers, job postings, applicants, applications, and
interview schedules.
2. Implement foreign key relationships between job postings and
employers, applications and applicants.
3. Write queries to generate reports such as "Applications per job
posting" and "Candidates shortlisted for interviews."
4. Advanced: Create a stored procedure that automatically updates the
application status (e.g., from "Applied" to "Interview Scheduled")
based on an employer's action.
5. Indexing: Implement indexing on frequently queried fields like job
title, location, and application status to speed up search operations.

13. Real-Time Data Analytics for Sales Transactions

 Objective: Design a system that tracks and analyzes sales data in real-time, providing
insights into sales performance.
 Exercise:
o Scenario: You are tasked with building a database system to analyze real-time
sales data. This system should track products, customers, sales transactions,
and generate live reports.
o Tasks:
1. Design tables for sales, products, customers, and stores.
2. Implement a system that logs sales transactions as they happen, storing
details such as quantity, total price, and customer.
3. Write complex SQL queries to calculate "Total Sales by Region," "Top
Selling Products," and "Customer Purchase Behavior."
4. Advanced: Implement a trigger that automatically updates a "Sales
Dashboard" with aggregated sales statistics whenever a new sale is
added.
5. Real-Time Updates: Discuss how you would implement real-time
data aggregation (e.g., using materialized views or caching) for
efficient reporting.

14. Design a Database for a Restaurant Reservation System

 Objective: Create a database for managing restaurant reservations, menus, and orders.
 Exercise:
o Scenario: Create a database to manage restaurant reservations, menu items,
and customer orders. The system should track reservations, seating, and order
details.
o Tasks:
1. Design tables for reservations, customers, menu items, orders, and
payment transactions.
2. Implement relationships to ensure that reservations correspond to
specific customers and tables.
3. Write SQL queries to generate reports such as "Revenue by Table,"
"Menu Item Popularity," and "Reservations per Day."
4. Advanced: Implement a stored procedure to automatically send a
confirmation message to customers once their reservation is confirmed.
5. Concurrency: Discuss how you would handle concurrent reservations
for the same table during peak hours.
15. Database Design for a Healthcare System with Patient History

 Objective: Design a database for managing patient information, including medical


history, prescriptions, and doctor visits.
 Exercise:
o Scenario: Design a database system to manage patient records, doctor visits,
medical prescriptions, and patient medical history.
o Tasks:
1. Design normalized tables for patients, doctors, prescriptions,
appointments, and medical history.
2. Implement foreign key relationships to link patients with their
appointments, prescriptions, and medical history.
3. Write queries to generate reports such as "Patient's medical history,"
"Doctors with the highest number of consultations," and "Common
diseases treated."
4. Advanced: Implement a trigger to automatically update a patient's
medical history every time a new prescription is issued.
5. Security: Discuss how you would ensure the privacy and security of
sensitive health data in the database.

16. Database Design for a Ticketing System (e.g., Concerts, Sports Events)

 Objective: Build a database to manage event ticket sales, seating arrangements, and
customer preferences.
 Exercise:
o Scenario: You need to design a database for a ticketing system that handles
events, seating arrangements, ticket sales, and customer information.
o Tasks:
1. Design tables for events, tickets, customers, and seating arrangements.
2. Implement foreign key relationships to link ticket sales with events and
customers.
3. Write queries to generate reports such as "Total sales for a specific
event," "Customer ticket purchase history," and "Revenue per event."
4. Advanced: Create a stored procedure to automatically issue tickets and
reserve seats when a customer buys a ticket.
5. Concurrency: Implement a locking mechanism to prevent double-
booking of seats during high-demand periods.

17. Database Design for a Content Management System (CMS)

 Objective: Design a CMS database to handle articles, categories, authors, and


comments.
 Exercise:
o Scenario: Design a content management system for a website where users can
post articles, comment on them, and categorize them.
o Tasks:
1. Design tables for articles, authors, categories, and comments.
2. Implement foreign key relationships between articles and categories,
comments and articles, and authors and articles.
3. Write queries to generate reports such as "Articles by a particular
author," "Most commented articles," and "Articles in a specific
category."
4. Advanced: Create a stored procedure to publish an article,
automatically assigning it to a category and notifying the author when
it is published.
5. Full-Text Search: Implement full-text indexing on article titles and
content for efficient searching.

18. Design a Database for a Supply Chain Management System

 Objective: Design a system to manage suppliers, products, inventory, and shipments.


 Exercise:
o Scenario: Create a database to manage the flow of products from suppliers to
customers, tracking inventory levels, order shipments, and supplier details.
o Tasks:
1. Design tables for suppliers, products, inventory, orders, shipments, and
customers.
2. Write SQL queries to track products by supplier, inventory levels, and
order statuses.
3. Implement triggers to automatically update inventory levels when
products are shipped or returned.
4. Advanced: Create a stored procedure to reorder low-stock products
from suppliers automatically when inventory levels fall below a
defined threshold.
5. Performance: Optimize queries that track the supply chain process
(e.g., finding the fastest delivery routes).

19. Design a Database for a University Enrollment System

 Objective: Create a system that tracks student enrollments, courses, professors, and
grades.
 Exercise:
o Scenario: Build a database for a university that tracks student enrollment,
courses, professors, and grades.
o Tasks:
1. Design tables for students, courses, professors, enrollments, and
grades.
2. Write queries to generate reports such as “Student grades by course,”
“Professors teaching multiple courses,” and “Students enrolled in
multiple courses.”
3. Implement a stored procedure to calculate final grades for students
based on their exam scores and participation.
4. Normalization: Normalize the schema to eliminate data redundancy
and ensure data integrity.
5. Concurrency: Implement a mechanism to handle concurrent
enrollments or course changes, ensuring that data integrity is
maintained.

20. Design a Database for a Banking System

 Objective: Design a banking system to track accounts, transactions, and customer


details.
 Exercise:
o Scenario: Build a database to manage customer accounts, transactions, and
account balances for a banking system.
o Tasks:
1. Design tables for customers, accounts, transactions, and branches.
2. Implement SQL queries to check account balances, transaction history,
and calculate monthly interest.
3. Advanced: Create a stored procedure for transferring money between
accounts that ensures ACID compliance (atomicity, consistency,
isolation, and durability).
4. Security: Implement encryption for sensitive data like customer
account numbers and balances.
5. Concurrency: Handle concurrent withdrawals or transfers from the
same account by implementing proper locking or transaction isolation
levels.

21. Design a Database for a Fleet Management System

 Objective: Build a database to manage vehicle fleet operations, including vehicles,


drivers, maintenance schedules, and routes.
 Exercise:
o Scenario: Create a fleet management system database to track vehicle details,
maintenance schedules, and driver assignments.
o Tasks:
1. Design tables for vehicles, drivers, maintenance schedules, routes, and
assignments.
2. Write queries to track vehicle maintenance history and generate reports
like “Average maintenance cost per vehicle” and “Total distance
covered by each vehicle.”
3. Advanced: Implement a stored procedure to assign drivers to vehicles
and automatically schedule maintenance based on usage.
4. Concurrency: Implement a system to ensure that multiple
maintenance tasks on the same vehicle do not overlap or conflict.
5. Optimization: Use indexing and partitioning strategies to improve the
performance of queries related to route analysis and vehicle utilization.

22. Design a Database for a Real Estate Management System

 Objective: Build a database for managing property listings, real estate agents, buyers,
and transactions.
 Exercise:
o Scenario: Design a real estate management system to track property listings,
agents, buyers, and transactions.
o Tasks:
1. Design tables for properties, real estate agents, buyers, transactions,
and property types.
2. Write queries to generate reports such as “Most popular property
types,” “Average transaction value per agent,” and “Properties sold by
location.”
3. Implement a trigger to automatically update the status of a property
when a transaction is completed.
4. Advanced: Develop a stored procedure to calculate commission
payouts to agents based on the transaction value and agent’s share.
5. Performance: Optimize queries that calculate statistics for multiple
property types and regions.

23. Design a Database for a Movie Rental System

 Objective: Design a system for managing movie rentals, inventory, customers, and
rental history.
 Exercise:
o Scenario: Create a database to manage movie rentals, inventory, and customer
data.
o Tasks:
1. Design tables for movies, customers, rentals, inventory, and payment
transactions.
2. Implement foreign key constraints and ensure data integrity between
tables like rentals and customers.
3. Write queries to track the "Top 10 most rented movies" and "Rental
history by customer."
4. Advanced: Develop a stored procedure to automatically apply rental
fees and due dates based on movie categories (e.g., new releases vs.
old movies).
5. Concurrency: Implement locking mechanisms to prevent double
rentals for the same movie during peak demand.

24. Design a Database for a Bookstore


 Objective: Create a system to manage book sales, inventory, and customer data.
 Exercise:
o Scenario: Design a database for a bookstore to track book sales, customers,
and inventory levels.
o Tasks:
1. Design tables for books, customers, sales transactions, and inventory.
2. Write queries to track book sales by category, author, or customer
demographics.
3. Advanced: Implement a stored procedure to generate daily, weekly, or
monthly sales reports.
4. Implement triggers to automatically update inventory levels when a
sale is made.
5. Normalization: Normalize the schema to ensure that no redundant
data exists in the inventory and sales tables.

25. Design a Database for an Online Auction System

 Objective: Build a database to manage auction listings, bids, and users in an online
auction platform.
 Exercise:
o Scenario: Design a database for an online auction platform where users can
list items for auction and place bids.
o Tasks:
1. Design tables for users, auction listings, bids, and transactions.
2. Write queries to track the current highest bid for an item, the total
number of bids, and the winning bidder.
3. Advanced: Create a stored procedure to automatically close auctions
when the bidding period ends and declare the winner.
4. Implement a trigger to notify the user when they have been outbid on
an auction item.
5. Performance: Optimize queries related to auction history and user
bids to ensure quick response times during peak usage.

26. Design a Database for an Automated Ticketing System (Transport)

 Objective: Build a system to manage ticket sales, train or bus schedules, and
customer bookings.
 Exercise:
o Scenario: Create a database for a public transport system to manage ticket
bookings, schedules, and available seats.
o Tasks:
1. Design tables for customers, tickets, routes, vehicles (e.g., buses,
trains), and schedules.
2. Write SQL queries to track available seats for specific routes, and the
most popular travel times or routes.
3. Advanced: Develop a stored procedure to automatically assign seats
based on availability when a customer books a ticket.
4. Concurrency: Implement locking to prevent double-booking on
highly-demanded routes or times.
5. Optimization: Optimize queries to return real-time ticket availability
and price estimates quickly.

27. Design a Database for a Subscription Service (e.g., Netflix, Spotify)

 Objective: Design a database to manage subscriptions, user preferences, content


libraries, and billing.
 Exercise:
o Scenario: Create a database for a streaming service that tracks user
subscriptions, content watched, and payment details.
o Tasks:
1. Design tables for users, subscriptions, content (e.g., movies, music),
billing, and watch history.
2. Write queries to track "Top Content by User Rating" and "Subscription
Revenue per Region."
3. Advanced: Create a stored procedure to recommend content to users
based on their watch history or preferences.
4. Performance: Implement indexing to quickly fetch user content
preferences or calculate subscription renewals.
5. Concurrency: Handle concurrent user requests for streaming content,
ensuring smooth playback and access control.

28. Design a Database for a Customer Relationship Management (CRM)


System

 Objective: Build a CRM system database to track customer interactions, sales


pipelines, and marketing campaigns.
 Exercise:
o Scenario: Design a CRM system to manage customer interactions, sales
opportunities, and marketing efforts.
o Tasks:
1. Design tables for customers, sales opportunities, activities, leads, and
campaigns.
2. Write queries to track "Sales Pipeline Status" and "Lead Conversion
Rates."
3. Advanced: Create a stored procedure to calculate lead scoring based
on customer interaction history and behavior.
4. Concurrency: Implement mechanisms to avoid conflicting updates in
the sales pipeline (e.g., when multiple users update customer statuses
simultaneously).

You might also like