Sie sind auf Seite 1von 7

Database Project Part 1

Case Used : Database of a school .


Students name who is working on this project:
Meshari Alturki 1407462

This project contain :


1-Descrption of the project

2- Identifying The Entities and The


Relations
3-ER diagram
4- Queries

1-Descrption of the project:


Database school is organized into teachers , each teacher has an

tID,tname,job_name,tsalary,work_days,specialty.
School has a

school_no, school_name

School has students , each student has ,

SID,Sname,age,GPA,attendees,Edc_Level,Address,ParentNo.
School has a classes , each class has

classNo,class_name,floorNo.

School has courses , each course has cname,cno,cclass,chours


School has bills ,each bill has Bill_date,Bill_price ,Bill_No.
School has a restaurant , restaurant has a
pro_name,pro_no,pro_price,expiration_date
School has service like
competitions,comp_name,comp_date,comp_cost,comp_orgnizer,co
mp_staff,comp_events,comp_gifts.
School has trips and each trip has
trip_bus,trip_date,trip_supervisor,trip_name,trip_cost.

2- Identifying The Entities and The


Relations
Entities
Attributes
Teacher(str tID,tname ,tsalary,work_days,specialty.
ong entity)
student(stro SID,Sname,age,GPA,attendees,Edc_Level,Address,ParentNo.
ng entity)
class(strong classNo, floorNo.
entity)
Bill_date,Bill_cost,Bill_no
Bill(week
entity)
Restaurant pro_name,pro_no,pro_price,expiration_date
(strong
entity)
competition comp_name,comp_date,comp_cost,comp_orgnizer,comp_events,co
Trip(week
entity)
course(stro
ng entity)
School(stro
ng entity)

mp_gifts
trip_bus,trip_date,trip_supervisor,trip_name,trip_cost
cname,cno,cclass,chours
school_name,school_no

Relations :
School:
Each school has many students
Each school has many teacher
Each school has many class
Each school has many bills
Each school has one restaurant
Each school has many competition
Each school has many trips
Each school has many courses
Teacher :
Each teacher has many students
Each teacher has many class
Each teacher has many courses
Students:
Each Student has many teacher
Each Student has one class
Each Student has many competition
Each Student has many trips
Each Student has many courses

3-ER diagram

4- Queries:

1.select sName from student where


sID=12345;
2.select tName from teacher where tsalary
>5000;
3.select sName from student,course
Where cno=10;
4.select bill_name from bill where
bill_cost>1000;
5.select trip_name from trip where
trip_date=10-JON-2016);
6.select * from course where cname =
MATH;
7.select sname , age from student
Where age >any(select age from student
where sid =12345);
8.select tname ,works_day,tsalary from
teacher
Where tsalary in (select max(tsalary)from
teacher group by tID);

9.select tname ,tid,tsalary from teacher


where tsalary > all(select avg(tsalary)
from teacher group by tid);
10.select tname ,tsalary , from teacher
Where school_no in (select school_no
from school
Where school_name in(KAU,MTA));

Das könnte Ihnen auch gefallen