Sei sulla pagina 1di 34

DATABASE

PROJECT
Public Administration
school
( Smart School )
Team Names

Introduction
In this modern world computer and softwares plays a major role in every humans life
Most of the business now they were using softwares to make their work simple and speed
But still many schools are manually maintaining their students and teachers academic records
which take more time to feed in register and the
records will occupy most of the places in school
office room

Smart School
SMS is a large Database system which can be used for managing your schools day
to
day business
SMS allows users to store almost ,all of their school's information electronically
, including information on students , employees
. properties , teaching meteorites . Etc
This information can be easily shared with authorized
.users

Easily manage your single school Manage Multiple schools on cloud from a central location with a single database
Easily add student details employee details teacher details parent details
Easily manage and add examination schedule for each semester year
Communicate with parents easily It is designed for better interaction between students teachers parents. Etc

The SMS being web based can be accessed from any where in the world
It is a multi user system and can be used by hundred of users at same time
-

References
http://www.trymyschool.com
https://web-school.in
http://www.quickschools.com/
https://www.sibelschools.com
https://school-time.co/

System
Requirements
Analysis

Step 1 : Identify the Entities


-Teacher
-Administrator
-Worker
-Student
-Parent
-School
Transport
-Activity
-Violation

-Department
-Subject
-Class
-Time Table
-Fee
-Exam
-Trans Paid

Step 2 : Identify the attributes and key constraints


- For the Teacher entity ( Name , Salary , Phone Number , Email , Attendance , address ,
TSSN[Primary Key] )
- For the Administrator entity ( Name , Phone , Email , Address . Work , Salary ,
ASSN[Primary Key] )
- For the Worker entity ( Name , Phone , Attendance , Salary , WSSN[Primary Key] )
- For the Student entity ( Name , Email , Date of Birth , Address , Attendance , Phone ,
ID[Primary Key] )
- For the Parent entity ( Name , Address , Work , Phone , Email , PSSN[Primary Key] )
- For the School_Transport entity ( Trans_Name , Trans_ID[Primary Key] )
- For the Activity entity ( Act_Name , Supervisor , Act_ID[Primary Key] )

- For the Violation entity entity ( Type[Primary Key] , Date )


- For the Department entity ( Name , Number[Primary Key] )
- For the Subject entity ( SubjectID[Primary Key] , Name , Quizs , Exams ,
Assignments , Material[Multi value] )
- For the Class entity ( Name , Id[Primary Key] , Level , Type )
- For the Time Table entity ( Period id , Class Id[Primary Key] )
- For the Fee entity[Weak entity] ( Date , Paid )
- For the Exam entity ( Sub_Name , Number[Primary Key] , Grade , Date , Time
,Type )
- For the Trans_Paid entity ( Price , Type[Primary Key] )

Step 3 : Identify the relationships


-

Many Teachers can Work on one Department , but one Teacher can work for one Department .
( Cardinality between Teacher and Department is One to Many 1:N )
Each Department is managed by one Teacher . ( cardinality between Teacher and Department is
One to One [1:1] )
One Teacher can teach many Subjects , and One Subject can be Taught by Many Teacher .
( Cardinality between Teacher and Subject is Many to Many [M:N] )
One Parent can communicate with Many Teacher , and One Teacher can be communicated by
Many parent . ( Cardinality between Parent and Teacher is Many to Many [M:N] )
Each Parent has Many Students . ( Cardinality between Student and Parent is One to Many 1:N )
Each Parent can monitor Many Students . ( 1: N )
One Student has Many Violation . and One Violation can be done by Many Student .
(Cardinality between Student and Violation is Mant to Many M:N )
Each Parent can View his student's Violation . (1:N)
Many Student can take one Transport . ( Cardinality between Student and Transport is
One to Many 1:N )

One Student has Many Activities and One Activity be taken by Many Students . ( Cardinality between Student and
Activity is Many to Many M:N )
One Student pay Many Fees and One Fee be paid by Many student . ( Cardinality between Student and Fee is
Many to Many M:N )
Cardinality between Class and Student is One to Many ( 1:N )
One Student Can take Many Exams and One Exam can be taken by Many Student . ( Cardinality between
Student and Exam is Many to Many M:N )
Cardinality between Subject and Time Table is Many to Many ( M:N )
Cardinality Between Class and Time Table is One to Many ( 1:N )
One Worker can clean Many Classes and One Class can be cleaned by Many Workers
( Cardinality between Worker and class is Many to Many M:N )
One Administrator can manage Many Teachers , Workers , Students , and One Teacher , Student ,
Worker Can be Managed by Many Administrator ( Cardinality between Administrator and Teacher , Student ,
Worker is Many to Many M:N )
Cardinality between School_Transport and Trans_Paid is One to Many ( 1:N )

Step 4: Draw complete ER diagram

Step 5: ER Schema Relational Schema


1- Teacher ( Name , Salary , Phone Number , Email ,
Attendance , address , TSSN )

4- Student ( Name , Email , Date of Birth

Communicate (TSSN , PSSN)

Monitor ( ID , PSSN , Grades , Attendan

Teach ( TSSN , SubjectID )

Participate ( ID , Act_ID )

Head_Teacher ( TSSN , Name )

Pay ( ID , Type )

2- Administrator ( Name , Phone , Email , Address ,


Salary , SSN )

Commit ( ID , Type )

Manage ( ASSN , TSSN , WSSN , ID )


3- Worker ( Name , Phone , Attendance , Salary ,
WSSN )
Clean ( WSSN , Class_Name )

Address , Attendance , Phone , ID )

TakeExam ( ID , Number )

5- Parent ( Name , Address , Work , Pho


Email , PSSN )

6- School_Transport ( Trans_Name , Tra

7- Activity ( Act_Name , SName ,


SPhone , Act_ID )
8- Violation ( Type , Date )
9- Department (Name , Number)
10- Subject ( Subject_ID , Name ,
Quizs , Exams , Assignments )
Organize ( Class_ID ,
Subject_ID )
Material ( Subject_ID , Type )
11- Class ( Class_Name ,
Class_Level , Class_Type )
12- Time Table ( Period id , Class
Id )
13- Fee ( Date , Price , Type )
14- Exam ( Sub_Name ,
Number , Grades , Date , Time ,
Type )
15- Trans_Paid ( Price , Type )

Primary Key ( Teacher ) = < TSSN >


Primary Key ( Communicate ) = < TSSN , PSSN >
Primary Key ( Teach ) = < TSSN , SubjectID >
Primary Key ( Head_Teacher ) = < SSN , Name >
Primary Key (Administrator) = < ASSN >
Primary Key ( Manage ) = < ASSN , TSSN , WSSN , SID >
Primary Key (Worker) = < WSSN >
Primary Key ( Clean ) = < WSSN , Class_Name >
Primary Key ( Student ) = < ID >
Primary Key ( Monitor ) = < ID , SSN >
Primary Key ( Participate ) = < ID , Act_ID >
Primary Key ( Pay ) = < ID , Type >
Primary Key ( Commit ) = < ID , Type >
Primary Key ( TakeExam ) = < ID , Number >
Primary Key ( Parent ) = < PSSN >
Primary Key ( School_Transport ) = < Trans_ID >

FOREIGN KEY Teach ( TSSN ) REFERENCES Teacher


( TSSN )
FOREIGN KEY Teach ( SubjectID ) REFERENCES
Teacher ( SubjectID )
FOREIGN KEY Teacher ( DName ) REFERENCES
Department ( Name )
FOREIGN KEY Head_Teacher ( TSSN ) REFERENCES
Teacher ( TSSN )
FOREIGN KEY Head_Teacher ( Name ) REFERENCES
Department ( Name )
FOREIGN KEY Manage ( ASSN ) REFERENCES
Administrator ( ASSN )
FOREIGN KEY Manage ( TSSN ) REFERENCES Teacher
FOREIGN KEY Communicate ( TSSN ) REFERENCES
( TSSN )
Teacher ( TSSN )
FOREIGN KEY Manage ( WSSN ) REFERENCES Worker
FOREIGN KEY Communicate ( PSSN ) REFERENCES
( WSSN )
Parent ( PSSN )
FOREIGN KEY Manage ( ID ) REFERENCES Student
( ID )
Primary Key ( Activity ) = < Act_ID >
Primary Key ( Violation ) = < Type >
Primary Key ( Department ) = < Number >
Primary Key ( Subject ) = < Subject_ID >
Primary Key ( Organize ) = < Class_ID , Subject_ID >
Primary Key ( Material ) = < Type , Subject_ID >
Primary Key ( Class ) = < Class_Name >
Primary Key ( Time_Table ) = < ClassID >
Primary Key ( fee ) = < Type >
Primary Key ( Exam ) = < Number >
Primary Key ( Trans_Paid ) = < Type >

FOREIGN KEY Clean ( WSSN ) REFERENCES Worker


( WSSN )
FOREIGN KEY Clean ( Class_Name ) REFERENCES
Class ( Class_Name )
FOREIGN KEY Student ( PSSN ) REFERENCES Parent
( PSSN )
FOREIGN KEY Monitor ( ID ) REFERENCES Student
( ID )
FOREIGN KEY Monitor ( PSSN ) REFERENCES Parent
( PSSN )
FOREIGN KEY Student ( Class_Name ) REFERENCES
Class (Class_Name )
FOREIGN KEY Student ( Trans_ID ) REFERENCES
School_Transport (Trans_ID )
FOREIGN KEY Participate ( ID ) REFERENCES
Student ( ID )

FOREIGN KEY Participate ( Act_ID ) REFERENCES


Activity ( Act_ID )
FOREIGN KEY Pay (ID ) REFERENCES Student ( ID )
FOREIGN KEY Pay ( Type ) REFERENCES Fee
FOREIGN
KEY Commit ( ID ) REFERENCES Student ( ID )
( Type )
FOREIGN KEY Commit ( Type ) REFERENCES Violation ( Type )
FOREIGN KEY TakeExam ( ID ) REFERENCES Student ( ID )
FOREIGN KEY TakeExam ( Number ) REFERENCES Exam
( Number )
FOREIGN KEY Organize ( Subject_ID ) REFERENCES Subject
( Subject_ID )
FOREIGN KEY Organize ( Class_ID ) REFERENCES Time_Table
( Class_ID )
FOREIGN KEY Material ( Subject_ID ) REFERENCES Subject
( Subject_ID )
FOREIGN KEY Class ( Class_ID ) REFERENCES Time_Table
( Class_ID )

Step 6: SQL DDL


CREATE TABLE Administrator(
ASSN NUMBER (10) NOT NULL,
Salary NUMBER (10),
Address VARCHAR2(20),
Email VARCHAR2(20),
Phone NUMBER (10),
Name VARCHAR2(10),
CONSTRAINT Administrator_PK PRIMARY KEY (ASSN)
);
CREATE TABLE Worker(
WSSN NUMBER (10) NOT NULL,
Name VARCHAR2(10),
Phone NUMBER (10),
TodayDate DATE,
Time VARCHAR2(10),
Salary NUMBER (10,5),
CONSTRAINT Worker_PK PRIMARY KEY (WSSN)
);

CREATE TABLE Parent(


PSSN NUMBER (10) NOT NULL,
Email VARCHAR2(20),
Phone NUMBER (10),
Work VARCHAR2(10),
Address VARCHAR2(20),
Name VARCHAR2(10),
CONSTRAINT Parent_PK PRIMARY KEY (PSSN)
);

CREATE TABLE School_Transport(


Trans_ID NUMBER (10) NOT NULL,
Trans_Name VARCHAR2(10),
CONSTRAINT School_Transport_PK PRIMARY KEY (Trans_ID)
);

CREATE TABLE Activity(


Act_ID NUMBER (10) NOT NULL,
Act_Name VARCHAR2(10),
SPhone NUMBER (10),
SName VARCHAR2(10),
CONSTRAINT Activity_PK PRIMARY KEY (Act_ID)
);

CREATE TABLE Violation(


Type VARCHAR2(10) NOT NULL,
TodayDate DATE,
CONSTRAINT Violation_PK PRIMARY KEY (Type)
);

CREATE TABLE Department(


Name VARCHAR2(10) NOT NULL,
DNumber NUMBER (10),
CONSTRAINT Department_PK PRIMARY KEY (Name)
);

CREATE TABLE Subject(


Subject_ID NUMBER (10) Not Null,
Name VARCHAR2(10),
Quizs NUMBER (10,5),
Exams VARCHAR2(10),
Assignments VARCHAR2(10),
CONSTRAINT Subject_PK PRIMARY KEY (Subject_ID)
);

CREATE TABLE Time_Table(


Class_ID NUMBER (10) NOT NULL,
Period_ID NUMBER (10),
CONSTRAINT Time_Table_PK PRIMARY KEY (Class_ID)
);

CREATE TABLE Fee(


Type VARCHAR2(10) NOT NULL,
TodayDate DATE,
Price NUMBER (10),
CONSTRAINT Fee_PK PRIMARY KEY (Type)
);

CREATE TABLE Exam(


ENumber NUMBER (10) NOT NULL,
Sub_Name VARCHAR2(10),
Grades NUMBER (10),
TodayDate DATE,
Time VARCHAR2(10),
Type VARCHAR2(10),
CONSTRAINT Exam_PK PRIMARY KEY (ENumber)
);

CREATE TABLE Trans_Paid(


Type VARCHAR2(10) NOT NULL,
Price NUMBER (10,5),
CONSTRAINT Trans_Paid_PK PRIMARY KEY (Type)
);

CREATE TABLE Teacher(


TSSN NUMBER (10) NOT NULL,
Salary NUMBER (10,5),
Phone_No NUMBER(10),
Email VARCHAR2(20),
ADate DATE,
Time VARCHAR2(10),
Address VARCHAR2(20),
Name VARCHAR2(10),
DName VARCHAR2(10),
CONSTRAINT Teacher_PK PRIMARY KEY (TSSN),
CONSTRAINT Teacher_FK FOREIGN KEY (DName) REFERENCES
Department (Name)
);

CREATE TABLE Communicate(


TSSN NUMBER (10) NOT NULL,
PSSN NUMBER (10) NOT NULL,
CONSTRAINT Communicate_PK PRIMARY KEY (TSSN,PSSN),
CONSTRAINT Communicate_FK FOREIGN KEY (TSSN) REFERENCES Teacher (TSSN),
CONSTRAINT Communicate_FK1 FOREIGN KEY (PSSN) REFERENCES Parent (PSSN)
);

CREATE TABLE Teach(


TSSN NUMBER (10) NOT NULL,
Subject_ID NUMBER (10) NOT NULL,
CONSTRAINT Teach_PK PRIMARY KEY (TSSN,Subject_ID),
CONSTRAINT Teach_FK FOREIGN KEY (TSSN) REFERENCES Teacher (TSSN),
CONSTRAINT Teach_FK1 FOREIGN KEY (Subject_ID) REFERENCES Subject (Subject_ID)
);

CREATE TABLE Head_Teacher(


TSSN NUMBER (10) NOT NULL,
Name VARCHAR2 (10) NOT NULL,
CONSTRAINT Head_Teacher_PK PRIMARY KEY (TSSN,Name),
CONSTRAINT Head_Teacher_FK FOREIGN KEY (TSSN) REFERENCES Teacher (TSSN),
CONSTRAINT Head_Teacher_FK1 FOREIGN KEY (Name) REFERENCES Department (Name)
);

CREATE TABLE Class(


Class_Name VARCHAR2(10) NOT NULL,
Class_Level NUMBER (10),
Class_Type VARCHAR2(10),
Class_ID NUMBER (10),
CONSTRAINT Class_PK PRIMARY KEY (Class_Name),
CONSTRAINT Class_FK FOREIGN KEY (Class_ID) REFERENCES Time_Table (Class_ID)
);

CREATE TABLE Student(


ID NUMBER (10) NOT NULL,
Name VARCHAR2(10),
Email VARCHAR2(20),
Date_of_Birth DATE,
Address VARCHAR2(20),
Phone NUMBER (10),
PSSN NUMBER (10),
Class_Name VARCHAR2(10),
Trans_ID NUMBER (10),
CONSTRAINT Student_PK PRIMARY KEY (ID),
CONSTRAINT Student_FK FOREIGN KEY (PSSN) REFERENCES Parent (PSSN),
CONSTRAINT Student_FK1 FOREIGN KEY (Class_Name) REFERENCES Class(Class_Name),
CONSTRAINT Student_FK2 FOREIGN KEY (Trans_ID) REFERENCES
School_Transport(Trans_ID)
);

CREATE TABLE Manage(


TSSN NUMBER (10) NOT NULL,
WSSN NUMBER (10) NOT NULL,
PSSN NUMBER (10) NOT NULL,
ID NUMBER (10) NOT NULL,
CONSTRAINT Manage_PK PRIMARY KEY (TSSN,WSSN,PSSN,ID),
CONSTRAINT Manage_FK FOREIGN KEY (TSSN) REFERENCES Teacher (TSSN),
CONSTRAINT Manage_FK1 FOREIGN KEY (WSSN) REFERENCES Worker (WSSN),
CONSTRAINT Manage_FK2 FOREIGN KEY (PSSN) REFERENCES Parent (PSSN),
CONSTRAINT Manage_FK3 FOREIGN KEY (ID) REFERENCES Student(ID)
);

CREATE TABLE Monitor(


ID NUMBER (10) NOT NULL,
PSSN NUMBER (10) NOT NULL,
Grades NUMBER (10,5),
Time VARCHAR2(10),
TodayDate DATE,
CONSTRAINT Monitor_PK PRIMARY KEY (ID,PSSN),
CONSTRAINT Monitor_FK FOREIGN KEY (PSSN) REFERENCES Parent (PSSN),
CONSTRAINT Monitor_FK1 FOREIGN KEY (ID) REFERENCES Student(ID)
);
CREATE TABLE Participate(
ID NUMBER (10) NOT NULL,
Act_ID NUMBER (10) NOT NULL,
CONSTRAINT Participate_PK PRIMARY KEY (ID,Act_ID),
CONSTRAINT Participate_FK FOREIGN KEY (Act_ID) REFERENCES Activity (Act_ID),
CONSTRAINT Participate_FK1 FOREIGN KEY (ID) REFERENCES Student(ID)
);

CREATE TABLE Pay(


ID NUMBER (10) NOT NULL,
Type VARCHAR2(10) NOT NULL,
CONSTRAINT Pay_PK PRIMARY KEY (ID,Type),
CONSTRAINT Pay_FK FOREIGN KEY (Type) REFERENCES Fee (Type),
CONSTRAINT Pay_FK1 FOREIGN KEY (ID) REFERENCES Student(ID)
);

CREATE TABLE Commit(


ID NUMBER (10) NOT NULL,
Type VARCHAR2(10) NOT NULL,
CONSTRAINT Commit_PK PRIMARY KEY (ID,Type),
CONSTRAINT Commit_FK FOREIGN KEY (Type) REFERENCES Violation (Type),
CONSTRAINT Commit_FK1 FOREIGN KEY (ID) REFERENCES Student(ID)
);

CREATE TABLE TakeExam(


ID NUMBER (10) NOT NULL,
ENumber NUMBER (10) NOT NULL,
CONSTRAINT TakeExam_PK PRIMARY KEY (ID,ENumber),
CONSTRAINT TakeExam_FK FOREIGN KEY (ENumber) REFERENCES Exam (ENumber),
CONSTRAINT TakeExam_FK1 FOREIGN KEY (ID) REFERENCES Student(ID)
);

CREATE TABLE Organize(


Class_ID NUMBER (10) NOT NULL,
Subject_ID NUMBER (10) NOT NULL,
CONSTRAINT Organize_PK PRIMARY KEY (Class_ID,Subject_ID),
CONSTRAINT Organize_FK FOREIGN KEY (Subject_ID) REFERENCES Subject (Subject_ID),
CONSTRAINT Organize_FK1 FOREIGN KEY (Class_ID) REFERENCES Time_Table (Class_ID)
);

CREATE TABLE Material(


Subject_ID NUMBER (10) NOT NULL,
Type VARCHAR2(10) NOT NULL,
CONSTRAINT Material_PK PRIMARY KEY (Type,Subject_ID),
CONSTRAINT Material_FK FOREIGN KEY (Subject_ID) REFERENCES Subject (Subject_ID)
);

CREATE TABLE Users(


User_Name VARCHAR2(10),
User_Pass NUMBER(10),
User_Type CHAR(1)
);

Potrebbero piacerti anche