0% found this document useful (0 votes)
22 views11 pages

Dbms

Uploaded by

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

Dbms

Uploaded by

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

DBMS database management systems-interrelated data and a set of programs to access

those data
primary foal:store and retrive
convinient and efficient
manage large bodies of information
define data storage structure
mechanisms for data manipulation
sagety of information stored

data vs information
data-datum-raw facts
information-processed data
database-collection of interrelated data
meta-data :data about other data

application of DBMS
sales
finace
bank
scools,collages,univetsity
manufacturing
online stores
railway reservation
airways
human reaourse(HR)
telecomunication
insurance

file system vs DBMS


data redundancy and inconsistency=
different programmsers
differenet files
different structure
different programming languages
duplication-redundancy
higher storage and access cost
inconsistency
difficulty in accessing the data
data isolation
integrity problems
consistency constraints
new constraints
atomicity problems
restoration
atomicuty
concurrent access anomalies
security problems
authentication and authorization

three tier architecture


client= GUI,web interface
presentation/front end-collect and display info desktop applications or GUI
HTML,CSS java script
application server or web server =application programs,web pages
application/logic or middle leveltier,heart of the appplication,onformation
is procesed,businesss logic and rules,add delere or update data in the data
tier,python java perl php ruby ,communicates with data tier using api calls
database server=database management system data
tiers/backend,database server,data are stored and managed,communiation -
presentation and data tier,RDBMS-MYSQL-MariaDB-Oracke-DB2 nucrisift SQl server
postgre sql,DBMS-cassondra,couchdb mangodb

data abstraction
primary foal:store and retrieve
convenient and eficeint
complex data structures
hiding sthe complexity

view of data
1)physical level
lowest level of abstaction
deals with how
complex low level data structures
databse level
storage level
2)logical level
deals with what and rekationship
entire database with simple data structures
physical data independence
3)view level
highest level of abstraction
users and access
interaction with the system
application programs
several views and security

schemas
the overal disign of the database
database schema=variable declalriton
type definitions
no frequency changes or not at all

instances
the collection of information stored at a particular moment
frequency changes
database instant =value of the variables
sub shhemas
logical schemas
physical schemas

database users
1)naive users
unsophisticated users
invoke/use the application programs
web/mobile/ui interface
desktop application
2)application programmers
computer prifessionals
application develepomemt tools
develop user interfaces
RAD-rapid applicatiom development tools
web/mobile interface
3)sophisticated users
interact with system
database query languages
dataanalysis software
data/business analysis
4)soecuakuzed users
specialized DB applications
compute aided design systems
knowledge base and expert systems
multimedia data
next generation

DATA BSE ADMINISTATOR(DBA)


data and programs access the data
central control
key role

periodic backup
disk spac management
perfomance

data models
underlying structure of a database
conceptual tool
data+relationship+semantics+constaints
design of database at physial and view level

categories of data model

1)relational model
2)entity-relationship model
3)object-based data mode
4)semistrctural data makel

relational model(table,filed,rrecord)
collections of table
tables represenst both data and relationships
multiple columns with unique names
tables=relation
record based model
fixed formed records of several type
each record type defines a fixed number of fields, or attributes
most widely used data model
current DBMS are based on relaational model
entity-relationship model(E-R)
collection of basic objects called entities and its relationships
an entity is a real world thing or object
distinguishable from other objects
widely used in database design
object-based model
need for object oriented data model(object oriented languages-c++,java,c#)
object based model=E.R model+OO features
object relational data model=object oriented model+relatonal model
semistructered data
specification of data
individual data items of the same type amy have different dats of attributes
constrast to previous data models
wntensible markup languages (XML)
database system architecture
bit
byte
kilobyte
megabyte
gigabyte
terabyte
petabyte
exabyte
zettabyte
yottabyte

the storage manager()


low level data stored -storage manager -applicatin programs
queres submitted to the system
interaction with file manager
raw data are stored on the disk using gile system provided by operating
system
translates vatious DML statements into the low lwvwlfilw system commands
responisiple for storing retrieving and updation data
components
authoritaion and integrity manager
trasaction manager
file manager
buffer manager
data structures
data files
data dictionary
indices

transaction manager
atomicity reauirements
all or none
consistency
durability
transactions

recovery manager
failure recovery(hardware or software)
concurrency control manager
query evolution engine

query processor
DDL interpreter
DML compiler
query evaluation engine

database languages
Data Definition Languages(DDL)
Data Manipulation Language(DML)
Structured Query Language(SQL)

DDL(schema)
creation,altenation,renaming,dropping,truncation
specify a database scheme by a set of definitions
consistency constrains
referenatial integrity(it should be there reference)
domain constrains(minimum)
assertions
authorizatin
data dictionary and metadata
DML()
retrieval,insertion,deletion,modefication
type of DML
porocedureal DML
declaration or non procedural DML
queryl
query language
database softwares
oracle
MYSQL
IBM DB2
MICROSOFT SQL SERVER
pastgre SQL
razar SQL
infarmix
mango DB
redis
teradata
elasticsearch
amazon RDS
microsoft access
SQLite
alibase
improvado
intoduction to relational model
collection of tables
tables represent both data and relationshaips
relations
tuple-rows
attribute-columns
relation instances
domain
null value(either unknown or does not exit)

codd's 12 rules(13 rules)


0)the foundation rule
1)the information rule
2)the guaranted access rule
3)systematic rule of null values
4)dynamic online catalog
5)the comprehensive data sublanguage rule
6)the view updating rule
7)possible for higher lavel insert,update and delete
8)physical data independence
9)logical data independence
10)integrity independence
11)distribution independence
12)the non subversion rule

database schema(logic design)


collectin of tables
tables represent both data and relationships
tuple and attributes
realtion instances
dimain

keys in RDBMS
uniquely identify the tuple
super key
condidate key
primary key
alternate key
unique key
composite key
foreign key

super key
like superser
uniqely identify the tuple
null values
{name} is not a super key
may contain extraneous attributes
{id},{ssn},{id,names},{name,phone},{id,phone},{name,email},{id,ssn,phone}

candidate key
minimal super keys are called candidate key
{id},{ssn},{name,phone},{email}

primary key
to denote a candidate dey(should be unique and no null values are taken)
{id},{},{}
never or very rarely changed
candidate key with null value is not the primary key

alternate key
the candidate key other than primary key

unique key
should be unique but it can have null values

composite key
more than one attribute

foreign key
deal with two tables
referentional key

schema diagrams
database schema is the logical view of the entire database
databse schema+primary key+foriegn key dependence
schema diagrams with relation name and attribute name
primary key-underlilned
foreign keys=arrows
other constrains are not explictly shown in schema diagrams
entity-relationship(E.R) diagram ler us represent several kind of constrains
many database system provides design tools with a GUI for creating schema
diagrams

relational query language


query language -which client request data
higher level thab that of a standard programming language
catagerioes
1procedural query language
a swquesnce of aperations on the databae
to computer the desired result
what data is required
how to retrieve those data
relational algebra
2 non procedural query language
user describes only the desired information
what data is required
no need to describe how to retrieve those data
relatinal calculus
terse and formal
lacking the syntactic sugar for extracting data

algebra
abstact algebra(cryptography)
linear equations(whether casting)
boolean algebra(digital calculator)
relational algebra

relational algebra
it is a procedural query language
RA is a set of operations on realtion(s)
it is a set of algebric operations
input :one or more relations
output :a relation
it provides a therotical foundation for relational database
Structured query language (SQL)
it allows us to understand database operations in more detial and motivate us
to write optimized queries
fundadmental operations
select(sigma)
project(pi)
union(U)
set difference(.)
cartesian product(X)
rename(rho)
additional operations
set intersection(reverse u)
assignment operation(=)
natural join()
equa join()
beta join()
division operation(/)
outer join()
left outer join
right outer join
full outer join

relation operation(select opleration)


select tuples that satisfy a given predicates
it is denoted by lowercase greek leter sigma()
syntax:sigma<selection_condition>(relation)
example:sigma D_ID=2(employee)
comparision operators:=,not equal to ,<,<=,>,>=
connectives:AND(^),OR() and not(`)

relation operation(project(pi))

it return its arguments relation with certain attributes left out


it is a unary operator
it is denoted by the uppercase greek letter pi
basically a relation is a set
in the result , the duplicative rows are eliminated
syntax:pi attribute1,attribute2,...

relation operation(union(U))
any relation is a set
similar to union operation in set theroy
it is a binary operator
it is a set of all objects that are a member of a or, b or both
like projects the duplicate rows are eliminated
it is denoted by U
syntax :pi column(relation-1) U pi column(relation-2)
two important conditions that union should satisfy
for R U S to be valid
1 R and S must be of same arity
2 for all i,
domain of the ith attribute of R =komain of ith attribute of s

set difference(-)
it is the same set difference in set theory
it is a binary operatioin
to find tuples that are in one relation but are not in another
R-S=tuples in R but not in S
it is denoted by minus(-)symbol
two important conditions that set diffenence should satisfy
for R-S to be valid
1 R and S must be of same arity
2 for all i,
domain of the ith attribute of r =domain of ith attributes of s

cartesian product
cartesian product assotiates every tuple of R, with every tuple of S
it is a bunary operation
it is denoted by cross(X) symbol
R X S =all possible pairung
same attribute may appear in R and S
R=depositer X borrower

rename operation
relation in the database have names
the results of relation-algebra expressions do not have a name
it is useful tobe to give them names
it is a binary operations
it is denoted by lowercase greek leter rho()
symbol: rho x (E)
a relation r by itself is considered a trival relation-algebra expression
thus the same rename operation can be applied to a relation r to get hes same
relatio under a new name
the results of relation-algebra expressions do not have a name.
rhox(A1A2.....An)(expression)

You might also like