You are on page 1of 29

RELATIONAL DATABASE

MANAGEMENT SYSTEM
PRESENTED BY
Names

Roll No

Akhil Sawant

MF- 13

Bhavesh Patel

MM- 13 06

Durgesh Dhapre

MF 13

Saish Sawant

MI 13 08

Sunil Nair

MI 13 - 05

WHAT IS DBMS
DBMS stands for "Database Management System." In
short, a DBMS is a database program. Technically
speaking, it is a software system that uses a standard
method of cataloguing, retrieving, and running
queries on data. The DBMS manages incoming data,
organizes it, and provides ways for the data to be
modified or extracted by users or other programs.
Some DBMS examples include SQL Server, Oracle,
MySQL, Microsoft Access, PostgreSQL, FileMaker
and FoxPro.

RDBMS
Relational Database Management System
It is a database management system (DBMS) that is
based on the relational model as introduced by E. F.
Codd, in year 1970 of IBM's San Jose Research
Laboratory.
A way of saving and accessing data on disk storage.
Examples : SQL Server, Oracle, MySQL, Microsoft
Access

WHY USE AN RDBMS

Data Safety

Concurrent Access

Fault Tolerance

Data Integrity

Scalability

Reporting

RDBMS BASICS
A DBMS Approach which manages data
(logically) as a collection of tables where data,
and data relationships, are represented by
common values in related tables.
A Table (file) consists of records, which consist of
attributes (fields), which relies on the storage of
various data types

RDBMS BASIC CONTD.


Database component
Files (Table, Entity), Records (Tuples) and Fields
(Attributes)
Consider some information the University maintains

Name
Address
SSN

Major
Courses Taken
Grades Received

Tuition Paid
Tuition Owed
Grants/Scholarships

How is information stored?


You are an entity with attributes which vary.
Within the University, different areas have
different interests in you.

HOW DOES IT RELATES TO


DATABASE?
Database Components:
You are an entity

Record

with attributes

Fields

which vary

Fields can contain characters,


numbers, symbols, etc.

Within the college,


different areas,
have different interests in you

Files

(i.e,. The Registrar, Bursar, etc.)


Nonetheless, you are still part
of the College

Database

Database Components:
A Database consists of
Files, which contain

Records, which contain

Fields, which may consist of a


variety of data types

Hernandez, Juan

123456789

72

2.42

Jones, Mary

234567890

102

3.87

Notice that there should always be a Key (Unique) Field

RDBMS Restrictions/Conventions:
Each Relation MUST have a unique name
Student Table
Student id

Name

Address

Major

MI 03

Saish

Kalyan

IT

MI 05

Sunil

Mulund

Finance

MI 07

Akhil

Dadar

Marketing

MI 10

Durgesh

Thane

HR

Student Table

Balance Table
Student

Owed

Department

Student id

******

Dept

MF-01

28400

IT

12345

******

Finance

MF-08

36428

Accounting

65789

******

IT

MF-04

45750

Finance

90918

******

Marketing

RDBMS Restrictions/Conventions: contd.....


All Columns (Tuples) MUST have Unique names
Student Table
Student ID

Name

Address

Address

Major

MI 03

Saish

Kalyan

Veena apts

IT

MI 05

Sunil

Mulund

Beena apts

Finance

MI 07

Akhil

Dadar

Cadel road

Marketing

MI 10

Durgesh

Thane

Tina apts

HR

One of the names MUST be changed


* NOTE: The same field names CAN be used in different Relations

RDBMS Restrictions/Conventions: contd.....


All Column Elements MUST be of the same data type.
(Data types like Varchar, Int, Bool, Datetime, Decimal etc.)
Student Table
Student id

Name

Address

Major

MI 03

Saish

Kalyan

25.43

MI 05

Sunil

Mulund

Finance

MI 07

Akhil

Dadar

Marketing

MI 10

Durgesh

Thane

HR

Unless this is stored as Character String 25.43 (and NOT as


the real number 25.43), it MUST be changed

RDBMS Restrictions/Conventions: contd.....


All Column Elements MUST be of the same data type.
Notice that this means each record requires the SAME number of Bytes of Storage
Table Student
StudentID

Name

Address

Major

123456789

Saenz, Lupe

123 Mesa

Finance

A Character String Requiring 9 Bytes of Storage


A Character String Requiring 20 Bytes of Storage
A Character String Requiring 25 Bytes of Storage
A Character String Requiring 10 Bytes of Storage

A Total 64
Bytes of
Storage

RDBMS Restrictions/Conventions: contd.....


The order of Rows is NOT important.
StudentID

Name

Address

Major

123456789

Saenz, Lupe

123 Mesa

Finance

234567890

Chung, Mei

37 5th St.

INFOSYS

345678901

Adams, John

54B Hague

Accounting

StudentID

Name

Address

Major

123456789

Saenz, Lupe

123 Mesa

Finace

345678901

Adams, John

54B Hague

Accounting

234567890

Chung, Mei

37 5th St.

INFOSYS

Is the
Same as

RDBMS Restrictions/Conventions: contd.....


The Number of Bytes/Record Must be the same.
StudentID

Name

Address

Major

123456789

Saenz, Lupe

123 Mesa

Finance

234567890

Chung, Mei

37 5th St.

INFOSYS

345678901

Adams, John

54B Hague

Accounting

Each
contains
64 Bytes

RDBMS key
Purpose
Define entity relationships
Determination
Knowing the value of a key field means you also know
(Determine) the values of the other fields
E.g., knowing StudentID means you know StudentName,
StudentAddress, etc.

StudentID

StudentName, StudentAddress

(StudentID Determines StudentName and StudentAddress)

RDBMS key: contd.....


Purpose
Define entity relationships
Determination
Functional Dependence
An attribute is functionally dependent on another if can be
determined by that attribute
StudentID

StudentAddress

(StudentID Determines Student Address)


NOTE:

StudentAddress

StudentID

(Two Students MAY live at the same address)

TYPE OF RDBMS KEYS

Primary Key

Foreign Key

Candidate Key

Secondary Key

Composite Key

PRIMARY KEY
Each Relation MUST have a unique identifier or
Primary Key
StudentID

Name

Address

Major

123456789

Saenz, Lupe

123 Mesa

Finance

234567890

Chung, Mei

37 5th St.

INFOSYS

345678901

Adams, John

54B Hague

Accounting

*********

*********

*********

*********

No two students can have the same StudentID

FOREIGN KEY
In Order to relate two (or more) tables Foreign Key
must be used
Table Student

StudentID

Name

Address

Major

123456789

Saenz, Lupe

123 Mesa

Finance

234567890

Chung, Mei

37 5th St.

INFOSYS

345678901

Adams, John

54B Hague

Accounting

Table Department
A FOREIGN KEY in one
table
is a PRIMARY KEY In
another

DeptName

Chairman

Telephone

INFOSYS

Sircar, Sumit

555-1234

Marketing

McDaniel, C.

555-2345

Accounting

Courtney, H.

555-3456

RDBMS Operators:
SELECT
Choose All or Specific values from a table
SELECT ALL
Yields

Given:
Table Student

StudentID

Name

Address

StudentID

Name

Address

123456789

Saenz, Lupe

123 Mesa

123456789

Saenz, Lupe

123 Mesa

234567890

Chung, Mei

37 5th St.

234567890

Chung, Mei

37 5th St.

345678901

Adams, John

54B Hague

345678901

Adams, John

54B Hague

456789012

Elam, Mary

123-22 E St.

456789012

Elam, Mary

123-22 E St.

567890123

Bush, G.W

555 Austin

567890123

Bush, G.W

555 Austin

678901234

Clinton, B.

89 Congress

678901234

Clinton, B.

89 Congress

789012345

Bush, J.

555 Austin

789012345

Bush, J.

555 Austin

RDBMS Operators:
SELECT
Choose All or Specific values from a table
SELECT WHERE ADDRESS = 555 Austin
Yields

Given:
Table Student

StudentID

Name

Address

567890123

Bush, G.W

555 Austin

789012345

Bush, J.

Austin

StudentID

Name

Address

123456789

Saenz, Lupe

123 Mesa

234567890

Chung, Mei

37 5th St.

345678901

Adams, John

54B Hague

456789012

Elam, Mary

123-22 E St.

567890123

Bush, G.W

555 Austin

678901234

Clinton, B.

89 Congress

789012345

Bush, J.

555 Austin

RDBMS Operators: contd


PROJECT
Produce list of all values for a selected attribute

PROJECT STUDENTID
Yields

Given:
Table Student

StudentID

StudentID

Name

Address

123456789

123456789

Saenz, Lupe

123 Mesa

234567890

234567890

Chung, Mei

37 5th St.

345678901

345678901

Adams, John

54B Hague

456789012

456789012

Elam, Mary

123-22 E St.

567890123

567890123

Bush, G.W

555 Austin

678901234

678901234

Clinton, B.

89 Congress

789012345

789012345

Bush, J.

555 Austin

RDBMS Operators: contd


PROJECT
Produce list of all values for a selected attribute
PROJECT STUDENTID, NAME
Yields

Given:
Table Student

StudentID

Name

StudentID

Name

Address

123456789

Saenz, Lupe

123456789

Saenz, Lupe

123 Mesa

234567890

Chung, Mei

234567890

Chung, Mei

37 5th St.

345678901

Adams, John

345678901

Adams, John

54B Hague

456789012

Elam, Mary

456789012

Elam, Mary

123-22 E St.

567890123

Bush, G.W

567890123

Bush, G.W

555 Austin

678901234

Clinton, B.

678901234

Clinton, B.

89 Congress

789012345

Bush, J.

789012345

Bush, J.

555 Austin

RDBMS Operators: contd


JOIN
Links 2 different tables together (Producing a
different table)
Each Table MUST have attributes that are common
to both tables
TableA
CID
123
124
125
126
127

CN
AA
BB
CC
BB
DD

TableB
CA
6
20
12
9
18

CR
AA
BB
CC

CAdd
123 A
234 B
345 C

RDBMS Operators: contd


JOIN
Consider the relationship between a Physician and
his/her Patients
Physician

Patient

PhysID

Physname

PatID

Patname

PhysID

123456789

Smith, Mary

987654321 Washington, G.

234567890

234567890

Brown, John

876543210

Adams, J.Q.

345678901

345678901

Jones, Jerry

765432109

Jefferson, T.

123456789

654321098

XXX

123456789

543210987

YYY

234567890

432109876

ZZZ

345678901

321098765

AAA

123456789

RDBMS Operators: contd


JOIN
The Product of the tables is:
Physician
PhysID

Physname

123456789 Smith, Mary

Patient
*

PatID

Patname

Phys

987654321 Washington, G. 234567890

PhysID

Physname

PatID

Patname

Phys

123456789 Smith, Mary 987654321 Washington, G. 234567890

234567890 Brown, John

876543210

Adams, J.Q.

345678901

123456789 Smith, Mary 876543210

Adams, J.Q.

345678901

345678901

765432109

Jefferson, T.

123456789

123456789 Smith, Mary 765432109

Jefferson, T.

123456789

654321098

XXX

123456789

123456789 Smith, Mary 654321098

XXX

123456789

543210987

YYY

234567890

123456789 Smith, Mary 543210987

YYY

234567890

432109876

ZZZ

345678901

123456789 Smith, Mary 432109876

ZZZ

345678901

Jones, Jerry

234567890 Brown, John 987654321 Washington, G. 234567890

The product of a 3 (row) x 2


(column) Table and a 6 (row) x 3
(column) Table would be a 18
(row) by 5 (column) Table

234567890 Brown, John 876543210

Adams, J.Q.

345678901

234567890 Brown, John 765432109

Jefferson, T.

123456789

234567890 Brown, John 654321098

XXX

123456789

234567890 Brown, John 543210987

YYY

234567890

234567890 Brown, John 432109876

ZZZ

345678901

345678901

Jones, Jerry

987654321 Washington, G. 234567890

345678901

Jones, Jerry

876543210

Adams, J.Q.

345678901

345678901

Jones, Jerry

765432109

Jefferson, T.

123456789

345678901

Jones, Jerry

654321098

XXX

123456789

345678901

Jones, Jerry

543210987

YYY

234567890

345678901

Jones, Jerry

432109876

ZZZ

345678901

RDBMS Operators: contd


JOIN
Now, entering the command:
Select Patname Where PhysID = Phys would yield:
PhysID

Physname

PatID

Patname

Phys

PhysID

Physname

PatID

Patname

Phys

123456789

Smith, Mary

987654321

Washington, G.

234567890

Smith, Mary

987654321

Washington, G.

123456789

Smith, Mary

876543210

Adams, J.Q.

345678901

123456789

Smith, Mary

876543210

Adams, J.Q.

345678901

123456789

Smith, Mary

765432109

Jefferson, T.

123456789

123456789

Smith, Mary

765432109

Jefferson, T.

123456789

123456789

Smith, Mary

654321098

XXX

123456789

123456789

Smith, Mary

654321098

XXX

123456789

123456789

Smith, Mary

543210987

YYY

234567890

123456789

Smith, Mary

543210987

YYY

234567890

123456789

Smith, Mary

432109876

ZZZ

345678901

123456789

Smith, Mary

432109876

ZZZ

345678901

234567890

Brown, John

987654321

Washington, G.

234567890

234567890

Brown, John

987654321

Washington, G.

234567890

234567890

Brown, John

876543210

Adams, J.Q.

345678901

234567890

Brown, John

876543210

Adams, J.Q.

345678901

234567890

Brown, John

765432109

Jefferson, T.

123456789

234567890

Brown, John

765432109

Jefferson, T.

123456789

234567890

Brown, John

654321098

XXX

123456789

234567890

Brown, John

654321098

XXX

123456789

234567890

Brown, John

543210987

YYY

234567890

234567890

Brown, John

543210987

YYY

234567890

234567890

Brown, John

432109876

ZZZ

345678901

234567890

Brown, John

432109876

ZZZ

345678901

345678901

Jones, Jerry

987654321

Washington, G.

234567890

345678901

Jones, Jerry

987654321

Washington, G.

234567890

345678901

Jones, Jerry

876543210

Adams, J.Q.

345678901

345678901

Jones, Jerry

876543210

Adams, J.Q.

345678901

345678901

Jones, Jerry

765432109

Jefferson, T.

123456789

345678901

Jones, Jerry

765432109

Jefferson, T.

123456789

345678901

Jones, Jerry

654321098

XXX

123456789

345678901

Jones, Jerry

654321098

XXX

123456789

345678901

Jones, Jerry

543210987

YYY

234567890

345678901

Jones, Jerry

543210987

YYY

234567890

345678901

Jones, Jerry

432109876

ZZZ

345678901

345678901

Jones, Jerry

432109876

ZZZ

345678901

RDBMS ADVANTAGES:
Data Structure
Multi User Access
Network Access
Language

DISADVANTAGES:
Cost
Abundance of Information
Structured Limits

THANK YOU

You might also like