Dbms
Dbms
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
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
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
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
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)
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
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(project(pi))
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)