0% found this document useful (0 votes)
17 views21 pages

Database Concept

The document provides an overview of relational databases and Database Management Systems (DBMS), explaining their purpose, structure, and key components. It discusses the relational database model, including tables, rows, columns, and the concept of keys for uniquely identifying records. Additionally, it covers SQL and its processing capabilities, including Data Definition Language (DDL) and Data Manipulation Language (DML), along with examples of common DBMS software.

Uploaded by

parthsa2505
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PPTX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
17 views21 pages

Database Concept

The document provides an overview of relational databases and Database Management Systems (DBMS), explaining their purpose, structure, and key components. It discusses the relational database model, including tables, rows, columns, and the concept of keys for uniquely identifying records. Additionally, it covers SQL and its processing capabilities, including Data Definition Language (DDL) and Data Manipulation Language (DML), along with examples of common DBMS software.

Uploaded by

parthsa2505
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PPTX, PDF, TXT or read online on Scribd
You are on page 1/ 21

RELATIONAL DATABASE

Storing and manipulating records


DATABASE
 May be defined as a collection of
interrelated data stored together to serve
multiple application
 It is computer based record keeping system.

 It not only allows to store but also allows


us modification of data as per requirements.
DBMS
 A DBMS refers to Database Management
System
 It is a software that is responsible for

storing, manipulating, maintaining and


utilizing database.
 A database along with the a DBMS is

referred to
as a database system.
 There are various DBMS software available

in the market like :-


 Oracle, MS SQL Server, MySQL,

Sybase,SQLite
PURPOSE OF DBMS
RELATIONAL DATABASE MODEL
 In relational database model data is
organized into table (i.e. rows and columns).
 These tables are also known as relations.

 A row in a table represent relationship among

a set of values.
 A column represent the field/attributes
related to relation under which information
will be stored.
 For example if we want to store details of

students then : Roll, Name, Class, Section,


etc. will be the column/attributes and the
collection of all the column information will
become a Row/Record
SAMPLE TABLES
EMPLOYEE
EMPNO GENDER DEPTNO SALARY COMM
ENAME F 1 2000 120
1 ANKITA M 0
2 0
2400 0
2 SUJEET F 0
1 0
2800 200
3 VIJAYA M 0
3 0
1800 0
300
4 NITIN M 0
3 0
2200 0
170
5 VIKRAM 0 0 0

DEPARTMENT
DEPTNO DNAME LOCATION
10 HR NEW YORK
20 ACCOUNTS BRAZIL
30 SALES CANADA
40 IT INDIA
COMPONENT OF A TABLE
 Byt : group of 8 bits and is used to
e store a character.
 Data Item : smallest unit of named data.

It
represent one type of
information and often
 Recor : referred
collection to as aitems
of data field or
d column information
which represent a
complete unit of
 Table information
: collection of all Rows and
Columns.
Tabl
Field e
s

DEPTNO DNAME LOCATION


10 HR NEW YORK
20 ACCOUNTS BRAZIL
30 SALES CANADA
40 IT INDIA

Data Items (requires 5


bytes)
Records
COMMON RDBMS
 Oracle, MySQL, IBM DB2, Sybase, Ms
Access
 Out of these MySQL and SQLite are Open
source implementation.
JUST A MINUTE…
BOOKCODE BOOKNAME PUB PRICE
B001 LET US C BPB 400
B002 VISUAL EEE 350
BASIC
B003 JAVA PHI 550
B004 VC++ BPB 750

Identify the following in the above table

1) Degree of Table
2) Cardinality of Table
3) Attributes of Table
4) Tuple
5) Data types of Book Code and Price (as studied in
Python)
CONCEPT OF KEYS
EMPNO ENAME GENDER DEPTNO SALARY COMM
1 ANKITA F 10 20000 1200
2 SUJEET M 20 24000
3 VIJAYA F 10 28000 2000
4 NITIN M 30 18000 3000
5 VIKRAM M 30 22000 1700

In relation each record must be unique i.e. no


two identical records are allowed in the
Database. A key attribute identifies the record
and must have unique values. There are
various types of Keys:
Primary Key, Candidate Key, Alternate
Key
KEYS
 Primary Key
 A set of one or more attribute that can identify a
record
uniquely in the relation is called Primary Key.
 There can be only 1 primary key in a table
 Allows only distinct (no duplicate) values and also
forces mandatory entry (NOT NULL) i.e. we cannot
left it blank.
 Candidate Key

 In a table there can be more than one attribute


which contains unique values. These columns
are known as candidate key as they are the
candidate for primary key.
 Alternate
Among these Keydatabase analyst select one as a
primary
In casekey
of multiple candidate keys, one of
them will be selected as Primary Key and rest
of the column will serve as Alternate Key
 A Candidate Key which is not a primary key is
an Alternate Key.
FEATURES OF MYSQL
 Speed
 MySQL runs very fast.
 Ease of Use

 Can be managed from command line or GUI


 Cost

 Is available free of cost. It is Open Source


 Query language Support

 Supports SQL
 Portability

 Can be run on any platform and supported by


various compilers
 Data Types

 Supports
various
 Security
data
 Offers privileges and password systems that is very flexible
types like
and secure.
Numbers,
 Scalability and Limits
Char etc.
 Can handle large databases. Some of real life MySQL
databases contains millions of records.
 Connectivity
 Clients can connect to MySQL using drivers
 Localization
 The server can provide error message to client in many
language
Enter the
password
given
STARTING MYSQL during
installatio
n

Click on Start → All Programs → MySQL →


MySQL Server → MySQL Command Line
Client
mysql> prompt
means now MySQL
is ready to take
your command
and execute

To exit from MySQL type exit or quit in

front of mysql prompt


SQL AND MYSQL
 SQL stands for Structured Query Language.
 Is a language that enables you to create

and operate on relational databases.


 MySQL uses SQL in order to access

databases.
 It is the standard language used by

almost all the


database s/w vendors.
 Pronounced as SEQUEL

 Original version was developed by


IBM’s
Almanden Research Center
 Latest ISO standard of SQL was released in

2016 and named as SQL:2016 or ISO/IEC


9075:2016
PROCESSING CAPABILITIES OF SQL
 DDL (Data Definition Language)
 DML (Data Manipulation
Language)
 View
 Authorization
 Integrity
 Transaction Control
DATA DEFINITION LANGUAGE
 It allows to create database objects like
creating a table, view or any other database
objects.
 The information about created objects are
stored in special file called DATA DICTIONARY
 DATA DICTIONARY contains metadata i.e.
data
about data.
 While creating a table DDL allows to specify –
name of table, attributes, data types of
each attribute, may define range of values
that attributes can store, etc
 Major commands of DDL are –
CREATE, ALTER, DROP
DATA MANIPULATION LANGUAGE
 It allows to perform following operation
on table
 Retrieval of information stored in table
 Insertion of new data in table
 Modification of existing data in table
 Deletion of existing data from table
 Main DML commands are –
SELECT, INSERT, UPDATE AND
DELETE
JUST A MINUTE…
 What is Database? What are the
advantages of Database System?
 What is DDL and DML? Give examples

of command belonging to each


category

You might also like