2nd Normal Form in SQL

Advertisements

SQL Naming Conversion SQL Command

Second Normal Form in SQL DataBase

In 2nd Normal form maintain the 1st Normal form and remove the partial function dependency. For a table to be in the Second Normal Form,

  • It should be in the First Normal form
  • It should not have Partial Dependency

What is Dependency

We take example of a Employee table with columns EMP_id, Name, Mobile_No and Dept.

EMP_idNameMobile_NoDept

In Employee table, EMP_id is the primary key and will be unique for every row, hence we can use EMP_id to fetch any row of data from this table

Even for a case, where student names are same, if we know the EMP_id we can easily fetch the correct record.

EMP_idNameMobile_NoDept
101Hitesh8076671483HR
105Hitesh8882538826Support

Hence we can say a Primary Key for a table is the column or a group of columns(composite key) which can uniquely identify each record in the table.
I can ask from branch name of Employee with EMP_id 101, and I can get it. Similarly, if I ask for name of Employee with EMP_id 101 or 105, I will get it. So all I need is EMP_id and every other column depends on it, or can be fetched using it. This is Dependency and we also call it Functional Dependency.

Any Candidate key (K) and any Attribute (A) that is not a constituent of a candidate key, A depends upon whole of K rather than just part of it
This means all its non-prime attributes are functionally dependent on the whole of a candidate key.

In Simple terms, any non-key columns must be dependent on the entire primary key. In the case of a composite primary key, this means that a non-key column cannot depend on only part of the composite key.


SQL Naming Conversion SQL Command

Google Advertisment

Buy This Ad Space @$20 per Month, Ad Size 600X200 Contact on: hitesh.xc@gmail.com or 9999595223

Magenet is best Adsense Alternative here we earn $2 for single link, Here we get links ads. Magenet

For Projects 9999595223

Google Advertisements


Buy Websites 9999595223

Buy College Projects with Documentation Contact on whatsapp 9999595223. Contact on: hitesh.xc@gmail.com or 9999595223 Try this Keyword C++ Programs

Advertisements