You are on page 1of 4

types of dbms:-

1)HDBMS(hirarchical database management system)


2)ODBMS(object database management system)
3)NDBMS(network database management system)
4)RDBMS(relational database management system)

1)HDBMS:- it stores the data in the form of tree structure.


-->dis:- complex ,data redundancy,it is difficult to implement
--> if you make changes in the database structure you need to change the entire
application.
ex:- company details.

2)NDBMS:- it stores the data in the form of graph.


--> complex so there may be performance problem, it is not user friendly
(structure)
ex:- google map

3)ODBMS:- it stores the data in the form of object.


ex:- java
-->complex so there may be performance problem.

4)RDBMS :- easy to use. (75%)

Normalization:- process of desiging the database effectively such that we can avoid
anomalies.
(or)
decomposing or splitting the large table into small tables is known as
normalization.
(or) to organize the data in a very good form we use normalization.

normal form:- the table which is not having data redundancy and anomalies is said
to be in normal form.

anomalies(problems arise from relations that generated from user views are called
anomalies)(INSERT,UPDATE OR DELETION anomalies).

1NF :- first Normal Form


--> the table should not have multiple values in a single cell.
(should have atomic value)
-->each row must be uniquely identified by one attribute or more than one attribute
but primary key is not mandatory.

(de-normalized table)
O_NO QUANTITY ITEM_PRICE ORDER_DATE STATUS PRO_CODE PRO_NAME
PRO_PRICE CUST_NAME PHONE PINCODE STATE CITY
101 33 200 01-Jan-23 shipped p_1 CYCLE
200 A 9988009988 571199 M AA
102 44 333 12-Feb-23 cancelled p_2 CLASSIC CAR
400 B 9980807080 571199 M AA
103 55 400 15-Mar-23 shipped p_3 CAR
500 C 9988707089 571196 O CC
104 66 700 15-Mar-23 on hold p_4 BUS
600 D 8766554433 571194 P DD
105 77 1200 19-Jun-23 shipped p_5 TRUCK
800 E 8722334455 571933 Q EE
106 5,5 1200,700 02-Jun-23 shipped p_4,p_5 BUS,TRUCK
600,800 F 9365879087 571192 R FF
(Convert into 1NF) :- (O_NO || PRO_CODE) -->candidate key (combination of these two
uniquely identify the table).

O_NO QUANTITY ITEM_PRICE ORDER_DATE STATUS PRO_CODE PRO_NAME


PRO_PRICE CUST_NAME PHONE PINCODE STATE CITY
101 33 200 01-Jan-23 shipped p_1 CYCLE
200 A 9988009988 571199 M AA
102 44 333 12-Feb-23 cancelled p_2 CLASSIC CAR
400 B 9980807080 571199 M AA
103 55 400 15-Mar-23 shipped p_3 CAR
500 C 9988707089 571196 O CC
104 66 700 15-Mar-23 on hold p_4 BUS
600 D 8766554433 571194 P DD
105 77 1200 19-Jun-23 shipped p_5 TRUCK
800 E 8722334455 571933 Q EE
106 5 1200 02-Jun-23 shipped p_4 BUS
600 F 9365879087 571192 R FF
106 5 700 02-Jun-23 shipped p_5 TRUCK
800 F 9365879087 571192 R FF

2NF:- it must be in 1NF .


--> it should not have partial functional dependency.

-->the non-key-attribute must fully dependent on candidate key.


i.e if a non-key column is partially dependent on candidate key,then split them
into separate tables.
-->every table should have primary key and relationship between the tables should
be formed using foreign key.

(convert into 2NF)


ORDER TABLE

O_ID (PK) O_NO QUANTITY ITEM_PRICE ORDER_DATE STATUS


1 101 33 200 01-Jan-23 shipped
2 102 44 333 12-Feb-23 cancelled
3 103 55 400 15-Mar-23 shipped
4 104 66 700 15-Mar-23 on hold
5 105 77 1200 19-Jun-23 shipped
6 106 5 1200 02-Jun-23 shipped
7 106 5 700 02-Jun-23 shipped

PRODUCT TABLE
P_ID(PK) PRO_CODE PRO_NAME PRO_PRICE
11 p_1 CYCLE 200
12 p_2 CLASSIC CAR 400
13 p_3 CAR 500
14 p_4 BUS 600
15 p_5 TRUCK 800

C_ID(PK) CUST_NAME PHONE PINCODE STATE CITY


1111 A 9988009988 571199 M AA
1112 B 9980807080 571199 M AA
1113 C 9988707089 571196 O CC
1114 D 8766554433 571194 P DD
1115 E 8722334455 571933 Q EE
1116 F 9365879087 571192 R FF

RELSTIONSHIP TABLE
(PK)O_ID P_ID C_ID
1 11 1111
2 12 1112
3 13 1113
4 14 1114
5 15 1115
6 14 1116
7 15 1116

3NF:- it must be in 2NF


-->Avoid transitive functional dependency.
--> A->B B->C
remove B and C and make a foreign key relation.

key attribute:- (primary key) --> empno is primary key


other than primary key all are non-key attribute.

(Convert into 3NF)


ORDER TABLE

O_ID (PK) O_NO QUANTITY ITEM_PRICE ORDER_DATE STATUS


1 101 33 200 01-Jan-23 shipped
2 102 44 333 12-Feb-23 cancelled
3 103 55 400 15-Mar-23 shipped
4 104 66 700 15-Mar-23 on hold
5 105 77 1200 19-Jun-23 shipped
6 106 5 1200 02-Jun-23 shipped
7 106 5 700 02-Jun-23 shipped

PRODUCT TABLE
P_ID(PK) PRO_CODE PRO_NAME PRO_PRICE
11 p_1 CYCLE 200
12 p_2 CLASSIC CAR 400
13 p_3 CAR 500
14 p_4 BUS 600
15 p_5 TRUCK 800

C_ID(PK) CUST_NAME PHONE PINCODE


1111 A 9988009988 571199
1112 B 9980807080 571199
1113 C 9988707089 571196
1114 D 8766554433 571194
1115 E 8722334455 571933
1116 F 9365879087 571192

A->B B->C
C_ID->PINCODE PINCODE-->CITY,STATE
PINCODE STATE CITY
571199 M AA
571196 O CC
571194 P DD
571933 Q EE
571192 R FF

You might also like