Normalization:
Normalization is a process that helps database designers to design the table
structure for an application. The main concept of normalization is to reduce
redundant table data to the very minimum.
structure for an application. The main concept of normalization is to reduce
redundant table data to the very minimum.
By normalization process, collection of data in a single table table is replaced,
by distributing the same data over multiple tables with a very specific relationship
between those tables.
by distributing the same data over multiple tables with a very specific relationship
between those tables.
Though it has disadvantage, when we apply the process of normalization to any
table, it takes much longer time to perform a query and retrive the data from
group of table.
table, it takes much longer time to perform a query and retrive the data from
group of table.
There are many forms of normalization, three of them are as follows:
1. First Normal Form:
When table is decomposed into two-dimensional tables with all repeating
groups of data eliminated, the table is said to be in its first normal form.
groups of data eliminated, the table is said to be in its first normal form.
Lets uderstand this by an example:
Table : EmpProj
Data held in above table structure:
A table is in first normal form if:
There are no repeating groups.
All the key attributes are defined.
All attributes are dependent on a primary key.
To convert a table to its First Normal Form :
1. The unnormalized data in the first table is the entire table.
2. A key that will uniquely identify each record should be assigned to the table.
This key has to be unique because it shoule be capable of identifying any specific
row from table. This key is called Primary key.
This key has to be unique because it shoule be capable of identifying any specific
row from table. This key is called Primary key.
Table: EmpPro
This table is now in first normal form.
2. Second Normal Form :
SQL
Introduction:
SQL is a language used to operate databases; it includes database creation,
deletion, modifying rows, etc.
deletion, modifying rows, etc.
SQL is Structured Query Language, which is a computer language for storing,
manipulating and retrieving data stored in database.
manipulating and retrieving data stored in database.
SQL is a ANSI (American National Standards Institute) standard language,
but there are many versions of the SQL language.
but there are many versions of the SQL language.
Systems like MySQL, Ms-Access, Oracle, Sybase and SQl Servers use SQL
as their standard database language.
as their standard database language.
Why SQL ?
- Allows users to access data in the relational database management systems.
- Allows users to describe the data.
- Allows users to define the data in a database and manipulate that data.
- Allows to embed within other languages using SQL modules,
- Allows users to create and drop databases and tables.
- Allows users to create view, stored procedure, functions in a database.
- Allows users to set permissions on tables, procedures and views.
SQL Delimiters :
SQL delimiters are symbols, which have special meanig within SQL and
PL/SQL statements.
PL/SQL statements.
No comments:
Post a Comment