Posts

Showing posts with the label database

SQL vs NOSQL

Image
Differences between Sql and Nosql Database:

1NF,2NF, 3NF Normalization

Image
If you want to know more about normalization and keys refer this posts: http://vinayjallipalli75996.blogspot.in/2016/12/different-type-of-keys-in-database.html http://vinayjallipalli75996.blogspot.in/2016/12/normalization-in-database.html 1NF : Composite attribute are not allowed. 2NF: All non prime attributes are fully functional dependent with primary key.that is non prime attributes should not be partially dependent on primary key. 3NF: There should not be any dependency between non prime attributes.               Example For 3NF (see the below fig.): student id,name, dob , street,city, zip,state->>>                        1)sid,name,dob                        2)zip, city, state, Street becoz zip is dependent on rest of the three.

Normalization in Database.

Image
What is normalisation in simple terms?? The process of organising data into columns and tables such as to reduce redundancy in the data is called normalisation. And to avoid insert, delete, and update anomalies. From ☝ answer many of you know about redundancy but not anomalies,  So what is a anomaly? Anomalies are problems that can occur in Poorly planned, un-normalised databases where all the data is stored in one table (a flat-file database). There are 3 types of anomalies  insert anomaly delete anomaly update anomaly I will explain the above with a simple example instead of explaining them with formal defnitions. Consider the below table. From the above table : Redundancy: When ever i add a student of cse department, the information about the department(i.e department name, hod and phone number) is repeating as you can see in above table. This redundancy should be reduced when you normalize the database. Insert anomaly: If i want to ...

Different Type of keys in Database Managemenet System.

Image
All super, candidate and primary, secondary keys are used to uniquely distinguish all rows in data base. But the main difference between them is. Super 🔑 -superset of candidate keys Candidate 🔑 -subset of super key, it is a single key or least combination of feild that uniquely  identifies every tuple. Primary 🔑- it is a candidate key that is most appropriate to become main key for the table. Secondary 🔑- candidate keys which are not selected as primary keys. Non-key attributes (attributes other than candidate keys) Non prime attributes (attributes other than primary key) Foreign 🔑?? It is a feild in one table that uniquely identifies a row in another table They are constraints between column of tables. Example: