Tải bản đầy đủ (.docx) (3 trang)

Assignment1 14130067st hcmuaf edu vn

Bạn đang xem bản rút gọn của tài liệu. Xem và tải ngay bản đầy đủ của tài liệu tại đây (61.77 KB, 3 trang )

For the following requests, pack your answers into the zip file Assignment1_AccountName.zip,
then handle to the evaluator via email ()
Barem: Q1-30%, Q2.1-40%, Q2.2-30%

Question 1
Consider the following relations for a database that keeps track of student enrollment in courses
and the books adopted for each course (Primary Key is mark post-fix with #):
CUSTOMER(id#, cd#, version#, name, addr, representative)
T_ORDER(id#, type, cd, name, customer_cd, customer_version, received_date,
request_content)
ESTIMATION(id#, cd, order_cd, total_amount)
Draw a relational schema diagram specifying the foreign keys for this schema.
Answer:

Note: # primary key, đuôi

là foreign key

Question 2
Given the order table with following initial structure (Primary Key is mark post-fix with #)
Orde
r
1001
1002
1003

Customer Information
Cust Name Addr
41
42
43



Jones
Smith
Jones

121 1st
222 2nd
121 1st

Quant
1
200
1
10

Part1

Amt1

Screw
Motor
Saw

2.00
52.00
121.00

Quant
2
300

5

Part2

Amt2

Nut
Brace

2.25
44.44

Quant
3
100

Part3
Wasshr

Please:
1. Normalize that table structure to the first, second and third normalization forms
2. Draw relational schema diagram for the tables defined in the third normalization form above

Amt
3
0.75


Answer:
Q2.1

+ 1F
Orde
r
1001
1001
1001
1002
1002
1003

Customer Information
Cust Name Addr
41
41
41
42
42
43

Jones
Jones
Jones
Smith
Smith
Jones

121 1st
121 1st
121 1st
222 2nd

222 2nd
121 1st

Quant

Part

Amt

100
200
300
1
5
10

Wasshr
Screw
Nut
Motor
Brace
Saw

0.75
2.00
2.25
52.00
44.44
121.00


+ 2F

Orde
r
1001
1002
1003

Customer
Information
Cust Name

Addr

41
42
43

121 1st
222 2nd
121 1st

Jones
Smith
Jones

Orde
r
1001
1001

1001
1002
1002
1003

Quant

Part

Amt

100
200
300
1
5
10

Wasshr
Screw
Nut
Motor
Brace
Saw

0.75
2.00
2.25
52.00
44.44

121.00

+ 3F
Customer
Information
Cust Name
41
Jones
42
Smith
43
Jones

Q2.2

Addr
121 1st
222 2nd
121 1st

Orde
r
1001
1001
1001
1002
1002
1003

Quant


Part

Amt

100
200
300
1
5
10

Wasshr
Screw
Nut
Motor
Brace
Saw

0.75
2.00
2.25
52.00
44.44
121.00

Orde
r
1001
1002

1003

Cust
41
42
43


Note: #:primary key, đuôi

là foreign key



×