Sie sind auf Seite 1von 17

ASSIGNMENT-1

ERD AND
NORMALIZATION
Question 1: Identify the main Entity types.
Answer:

ENTITY

CUSTOMER

ATTRIBUTES
CustomerId, CName, CType, Addr, Age, Occupation, MIncome, AcNo.

ENTITY

ACCOUNT

ATTRIBUTES
AcNo, AcType, MinBal, ATM, InterestRate, Duration, PBook, AcStatus,
CustomerId, Balance, MinBal.
ENTITY

TRANSACTION

ATTRIBUTES
TId, AcNo, TType, AmtWithdrawn, AmtDeposited

ENTITY
BRANCH

ATTRIBUTES
BranchId, BName, Addr
Question 3: Give the detailed file design for the system.
Answer : FILE DESIGN
CUSTOMER
NAME TYPE SIZE PRIMARY CONSTRAINTS DESCRIPTION
KEY

CustomerId VARCHA 10 YES


R

CType CHAR 8 Senior/young

Addr VARCHA 50
R

Age INTEGER 4

Occupation CHAR 10

MIncome FLOAT 10 Monthly income

AcNo VARCHA 10 Foreign key Account no


R
ACCOUNT
NAME TYPE SIZE PRIMARY CONSTRAINTS DESCRIPTION
KEY
AcNo VARCHA 10 YES
R
AcType CHAR 15 savings, current
etc
MinBal Integer 5 Min balance for
account
ATM CHAR 4 Atm issued
(yes/no)
InterestRate FLOAT 5

Duration INTEGER 4 Duration of


deposit
PBook CHAR 4 Pass book issued
(yes/no)
AcStatus CHAR 8 Account status
(opened/clo
sed)
Balance INTEGER 12

MinBal INTEGER 5 Minimum


balance
CustomerId VARCHA 10 FOREIGN KEY
R
TRANSACTION

NAME TYPE SIZE PRIMARY CONSTRAINT DESCRIPTIO


KEY S N

TId VARCHA 10 YES


R

AcNo VARCHA 10 FOREIGN


R KEY

TType CHAR 8 Transaction


type

AmtWithdraw VARCHA 50 Amount


n R withdraw
n

AmtDeposited INTEGER 4 Amount


deposited
BRANCH

NAME TYPE SIZE PRIMARY CONSTRAINTS DESCRIPTION


KEY

BranchId VARCHAR 10 YES

BName CHAR 20 Branch name

Addr VARCHAR 50
Question 4: Normalize the above tables.
Answer :

1st Normal Form


A relation in which the intersection of each row and column produce only one value.
Approach 1: Flattening the table.
Approach 2: Break into separate tables
(remove repeating groups with a copy of determinant).

All tables are already in 1st normal form.

2nd Normal Form


A relation in 1st normal Form and each non-primary key attribute
is fully functionally dependent on any candidate key.
(Remove partial dependency).

CUSTOMER
Fd1 (primary key): CustomerId CName, CType, Addr, Age,
Occupation, MIncome, AcNo
ACCOUNT
Fd1(primary key):AcNo AcType, ATM, PBook, AcStatus, CustomerId, Balance.

Fd2 (partial dependency): AcTypeInterestRate, Duration, MinBal.

TRANSACTION
Fd1(primary key): TId AcNo, TType, AmtWithdrawn, AmtDeposited

BRANCH
Fd1(primary key): BranchId BName, Addr

3rd Normal Form


A relation in 1NF and 2NF and no non-primary key attribute has transitive
dependency on any candidate key.

No transitive dependency.
MODIFIED TABLES

CUSTOMER
NAME TYPE SIZE PRIMARY CONSTRAINTS DESCRIPTION
KEY

CustomerId VARCHA 10 YES


R

CType CHAR 8 Senior/young

Addr VARCHA 50
R

Age INTEGE 4
R

Occupation CHAR 10

MIncome FLOAT 10 Monthly income

AcNo VARCHA 10 Foreign key Account no


R
ACCOUNT
NAME TYPE SIZE PRIMARY CONSTRAINTS DESCRIPTION
KEY

AcNo VARCHAR 10 YES

AcType CHAR 15 savings, current


etc

ATM CHAR 4 Atm issued


(yes/no)

PBook CHAR 4 Pass book issued


(yes/no)

AcStatus CHAR 8 Account status


(opened/clos
ed)
Balance INTEGER 12

CustomerId VARCHAR 10 FOREIGN KEY


ACC_TYPE

NAME TYPE SIZE PRIMARY CONSTRAINTS DESCRIPTION


KEY

AcType VARCHAR 15 savings, current


etc

MinBal INTEGER 4 Minimum


balance

Duration INTEGER 4 Duration of


deposit

InterestRate FLOAT 8 Rate of interest


TRANSACTION
NAME TYPE SIZE PRIMARY CONSTRAINTS DESCRIPTION
KEY

TId VARCHAR 10 YES

AcNo VARCHAR 10 FOREIGN KEY

TType CHAR 8 Transaction type

AmtWithdrawn VARCHAR 50 Amount


withdrawn

AmtDeposited INTEGER 4 Amount


deposited
BRANCH

NAME TYPE SIZE PRIMAR CONSTRAI DESCRIPTIO


Y NTS N
KEY

BranchId VARCHA 10 YES


R

BName CHAR 20 Branch name

Addr VARCHA 50
R
THANK YOU!!!

NO QUERIES PLEASE!!

Das könnte Ihnen auch gefallen