summaryrefslogtreecommitdiff
path: root/assignments/exam/README.md
blob: dad52d407f2acc6d72a695ac0f03e8b0cdd9a1dd (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
# 1

A real estate company uses a database to store information about customers, property, and contracts.
The following relations are used in the database:

Customer:
  * Customer number (unique)
  * name
  * mailing address
  * Balance
  * lawyer name
  * Discount

Contract:

  * Customer number (unique)
  * Agent number (unique)
  * Property_ID (one per contract)
  * Date of contract
  * Property addresses
  * Property value
  * Type
  * Number of rooms
  * Land size
  * Built size
  * Tax value

The following functional dependencies apply:

* customer_no -> name
* customer_no -> mail_address
* customer_no -> balance
* customer_no -> lawyer_name
* customer_no -> discount
* {customer_no, Agent_no} -> propert_id
* {customer_no, Agent_no} -> date_contract
* property_id -> property_address
* property_id -> value
* property_id -> type
* property_id -> number_rooms
* property_id -> land_size
* property_id -> built_size
* property_id -> tax_value

Transform these relations into 3NF (please use only the attributes described above, and do not add any new attributes).

Normal forms:

1. 0 multi-valued attributes
2. 0 functional dependencies
3. 0 transitive dependencies

Before:

* Customers(_id_, name, mail_address, balance, lawyer_name, discount)
* Contract(_id_, customer_id, agent_id, date_of_contract, property_address, property_value, type, number_of_rooms, land_size, built_size, tax_value)

After:

* customers(id, name, mail_address, balance, lawyer_name, discount)
* contracts(id, customer_id, agent_id, property_id, date_of_contract)
* properties(id, address, value, type, number_of_rooms, land_size, built_size, tax_value)