Relational Databases

What is Database ?
  • A database is an organized collection of data.
  • The main purpose of database is to operate large amount of information by storing, retrieving and managing.

What is RDBMS ?
  • RDBMS stands for Relational Database Management Systems.
  • All modern database management systems like SQL, MS SQL Server, IBM DB2, ORACLE, My-SQL and Microsoft Access are based on RDBMS.
  • It is called Relational Data Base Management System (RDBMS) because it is based on relational model introduced by E.F. Codd.
  • RDBMS is a subset of DBMS with relationship between tables.

How it works ?
  • Data is represented in terms of tables. 
  • we'll call columns as attributes or fields and rows as records or tuples.
  • It contains number of tables and each table has its own primary key.
  • Due to a collection of organized set of tables, data can be accessed easily in RDBMS.

What is a Primary key ?


  • A primary key is a table column that can be used to uniquely identify every row of the table.
  • A table can have many candidate keys but only one primary key. The primary key cannot be null. 
  • In this example, FirstName is a Primary key, because it is the only column that is unique and not null..

What is a Foreign key ?

  • A foreign key is a column, or combination of columns, that contain values that are found in the primary key of some table. A foreign key may be null, and almost always is not unique.
  • ClrFK column in the second table is a foreign key to the ClrPK primary key in the first table. 
  • Notice that the ClrPK values are unique and not null, but the ClrFK values may be null and often repeat. 
  • A null foreign key means that that particular row does not participate in the relationship. 
  • The fact that many foreign key values repeat simply reflects the fact that it's a one-to-many relationship.

Difference between DBMS and RDBMS :
DBMSRDBMS


DBMS applications store data as file.RDBMS applications store data in a tabular form.
  In DBMS, data is generally stored in either a hierarchical form or a navigational form..In RDBMS, the tables have an identifier called primary key and the data values are stored in the form of tables.

DBMS uses file system to store data, so there will be no relation between the tables.In RDBMS, data values are stored in the form of tables, so a relationship between these data values will be stored in the form of a table as well.

DBMS has to provide some uniform methods to access the stored information.RDBMS system supports a tabular structure of the data and a relationship between them to access the stored information.

DBMS is meant to be for small organization and deal with small data. it supports single user.RDBMS is designed to handle large amount of data. it supports multiple users.


Examples of DBMS are file systems, xml etc.Example of RDBMS are mysql, postgre, sql server, oracle etc.