RDBMS is the basis of all SQL databases like; MS SQL Server, Sysbase, Oracle, MySQL, etc. It works on the base of a relational database model. The RDBMS stores all its data in the form of an object that is called Table. A Table consists of columns, rows, and related data entry fields.
Given below is an example of the table, consisting of 4 columns and 2 rows with the data entry fields as; ID, name, age, and address.
ID
|
Student Name
|
Age
|
Address
|
10
|
John
|
25
|
Brooklyn
|
20
|
Edward
|
24
|
Florida
|
30
|
Michael
|
23
|
Peru
|
A Table, The collection of all entities is called filling in the table. For example: fields in the above table are id, student name, age and address.
A record, in the table is each individual entry in the table.
A null value, in the table is the value that appears to be blank and a null value is different than zero value.
SQL Constraints:
SQL Constraints are used on the data columns in table. It is also limited to, use the type of data in a table which in turn ensures the reliability and accuracy of the data in the database. Constraints could be of a column or table label. The column label constraint is used only in one column and table label constraint is used in the entire table.
There are following constraints used in SQL:
• NOT NULL Constraint: It is used to ensure column value is not null.
• UNIQUE Constraint: It is used to ensure all values are different in a column.
• DEFAULT Constraint: It is used to provide value to a column when none is specified.
• INDEX: It is used to create and retrieve data from the database.
• PRIMARY KEY: It is used to identify records or rows in a database table.
• FOREIGN KEY: It is used to identify each record or row in a database table.
• CHECK: It is used to ensure all values in the column to satisfy a certain condition.
Data Integrity:
The following data integrity exists with RDBMS:
• Entity Integrity: It ensures that there are no duplicate rows in a table.
• Domain Integrity: It ensures entries in a column by restricting its type, range of values and format.
• User Defined: It enforces some specific rules.
• Referential Integrity: It ensures row’s data, which are used by other records isn’t deleted.
Database Normalization:
Database normalization is the process to organize the data. It is used to eliminate redundant data from the database, e.g. storing same data for more than one table records and ensuring data dependencies as well. All these features reduce the spaces used in the database and make sure that data is logically stored in the database. Normalization helps to create a better data structure. There are three normalization forms used in the database.
1NF (First Normal Form):
It is used to set basis set of rules to the database:
• Defines data items in the table.
• Ensures repeated data groups in the table and ensures there is a primary key.
2NF (Second Normal Form):
2NF states that all 1NF rules meet the requirement and ensures that there is no partial dependency of the column for the primary key.
3NF (Third Normal Form):
It ensures all rules of 2NF and all non-primary fields are dependent on the primary key.
ID
|
Student Name
|
Age
|
Address
|
30
|
Michael
|
23
|
Peru
|
30
|
Michael
|
23
|
Ireland
|
30
|
Michael
|
23
|
USA
|
According to the 1NF rule, the repeated groups will be divided into two parts or table:
ID
|
Student Name
|
Age
|
30
|
Michael
|
23
|
Set primary key on the second table, then the result would be:
Note: Primary is applied on both the above tables.
Primary_ID
|
Student ID
|
Address
|
1
|
30
|
Peru
|
2
|
30
|
Ireland
|
3
|
30
|
USA
|
Conclusion:
I have explained briefly about the RDBMS on SQL Server, there data storage, table creation with entries and records, SQL constraints, data integrity to ensure how data is carried out and managed, database normalization for organizing data structure and their accuracy to bring out the database in a well organized manner. Further, I will also be explaining more details about RDBMS.
0 comments:
Post a Comment