Download as pdf or txt
Download as pdf or txt
You are on page 1of 6

‫مشروع اساسيات قواعد البيانات‬

‫إعداد وتنفيذ الطالبات‪:‬‬

‫روان سالم الزهراني‬ ‫‪)1‬‬


‫نادية المالكي‬ ‫‪)2‬‬
‫شيراز العمري‬ ‫‪)3‬‬
‫وفاء الحارثي‬ ‫‪)4‬‬
‫عذاري الشلوي‬ ‫‪)5‬‬

‫‪1‬‬
List the names of all the entity types in the specification above and for
each entity type specify the list of attributes

1: airplane

field Date type description constrains


AP_ID INT Field will store unique row Primary key
number
AP_NUMBER VARCHAR Air plane number that Not Null
(32) identifies the plane
Capacity INT NO OF Seats a variable Not Null
MFDBY VARCHAR Manufacturing company Not Null
(128)
MFDON DATETIME Manufacturing Date of plane Not Null
AP_TYPE VARCHAR Describe by name Not Null
(32)

2: technician

field Date type description constrains


TC_ID INT Unique row id unique Primary key
TC_NAME VARCHAR Technician Name Not Null
(32)
ADDRESS VARCHAR Technician Address Not Null
(64)
AGE INT Technician Age Not Null
NATIONALITIES VARCHAR Nationality of Technician Not Null
(16)
SALARY INT Salary of Technician Not Null
CONTACT INT Contact ID From Foreign key

2
3: pilot

field Date type description constrains


P_ID INT Unique row id Primary key
Name VARCHAR Pilot name Not Null
(32)
ADDRESS VARCHAR Pilot address Not Null
(64)
Age INT Pilot age Not Null
Salary INT Pilot salary Not Null
Number of INT Pilot experience Not Null
experience

4: flight

field Date type description constrains


FIELD INT Unique number to identify the Primary key
flight
NUM_Polit INT The number of polite on the Not Null
flight
FLIGHT_DATE DATETIME Date of flight Not Null
DEPARTURE DATETIME Store the departure time of Not Null
flight
ARRIVAL DATETIME Store the arrival time of flight Not Null
on destination
AIR_CRAFT INT Aircraft number that will fly Foreign key
NET_FARE INT To Determine total fare of Foreign key
flight an id from
5: maintenance (the test)

field Date type description constrains


Test_NUM INT Number of functional test Primary key
BER
Name VARCHA Technician Name Not Null
R (32)
Report VARCHA RESULT OF TEST Not Null
R (64)
TEST_DAT DATETIM Date of test Not Null
E E

3
LIST the names of all the Relationship in the specification above and
for each Relationship type specify, if exist , the last of attribute and
the cardinality of each relation

Cardinality notation, using Chen style

M=MANY , N=0,1,2

SN ENTITIES CARDINALITY
1 AIRPLANE & FLIGHT 1:M
2 PILOT &AIRPLANE M:1
3 TECHNICIAN & AIRPLANE M:1
4 THE TEST & AIRPLANE M:1
5 TECHNICIAN & THE TEST 1:M

DRAW AN ER DIGRAM THAT CAPTURES THE INFORMATION


CREATED ABOVE

TECHNICIAN
HAVE
THE TEST

HAVE
HAVE

AIRPLANE
FLIGHT HAVE
VEVE
4
ANSWER EXERCISE 2

4: LIST THE STRONG (NON WEAK) ENTITY TYPES IN THE ER


DIGRAM

• Bank
• Account
• Loan
• Customer

5: Is there a weak entity type? If so , give its name and its partial key
• Weak entity type : bank_branch
• Partial key : branch_no
• Identifying relationship : branches
• A bank_branch cannot exist without an associated bank

6: list on the following table the all relationship type, and specify the
constraint type on each participation (partial or total) of an entity in
relationship type
Relationship First entity Second entity Participation first and
name second entity
branches bank Bank_branch 1:N
accts Bank_branch account 1:N
loans Bank_branch loan 1:N
A_C account customer N:M
L_C loan customer N:M

7: CONVERT THE ABOVE ER DIAGRAM INTO A RELATIONAL


SCHEMA

1: CUSTOMER

field Date type


Ssn STRING
Name STRING
ADDRESS STRING
PHONE STRING

5
2: Bank

field Date type


code STRING
Name STRING
ADDRESS STRING

3: bank_branch

field Date type


Branch_no STRING
code STRING
ADDRESS STRING

4: ACCOUNT

field Date type


Acct-No STRING
Balance REAL
TYPE STRING
Branch_no STRING
Code STRING

5: Loan

field Date type


loan-No STRING
TYPE STRING
Amount REAL
Branch_no STRING
Code STRING
Ssn STRING

You might also like