Data Base Management System
Relational Data Model:
Data base may be defined as a collection of interrelated data stored together to serve
multiple applications.
DBMS: A data base management system refers to a software that is responsible for storing, maintaining
and utilizing databases. A database along with RDBMS is referred to as a database system.
Benefits of Using DBMS:
No Data Redundancy Data Inconsistency can be Secured and Sharable Data
avoided
Duplication of Data Mismatched multiple copies Security of data
of same data
Relational Data Base Model: In Relational Data Model, the data is organized into Tables (i.e Rows and
Columns)
Fields(Column)
Student ID FName LName DOB Filed Names
501 Philip Barker 07/11/2005
502 Sandip Dojish 12/07/2005
503 Cathrine Fergus 03/01/2006 Records(row)
504 Philip Barker 07/11/2005
505 Antony Ruth 01/09/2005
Relation: A table is also called Relation. Table: Student Relation
Tuple/Row/Record : Rows of relations are called as Tuples
Attribute/Columns/Fileds: Columns of relations are called as attributes
Fields
Roll No Name Marks
1 John 95
2 Peter 100
3 Dev 78
4 Jade 99
5 Jack 75
Row
Data Items: The values stored in a relation are called Data items.
Domain: A Domain is a pool of values from which the actual values appearing in a given column are
drawn.
Degree 3 (no. of Column)
Table: Student_XII
Roll No Name Stream Domain of Stream Medical
101 Jack Medical Humanities
102 Sam Humanities Commerce
103 Tade Commerce Non Medical
104 Mick Non Medical
105 Derick Non Medical
Degree of a Relation: Number of Columns/Attributes in a Relation. In the example Student_XII Degree is 3
Cardinality of a Relation: Number of Rows/Tuples in a Relations, In this example Cardinality =6
Properties of a Relation:
All Rows of a relation must be distinct
Ordering of rows and columns are immaterial
For a row, a column can not have more that one value
In any given column of a table all items are of the same kind
Keys: Candidate Keys:
A candidate key i
s a column or a group of columns, which uniquely identify each record of a table
Or
The column which are able to become Primary key are called candidate Key
Primary Key:
A primary Key is a set of one or more attribute that uniquely identify tuples with in a relation.
Candidate Keys
Roll No Admsn_No Name StreamCode
1 SR10001 John S101
2 SR10002 Jack S102
3 SR10003 John S103
4 SR10004 Peter S101
5 SR10005 Dev S102
Note: It should be NOT NULL and Unique. It should be a minimal set of attributes
Primary Key should be NOT NULL and Unique, A table can have only one Primary Key, It does not have a duplicate
values.
Alternate Key: The candidate Key which is not selected as Primary key is called as Alternate Key
Foreign Key: A Foreign key is used to represent the relationship between two tables.
A non-key attribute, whose values are derived from the primary key of some other table is known as
foreign key in current table
Table: Student Table : Stream
RollNo Name StreamCode StreamCode Stream Name
1 Neha S101 S101 Humanities
2 Nisha S102 S102 Commerce
3 Pooja S103 S103 Non Medical
S104 Medical
4 Priya S101
5 Soniya S102
Foreign Key Primary Key
Difference Between SQL and MySQL:
It is an Open Source Relational Data Base Management System (RDBMS)