Sunteți pe pagina 1din 27

INTRODUCTION

Database related data ka aik collection hai. DBMS software hai jo kay large scale mai data
collection ko assist karta hai uski maintenance aur utilization mai. DBMS 1960 mai wajood
mai aya tha Charles naami aik database manager nay isko aijaad kia tha. Integrated data
store jo kay pehla general purpose DMBS tha. 1960 mai IBM nay IMS ko khareed lia tha.
1970 mai EdgorCodd nay IBM mai aik new database introduce karwaya tha jisay hum
RDBMS kehtay hain. 1980 mai SQL aya tha. Is kay bad DB2, ORACLE etc ana shuru hogae.
DATA
Data kisi bhi entity kay raw fact or figures hotay hain.

Kisi bhi organization mai kuch activities hoti hain, inko record karnay kizarurat bhi hoti hai, jisko
hum
data kehty hain.
INFORMATION
Jab hum data ko process kartay hain to usay hum information kehty hain.
Data processing ka maqsad ye hota hay kay wo information extract ki jaen jo kisi
business activity kay liay zaruri hoti hain.
IN GENERAL DATA MANAGEMENT CONSISTS OF FOLLOWING TASKS

Data Capture: konsa task data gathering say associated hai


Data Classification: Data ko uski usage aur nature kay according classify karna hota
hai
Data Storage: segregated data (isolated, part) ko properly store karna hota hai
Data arranging: data ko arrange karna aik important task hai
Data retrieval: Data ko frequently processing ki zarurat hoti hai isi liay data ki
retrieval bohat important hai
Data Maintenance: data ko up to date rakhnay kay liay maintenance zaruri hai
Data Verification: data ko store karnay say pehlay usko errors kay liay verify karna
hota hai
Data Coding: data will be coded for easy reference
Data Editing: data ko re-arrange aur modify karna presentation kay liay
Data Transcription: Is mai hum data ko aik form say dusri form mai convert karty
hain
Data Transmission: is mai hum data ko us jaga forward karty hain jahan isay further
use hona hota hai.

METADATA

Isko hum data about data kehty hain, kisi bhi tarah ka kisi bhi medium mai. Meta data ka
item us collection of data ko describe karta hai jis kay multiple contents ya hierarchical
levels hongy, e.g. database schema.

DATABASE

Database
Database
Database
Database

simple term mai collection of data ko kehtay hain


collection of related data bhi hota hai
kisi bhi size ka aur complex bhi hosakta hai
ko manually bhi maintained kia jata hai aur automated bhi

DBMS

DBMS collection of program hai jis mai user database ko create aur maintain karta
hai.
DBMS general purpose software system hai jo database kay different processes ko
facilitate karta hai like defining, constructing and manipulating.

CHARACTERISTICS OF DBMS

Organizations ki requirements ko incorporate karnay kay liay, system ko easily


maintained karnay kay liay design kia jata hai.
New program ko write kiay bagher hamen existing program say new information
mil jati hai
System ko is tarah design kia jae kay different data correlate kar kay new
requirements ko poora kia jae
Integrated database different applications kay data ki inter relationships ko
understand karnay mai help karta hai
Data different users kay access kay liay at a time available hota hai
System failure say bachnay kay liay automatic recovery provides ki jati hai.

DBMS UTILITIES

Data loading utility: is mai external formats ko easily load kia jata hai koi bhi
program write kiay bagher.
Backup utility: is mai databases ki copies create ki jati hain periodically, in case of
disaster.
Recovery utility: ye database ko uski original state aur last known position par
backup say recover karti hai.
Monitoring tools: ye database ki performance ko monitor karti hai, ta kay internal
schema change ho sakay, aur database access ko optimize kia ja sakay.
File organization: ye database ko aik type say dursi type mai restructe karti hai

DIFFERENCE BETWEEN FILE SYSTEM AND DBMS


FILE SYSTEM

File system
procedures
File system
karti hai
File system

collection of data hai. inko manage karnay kay liay user ko stored
likhnay party hain.
jo hai wo data representation aur storage of data ki details provide
mai storing aur retrieving efficient nahi hoti

Concurrent access karty hoay problem hoti hai like: aik read kar rahahai file ko,
lekin koi aur isko read kar raha hai, ya koi update kar raha hai.
File system mai crash recovery mechanism nahi hota
Protecting is difficult

DBMS

DBMS collection of data hai aur user ko manage karnay kay liay stored procedures
likhnay ki zarurat nahi hoti.
DBMS data ka abstract view daita hai aur details ko hide karta hai
DBMS efficient hai is mai wide variety of techniques use ki jati hain data ki retrieval
aur storage kay liay
DBMS mai concurrent access bhi possible hai
DBMS mai crash recovery mechanism bhi hai
DBMS kay pas protection mechanism bhi mojood hota hai.

DBMS VS RDBMS
DBMS simply aik system hai jo database ko mange karta hai. RDBMS database system
hai jo relational database ko manage karta hai. Relational database wo hota hai jis mai
data kay tables kay relationships hotay hain primary aur foreign keys ki basis par.
ADVANTAGES OF DBMS

Data Independency: applications kay liay zaruri hai kay wo data representation aur
storage details ko expose na karay. DBMS abstract view provide karti hai important
details ko hide kar kay.
Data Integrity and Security: is mai data integrity enforce ki jati hai.e.g inserting
salary information for an employee.
Data Administration: Jab user data share karta hai to isko centralize karna aik
important task hota hai. Is mai hum data redundancy minimize karty hain aur fine
tune kar kay retrieval time ko reduce kardete hain.
Concurrent Access and Crash Recovery: DBMS mai concurrent access possible hai,
DBMS user ko system failure say protect karta hai.
Reduce Application Development Time: DBMS supports important functions that
are common to many applications.

FUNCTIONS OF DMBS

Data Definition: DBMS application mai data kay structure ko define karnay kayliay
function provide karta hai. Is mai record structure ko define aur modify karna hota
hai.
Data Manipulation: Aik dafa data structure define kardia jae, to data ko insert,
modfy aur delete bhi karna parta hai. Ye operations jo functions perform karty hain
ye DBMS ka part hoty hain.
Data Security and Integrity: DBMS mai kuch modules aisay hotay hain jo data ki
security and integrity ko handle karty hain.

Data Recovery and Concurrency: system failure kay bad data ki recovery aur
concurrent access by multiple users bhi handle kia jata hai DBMS mai
Performance: DBMS mai aik important function bhi hai jo queries ki performance ko
optimize karta hai.

SIMPLIFIED DATABASE SYSTEM ENVIRONMENT


DBMS collection of program hai jo user ko database create aur maintain karna allow
karta hai. DBMS general purpose software hai jo application kay various users ko
database kay processes mai facilitate karta hai such as defining, constructing,
manipulating and sharing.
Defining database say muraad database ko specify karna hai jis mai data types,
constraints aur data ka structure involve hotay hain. Data manipulation mai hum queries
kay through specific data ko retrieve karty hain.
EXAMPLE OF DATABASE WITH A CONCEPTUAL DATA MODEL

Mini world for the example:


Part of a UNIVERSITY environment
Some mini-world entities:
STUDENTs
COURSEs
SECTIONs (of COURSEs)
DEPARTMENTs
INSTRUCTORs
Some mini-world relationships:
SECTIONs are of specific COURSEs
STUDNETs take SECTIONs
COURSEs have prerequisite COURSEs
INSTRUCTORs teach SECTIONs
COURSEs are offered by DEPARTMENTs
STUDENTs major in DEPARTMENTs

ARCHITECTURE OF DBMS

1972 mai ANSI/SPAC (American National Standard Institute/Standards Planning and


Requirements Committee) nay framework present kia tha. Aik report mai architectural
framework ko propose kia gya tha. Is mai 3 level architecture ko propose kia gya tha jis
kay 3 different views hain.
External individual user view
Conceptual community user view
Internal physical or storage view
External view to wo haijo database kay user kay liay hota hai. Ye restricted view hai aur
same database kae different views bhi provide karsakta hai for different classes of users.
Generally, user aur developer database kay subset mai interested hotay hain. E.g.
Department head ko sirf student records aur department kay finance say sarokaar hai,
usay library ya HR ya kisi aur ki information nahi chahian. Librarian ko academic staff ki
information mai koi interest nahi hai. Payroll walon ko students enrollment mai koi
interest nahi hai.
Conceptual view information model hai whole enterprise ka is mai physical
implementation nahi hoti. Ye normally more stable view hota hai enterprise ka. Database
mai hum internal view ko to change karsakty hain zarurat kai waqt, lekin conceptual
view mai change mushkil hai. Conceptual view basically overall community view hai
database ka jis mai wo informations hain jinko represent karna hai databse mai.
Conceptual view ko hum conceptual schema say define karty hain, jsimai har data types
ki definition hoti hai.
Internal view actual physical storage hotihai data ki. Is say hamen pata chalta hai kay
konsa data store hoa hai database mai aur kese store hoa hai.

DATA INDEPENDENCE
Data independence capacity hai schema ko aik level par change karnay ki, aglay higher
level ko change kiay bagher. Two types hain iski:
1. Logical Data Independence: is mai hamaray pas capacity hoti hai conceptual
schema ko change karnay ki external schema ko change kiay bagher
2. Physical Data Independence: is mai hamaray pas capacity hoti hai internal
schema ko change karnay ki conceptual schema ko change kiay bagher
WHEN NOT TO USE DBMS

Agar application simple ho, well defined ho, not expected to change ho
Agar multiple user access require na ho

TYPES OF DB AND DB APPLICATIONS

Traditional Applications: Numeric and textual database


Recent Applications: Multimedia DB, GIS, Data Warehouses, Real time databases

DATA MODEL
Model kisi bhi process ki abstraction ko kehty hain jo superfluous details ya extra details
ko hide kardeta ha.
Data model basic architectural unit hai databases ka jo database ka structure determine
karta hai, aur way ko determine karta hai jis way mai data nay store ya organize hona
hai. Ye system mai data ki connectivity, storage aur processing ko define karta hai. Ye
data organize karta hai aur determine karta hai kay data kay elements apas mai kese
relate karty hain. Data model map ya design hota hai Database ka, aur ye difficult to
change hota hai jab aik dafa data is mai insert kardia jae.
Data model conceptual representation hai data structure ki. Data model ka focus is bat
par hota hai kay konsa data required hai aur isko kese organanize karna hai na kay konsa
operation perform karna hai data par. Jese aik architect koi building bananay say pehlay
uska plan banata hai wese hi data models ka kaam hota hai.
Is mai 3 chezen hoti hain, data types, relationships, constraints.
TYPES OF DATA MODELS
1. High Level Conceptual Data Model : Ye user level data model high level model hai
yani conceptual model hai. Ye concept provide karta hai jo kay user ki perception
say kareeb hota hai.
2. Low Level Physical Data Model: ye details provide karta hai data ki jo stored hota
hai, ye data model computer specialists kay liay hota hai end user kay liay nahi.
3. Relational or Representational: ye high aur low kay beech hota hai.
4. Object Oriented Data Models
5. Object Relational Models

MOST COMMON
RELATIONAL MODEL
Relational model collection of tables ko use karta hai, har table kay multiple columns
hotay hain aur har column ka unique name hota hai.

Advantages:
1. Main advantage to ye hai kay ye model data ko simplified form mai represent karta
hai.
2. Data manipulation bhi simplify hojati hai, certain key attributes ko use kartay hoay.
3. Different types of relationships ko represent karsakty hain

NETWORK MODEL
Network model mai data ko collection of records mai represent kartay hain, aur data ki
relations ko links kay through represent karty hain.

Advantages:
1. Is mai pointers use kartay hain relationship show karanay kay liay
2. Data manipulation bhi easy hoti hai
HIERARCHICAL MODEL
Is mai data tree like structure mai organize hota hai. Ye structure repeating information
allow karta hai through parent/child relationship. Parents kay kae child hosakty hain lekin
har child ka aik hi parents hongy.

Advantages:
1. Representation ordered tree ki form mai hoti hai, yani one to many relationship
2. Proper ordering karnay say data retrieval fast aur easy hojati hai

SCHEMA VS INSTANCE
Database Schema: ye database ki description hoti hai jis mai database structure, data
type, aur constraints shamil hain.
Schema Diagram: Ye illustrative display hai database schema ka
Database State: Actual data stored in a database at a particular moment in time. This
includes the collection of all the data in the database.
Schema Vs State
Database State: refers to the content of a database at a moment in time.
Initial Database State: Refers to the database state when it is initially loaded into the
system.
Valid state: state that satisfies the structure and constraints of the database.
DISTINCTION
Database schema changes very infrequently.
The database state changes every time the database is updated.
Schema is also called intension.
State is also called extension.

DBMS Language

DDL Data Definition Language


DML Data Manipulation Language
High Level Language SQL

DDL : Is language say hum conceptual schema design kartay hain database ki.
DML: ye data retrieval ko specify karnay kay liay use hoti hai aur DML commands ko
update kia jata hai in languages say, ye host languages mai embedded hoti hai like C++,
Java etc
Languages mai library hoti hain jin main functions hotay hain in functions say hum DBMS
ko access karty hain.
TYPES OF DML
High Level or Non Procedural: SQL
Low Level or Procedural: in mai at a time aik hi data retrieve hota hai

ER MODEL
ER model real world situation ko represent karta hai. Is mai hum logical level par real
world scenario ko represent karty hain.
ER Model logical structure hai data ka aur ye entities mai grouped hota hai.
ENTITY: entity real world object hotay hain. Jo kay easily identifiable hotay hain. E.g.
school database mai student, teachers, classes aur courses ye sab entities hain. In sab ki
apni attributes ya properties hoti hain jo entities ko identity provide karti hain.
ENTITY SET: ye collection of similar entities hai. e.g a student set contain all the students
of the school.
ATTRIBUTE: attributes wo properties hoti hain jo entity kay sath associate hoti hain.
Attribute ka apna naam aur value hoti hai har entitiy kay liay. E.g. student entity ki
name, age, class attributes hain.
TYPES OF ATTRIBUTE:
SIMPLE: ye atomic values hoti hain, jo further subdivide nahi hotin. E.g. student ka
mobile number.
COMPOSITE: ye multiple attributes say mil kar banta hai. e.g student ka complete name,
first aur last name say compose ho kar banega.
DERIVED: ye attributes physical database mai exist nahi karty, lekin inki values dusray
attributes say derive hoti hain. E.g average salary ko hum database mai save nahi kartay
lekin jab zarurat parti hai to hum isko derive kar kay use kartay hain. E.g age derive from
d.o.b.
SINGLE VALUE: contain single value. E.g. CNIC
MULTI VALUED: is mai attributes ki more than one value hoti hai. e.g. person kay 2 cell
number hain, 2 email addresses hain. Etc
ENTITY SET & KEYS
Key attribute ya collection of attribute hai jo uniquely identify kart hai entity ko entity set
mai.
e.g roll number of a student make him identifiable among students.
CANDIDATE KEY wo attributes ya set of attributes jo uniquely identify karain row ko usay
candidate key kahengy.
PRIMARY KEY is mai hum is key say har row ko uniquely identify kartay hain.
ALTERNATE KEY wo candidate key jisko hum primary key kay taur par na choose karain.

COMPOSITE KEY kuch tables aisay hotay hain jin mai single attribute say hum row ko
uniquely identify nahi kar patay, is maqsad kay liay hum combination use karty hain
attributes ka as a primary key.

FOREIGN KEY jab aik table ki primary key dusray table mai appear hoti hai as an
attribute to usay hum foreign key kehty hain.
RELATIONSHIP
Entities kay between jo association hoti hai usay relationship kehty hain. E.g. employees
work_at a department, student enrolls in a course, here work_at and enrolls are called
relationship.
RELATIONSHIP SET
Similar type of relationship kay set ko relationship set kehty hain. Inkay bhi attributes
hotay hain jinko hum descriptive attributes kehtay hain.
DEGREE OF RELATIONSHIP
Yani participating entities j okay relationship mai hon usko degree of relationship kehty
hain.
Agar 2 entity types involved hon to binary relationship
Agar 3 entity types involved hon to ternay relationship
CARDINALITY aik entity set ki entities ka dusray entity set kay sath jo relationship hota
hai usay cardinality kehty hain.
4 categories:
1 to 1 relationship
1 to many relationship
Many to one relationship
Many to many relationship

S-ar putea să vă placă și