0% found this document useful (0 votes)
2 views

Database System -

The document provides an overview of database systems, focusing on key concepts such as entities, attributes, relationships, and ER diagrams. It discusses the types of data, the importance of databases in computer science, and the role of database management systems (DBMS). Additionally, it outlines SQL statement types including DDL, DML, and DCL.
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
2 views

Database System -

The document provides an overview of database systems, focusing on key concepts such as entities, attributes, relationships, and ER diagrams. It discusses the types of data, the importance of databases in computer science, and the role of database management systems (DBMS). Additionally, it outlines SQL statement types including DDL, DML, and DCL.
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 39

Database System

Mr.Nouman Asim
ER Diagram
To be discussed:

• Entity
• Attributes
• Types of Attributes
• Relationships
• ERD representation
• Generalization
• Specialization
• Inheritance
Entity

An Entity either be real world object animated or


inanimate that can be easily identifiable. Example
school database
• Teacher
• Students
• Classes
• Course offered
Attributes

Entities are be represented by means of their properties called


attribute. All attributes
Student: Name,RegNo,Age.

Types of attributes
Types of Attributes

.
Relationship

.
Mapping Cardinalities

.
One To One

Entity A Entity B

.
One To Many

Entity A Entity B

.
Many To One

Entity A Entity B

.
Many To Many

Entity A Entity B

.
ERD Representation

.
ERD Representation

.
ERD Representation

.
ERD Representation

.
.
.
.
.
Many To Many
Generalization and specialization

.
Generalization

.
specialization

.
.
Key Constrains
Key Constrains
ER Model To relational Model

.
Database Systems
Role of Data in Computer

Data
A collection of facts (numbers, words, measurements, observations, etc) that has
been translated into a form that computers can process
Types of Data

Structured data
Information stored DB
Strict format

Semi-structured data
Data may have certain structure but not all information collected
has identical structure
Some attributes may exist in some of the entities of a particular type
but not in others

Unstructured data
Very limited indication of data type
E.g., a simple text document
Why Study Databases?

Databases are useful Databases in CS


Many computing applications Databases are a ‘core topic’ in
deal with large amounts of computer science
information Basic concepts and skills with
Database systems give a set of database systems are part of
tools for storing, searching and the skill set you will be assumed
managing this information to have as a CS graduate
What is a Database?

“A set of information held in a computer”


Oxford English Dictionary

“One or more large structured sets of persistent data, usually associated with software to update and
query the data”
Free On-Line Dictionary of Computing

“A collection of data arranged for ease and speed of search and retrieval”
Dictionary.com
Databases

Library catalogues  Train timetables


Medical records  Airline bookings
Bank accounts  Credit card details
Stock control
 Student records
Product catalogues
Telephone directories  Customer histories
and so on…
Database Systems

A database system consists of Database systems allow users


Data (the database) to
Software Store
Hardware Update
Users Retrieve
We focus mainly on the Organise
software Protect
their data.
Database Management Systems

A database is a collection of Examples:


information Oracle
A database management DB2 (IBM)
MS SQL Server
system (DBMS) is the MS Access
software than controls that Ingres
information PostgreSQL
MySQL
MongoDb
What the DBMS does

Provides users with DBMS provides


Data definition language (DDL) Persistence
Data manipulation language Concurrency
(DML) Integrity
Data control language (DCL) Security
Often these are all the same Data independence
language Data Dictionary
Describes the database itself
Types of SQL Statements

DDL stands for Data DML stands for Data


Definition Languages (DDL). Manipulation Language. The
The SQL statements that are SQL statements that are in the
used to define the database DML class are INSERT,
structure. Any CREATE, DROP UPDATE and DELETE.
and ALTER commands are
examples of DDL SQL. DCL stands for Data Control
Language, it includes
commands such as GRANT
and REVOKE which mainly
deals with the rights,
permissions and other
controls of the database
system.
END

You might also like