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

Database Ass2

The document describes a database system for a school. It includes requirements, tables to store student details, certificates, contacts, financial records, and behaviors. It also includes queries, reports, and diagrams showing the relationships between the tables.

Uploaded by

فق مة
Copyright
© © All Rights Reserved
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
20 views

Database Ass2

The document describes a database system for a school. It includes requirements, tables to store student details, certificates, contacts, financial records, and behaviors. It also includes queries, reports, and diagrams showing the relationships between the tables.

Uploaded by

فق مة
Copyright
© © All Rights Reserved
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 18

HE ACHIEVED P2+P3+M2+M3+D2+D3

Pearson BTEC IT Level 2


Unit 10: Introduction to Database Systems
Assessor: Raghad al amori
Student: Mohammad Syouri
User Requirement :
1- All staff must be able to access the database on the office
computer.

2 - The database should be easy to use .

3 - Input and output should be customized at school style.

4 - Database should provide onscreen user navigation and


instructions.

5 - to store data first table (student details : name, gender, age, date
of birth, nationality ) second table (certificates : previous and current
grades) theired table (contacts : address, telephone number, parents
contact information) fourth (financial side : for how many months,
the amount of payment each month, the amount paid, the remaining
amount, the total amount ) fifth (behaviors : Warnings, behavior,
personal hygiene )

6 - the database should generate queries reports (monthly and


annual behaviors, grading certificates, financial status).
p2+m2
Purpose of database :

The purpose of the database system is to manage data for the new
school. It stores student details like names, genders, ages, dates of
birth, places of birth, and nationalities. It also manages certificates,
contacts, financial records, and student behaviors. The system is easy
to use, generates reports on behaviors, grading certificates, and
financial status, and provides onscreen navigation and instructions
for easy use. The database system simplifies information
management for the school and registration department. p2+m2

constant 1:
2 validation and verification procedures to be applied to the data
3 comprehensive input and output screen layouts including the main menu
with options to access data entry sub-forms, run queries and view reports.

student table :
id_student primary key
name : not null
gender : not null
age : not null
date_of_birth : null
place_of_birth : null
nationality :

certificates :
id_certificates primary key
id_student : foreign key
previous : not null
current_grades : not null

Contacts :

id_contact : primary key


id_student : foreign key
address : null
phone_number : null
phone_number_parent : not null

financial :
id_financial primary key
id_student : foreign key
paid_total : not null
remaining_installment : null
For_how_many_months : null

behaviors :
id_behaviors primary key
id_student : foreign key
Warnings : unique
personal_cleanliness : null
behavior : null
monthly : null
yearly : not null

p2p3m2m3
relation
certificates table (one to many) for example every student has two
certificates in one year and previous certificates and a lot of things.

contact table (one to many) for example every student has a lot of
information like address and phone number and parnest phone
number .

financial table (one to many) for example Each student has


payments, and how much the student paid, how much is left, and for
how many months.

behaviors table (one to many) The student's behavior in class is


good or not, or if he has warnings, or his hair is good, his clothes
are clean (personal cleanliness).

sql queries for ( certificates, contact, financial, behaviors , student)


table :

p2+p3+m2+m3
Query for all tables :
CREATE TABLE Student (
StudentID INT PRIMARY KEY,
Name VARCHAR(50),
Gender VARCHAR(10),
Age INT,
DateOfBirth DATE,
PlaceOfBirth VARCHAR(50),
Nationality VARCHAR(50)
);

CREATE TABLE Certificate (


CertificateID INT PRIMARY KEY,
StudentID INT,
Previous VARCHAR(10),
Current VARCHAR(10),
FOREIGN KEY (StudentID) REFERENCES Student(StudentID)
);
CREATE TABLE Contacts (
ContactID INT PRIMARY KEY,
StudentID INT,
Address VARCHAR(100),
PhoneNumber VARCHAR(20),
ParentContactInfo VARCHAR(100),
Phone_number_parent VARCHAR(100),
FOREIGN KEY (StudentID) REFERENCES Student(StudentID)
);
CREATE TABLE Financials (
FinancialID INT PRIMARY KEY,
StudentID INT,
Paid_Total VARCHAR(50),
remaining_installment VARCHAR(50),
For_how_many_months VARCHAR(50),
FOREIGN KEY (StudentID) REFERENCES Student(StudentID)
);
CREATE TABLE Behaviors (
BehaviorID INT PRIMARY KEY,
StudentID INT,
Warnings VARCHAR(50),
personal_cleanliness,
behavior,
Month INT,
Year INT,
FOREIGN KEY (StudentID) REFERENCES Student(StudentID)
);

DELETE Query:

DELETE FROM Student


WHERE StudentID = <student_id>;

DELETE FROM Certificate


WHERE CertificateID = <certificate_id>;

DELETE FROM Contacts


WHERE ContactID = <contact_id>;

DELETE FROM Financials


WHERE FinancialID = <financial_id>;

DELETE FROM Behaviors


WHERE BehaviorID = <behavior_id>;

UPDATE Query:

UPDATE Student
SET Name = 'New Name', Gender = 'New Gender', Age = <new_age>,
DateOfBirth = 'YYYY-MM-DD', PlaceOfBirth = 'New Place', Nationality
= 'New Nationality'
WHERE StudentID = <student_id>;

UPDATE Certificate
SET Previous = 'New Previous', Current = 'New Current'
WHERE CertificateID = <certificate_id>;

UPDATE Contacts
SET Address = 'New Address', PhoneNumber = 'New Phone Number',
ParentContactInfo = 'New Parent Contact Info',
Phone_number_parent = 'New Parent Phone Number'
WHERE ContactID = <contact_id>;

UPDATE Financials
SET Paid_Total = 'New Paid Total', remaining_installment = 'New
Remaining Installment', For_how_many_months = 'New For How
Many Months'
WHERE FinancialID = <financial_id>;

UPDATE Behaviors
SET Warnings = 'New Warnings', personal_cleanliness = 'New
Cleanliness', behavior = 'New Behavior', Month = <new_month>,
Year = <new_year>
WHERE BehaviorID = <behavior_id>;
Diagram for all tables :

Explanation for the relation

1 - Student Table:
- The Student table contains general information about students,
such as their ID, name, gender, age, date of birth, place of birth, and
nationality.
- The primary key in this table is the StudentID column.

2 - Certificate Table:

- The Certificate table stores information about certificates obtained


by students.
- Each certificate is associated with a specific student using the
StudentID column, which acts as a foreign key referencing the
Student
table's primary key.

3 - Contacts Table:

- The Contacts table holds contact information for students,


including their address, phone number, and parent's contact
information.
- Each contact record is linked to a particular student using the
StudentID column, which acts as a foreign key referencing the
Student table's primary key.

4 - Financials Table:

- The Financials table contains financial information related to


students, such as the total amount paid, remaining installment
amount, and duration of payment.
- Each financial record is connected to a specific student using the
StudentID column, which acts as a foreign key referencing the
Student table's primary key.
5 - Behaviors Table:

- The Behaviors table records behavioral information about


students, including warnings, personal cleanliness, behavior, month,
and year.
- Each behavior record is associated with a particular student using
the StudentID column, which acts as a foreign key referencing the
Student table's primary key.

Certificate table :

Student table :
Behavior table :

Finance table :
Contact table :

all information about student 1 like (behavior, certificate, cantact,


financial) :
There is a form for student 1 that I took the information from the
student table and I made a relation between student table and
behavior table and I made a sub form for the behavior of the
student.

There is a form for student 1 that I took the information from the
student table and I made a relation between student table and
contact information and I made a sub form for the contact
information of the student.
behavior report for all students , in it the student id (foreign key )
and behavior id and in it the monthly report for all student :

Student report for all students , in it there is an the IDStudnet and


names of the students and the age and I made relation with behavior
table and there is the years , for example student id: 1 , name : john
smith , age: 23, behaviorID : 1 , behaviorID_StudentID : 1, year :
2023 :

Certificate report for all students , in this report I been put the
student_id and I made relation with certificate table for example :
student 2 have been taken at the previous year M and in the current
:
Finance report for all students , in it I put student id and I made
relation with the finance table for example : student_id 3 he paid at
thes year 3800 and the rest is up is 0 and the
For_how_many_months paid 12 months :

Menu (quick links ) for example if you click at student button it will
go to student report :
sub form, in it the student information from student table and from
certificate for example we took the student information from
student table and certificate information from certificate table .

sub form , in it the student information


from student table and student information
from contact table for example like address
and parent phone number .
conclusion :
- The Student table stores general information about students.
- The Certificate table stores information about certificates
obtained by students and is linked to the Student table.
- The Contacts table stores contact information for students and
is linked to the Student table.
- The Financials table stores financial information related to
students and is linked to the Student table.
-
-
- The Behaviors table stores behavioral information about
students and is linked to the Student table.
In summary, the Student table is the central table that contains
general student information, and the other tables are connected to it
to store specific details related to certificates, contacts, financials,
and behaviors.

You might also like