Database System Final Project
Database System Final Project
School Database
TEXAS A&M UNIVERSITY COMMERCE
DEPARTMENT OF COMPUTER SCIENCE
By
Ganesh Marella (CWID: 50303006)
Mahidhar varma pandeti(CWID:50298105)
Introduction:
A Database is an organized collection of data, typically stored electronically in a computer system. A
Database is usually controlled by a database management system (DBMS). Database helps any
organization/business to manage and access data in more efficient way for a long period of time. Since
its first launch into the market in the year 1979, Database system has evolved a lot to handle the
increasing data much more effectively making it easy for the end-users to access the data from the
beginning of the time to till date seamlessly.
Goal:
Our goal is to design a relational database for a school to store and manage its records for a long time to
come.
Business Purpose:
To create a relational database that helps school management to store and manage their information
like students data, teachers information, exams, books and courses.
.In the relational database model, data is stored in tables. This means any record can be related to any
other record, and new relations can be easily added. This structure sets up relational databases as an
efficient, flexible, and intuitive way to store information. They can be accessed by any application.
Where to start?
Any relational database design starts with sorting what information goes into a table and how its
contents/entities are related to the information stored in other tables. We collect all this information
and represent it in a diagrammatical format called ER diagram.
So, what is this ER diagram and what does it have to do with relational
database?
An Entity Relationship (ER) Diagram is a type of flowchart that illustrates how “entities” such as people,
objects or concepts relate to each other within a system. ER Diagrams are most often used to design or
debug relational databases in the fields of software engineering, business information systems,
education and research.
ER diagrams are related to data structure diagrams (DSDs), which focus on the relationships of
elements within entities instead of relationships between entities themselves. ER diagrams also are
often used in conjunction with data flow diagrams (DFDs), which map out the flow of information for
processes or systems.
List of Queries:
select * from student where student_id IN (select student_id from course_student where course_id IN
(select course_id from course where name like "course1"));
select * from parent where parent_id IN (select parent_id from student where student_id = 15);
select CONCAT(fname,CONCAT(" ", lname)) AS NAME from student where student_id IN (select
student_id from books where name = 'Quia sit eum quis.');
#Get the number of students who attended the clasees on date "2022-03-31"
#Get the student details who failed in the exams and borrowed a book
#Get the exam name and corresponding course name where most of the students failed
select exam.name, course.name from exam RIGHT JOIN course on exam.course_id = course.course_id
where exam.exam_id IN (select exam_id from (select DISTINCT exam_id, SUM(CASE WHEN result = 0
THEN 1 ELSE 0 END) as count from exam_result where result = 0 group by exam_id order by count desc
limit 1) as T);
#Get the teacher and course name where most of the students failed
Conclusion:
In conclusion, a database is a far more efficient mechanism to store and organize data than
spreadsheets; it allows for a centralized facility that can easily be modified and quickly shared
among multiple users.
Using a database management system, teachers can generate an efficient timetable for the
academic year. The automated timetable is error-free and ensures no lessons are conflicting. It
also ensures that all school resources, like computer labs, classrooms, and libraries, are used
efficiently.