wiki:WikiStart/Normalization/vtora_verzija

Version 21 (modified by 203206, 4 weeks ago) ( diff )

mk2

Нормализација

Определување на функционални зависности

transaction_id = R { account_id, username, e-mail, password, balance, transaction_id, amount, type, timestamp, s_id, r_id, withdraw_id, deposit_id, transferred_id, currency }

account_id -> username, e-mail, password, balance

transaction_id -> amount, type, timestamp, account_id

withdraw_id -> account_id, amount, timestamp

deposit_id -> account_id, amount, timestamp

transferred_id -> s_id, r_id, transaction_id, currency

Лево

  • account_id
  • transaction_id
  • withdraw_id
  • deposit_id
  • transferred_id

Десно

  • username
  • e-mail
  • password
  • balance
  • amount
  • type
  • timestamp
  • currency

Двете

Во мојата шема за база нема атрибут што се јавува како примарен клуч и истовремено надворешен во некоја од табелите.

Покривачи

account_id += {username, e-mail, password, balance} не ги содржи сите атрибути

transaction_id += {amount, type, timestamp, account_id} не ги содржи сите атрибути

withdraw_id += {account_id, amount, timestamp} не ги содржи сите атрибути

deposit_id += {account_id, amount, timestamp} не ги содржи сите атрибути

transferred_id += { s_id, r_id, transaction_id, currency } не ги содржи сите атрибути

account_id, transaction_id += {username, e-mail, password, balance, amount, type, timestamp, account_id} не ги содржи сите атрибути

account_id, transaction_id, transferred_id += {username, e-mail, password, balance, amount, type, timestamp, account_id, s_id, r_id, transaction_id, currency} само оваа комбинација одговара за примарен клуч и него го избираме

Декомпозиција

Сите табели имаат соодветен примарен клуч и правилно се референцирани надворешните клучеви. Според тоа тие исполнуваат 1NF. Во сите табели колоните кои немаат функција за чување на примарен клуч, не се зависни една од друга, туку од нивниот соодветен примарен клуч. Нема транзитивна зависност. Сепак некои табели не го исполнуваат 2NF

R1 {account_id, username, email, password, balance} е во BCNF

R2 {amount, type, timestamp, account_id, s_id, r_id, transaction_id, currency}

R2 не ја задоволува BNCF затоа што account_id, timestamp -> amount

R21 {s_id, r_id, transaction_id, currency} е во BNCF

R22 {amount, type, timestamp, account_id}

Note: See TracWiki for help on using the wiki.