Sie sind auf Seite 1von 13

DBMS CONCEPTS

FLAT FILE SYSTEM TUTORIAL

TRADITIONAL FILE BASED SYSTEM::


A collection of application programs that perform services for the end users, such as
 production of reports....
LIMITATIONS OF FILE BASED SYS ::
1. separation & isolation of data :: data s isolated n diff files n  FBS
2. sharing:: can't share different files on  a network.....
3. duplication:: to enter the data more than once can wastes time , money  & space..
4. data dependecy::: depend of prog & field...changes to existing str r difficult....
5. incompatible file format:: we can't merge different files data in one file due to
difference of lang....
6. fixed queries / poliferation of application prog ::  all the queries had to be
written by application programmers , have no facility of evolution or new change or
new demand in data.....

ROLES IN DATABASE ENV TUTORIAL

people that participate in DBMS environment r


data administrator :  ( DA )responsible for management of data resources e,g
planning ,policies, standards., procedures, conceptual/logical db design..
database administrator :: ( DBA ) ....responsible for physical realization of db e,g 
physical db design, performance, implementation, security, integrity, maintaince,
users/ groups
database designer...
   a. logical designer : identify data (entities & attributes), relationships b/w
data, constraints on the data
   b.   physical designer : mapping the logical data models in to a set of tables &
integrity constraints, select sp storage str & access methods, designing security
measures.
application Programmer :: uses a 3rd or 4th generation prog lang
End Users ::
   a . Naive users : unaware of DBMS.
   b . Sophisticated users : familiar wth the str & facilities of DBMS.

DBMS AND RDBMS TUTORIAL

FUNCTION / FACILITIES OF DBMS ::


Authorization Services :: ensures that only authorized users can access db.
Security Services :: prevents unauthorized users to access db
Integrity Services :: ensures that both the data & changes to db follow certain
rules..
Concurrency Control Services:: ensures that db s updated correctly when mutiple
users r updating the db concurently...
Recovery Control sys:: restores the db to a previous consistent state following a
 HW / SW failure...
User Accessable Catalog :: contains descriptions of data items..
data storage, retrievel(query & it's result), updation(del, overwritting, inc, dec)
Data Dictionary : data abt data includes the data which user inputs & the data by
which we defines fields...
Transaction Suuport : which ensures taht either all the updates corresponding to
a given transcation r made or that none of them r made...
Data Communication Support :
Utillities Support : e,g import, export, garbage collection, statistical analysis,
monitoring facilities...
Data Independency :: independence of prog from the actual str of db..

SOFTWARE COMPONENTS OF DM:


                1: Authorization Control
                2: Integrity chacker
                3: Recovery manager
                4: Command Processor
                5: Query Optemizer
                6: Transection Manager
                7: Sheduler
                8: Buffer Manager
 
COMPONENTS OF DBMS:
                1: Query Processor
                2: File Manager
                3: DML Preprocessor
                4: DDL Compiler
                5: Catalog Manager
                6:Data Base Manager
 

DISADVANTAGES OF DBMS::
complex sw :
size :: storage capicity..Ram more (multi user environment)
expensive : as t s complex so it woud be expensive(sw + hw) ,
HW constraints & cost :
Cost Of Conversion :
performance: will be slow becauz of multiuser environment....
Failure /  breakdown...e,g 11sep all data was losed therer was no backup.....

DATABASE ARCHITECTURE TUTORIAL

LEVELS OF DB ARCHITECTURE ::
1st there was two level architecture including schema & subschema ...
but now a 3 level architecture
external level : the users view of db, it includes that part ofdb which s relevant to
 each user..
conceptual level : the community view of db, it includes all entities , their att &
relationships , constraints on data, semantic info abt data,  security & interity info.
internal level : the physical rep of db on comp, it inculudes storage spce, record
description,  record placement,  data compressin, data encryption..
DB LANGUAGES ::
Data Definition language: DDL used to define the db schema (data types, str,
constraints) e,g  SQL..
Data Manipulation language: DML s used to both read & update db(insert, updat,
del, retrieve) by data manipulation language (DML) r of two types
    a .  procedural lang : manipulate db record by record, allow users to state how t
oretrieve the data e,g c , C++ , java
    b.   non procedural lang : manipulates sets of records of db allow users to statewat
 data s needed e,g  SQL,QBE (query by examp)..
4GL : fourth generation language ::e,g SQL, QBE..
ENTITY :: s a distinct object (a person, place, thing , concept, event)
SEQUAL SERVER :: s a Ms sw whose name s SQL - SERVER

DATABASE LANGUAGES TUTORIAL

DB LANGUAGES ::
Data Definition language: DDL used to define the db schema (data types, str,
constraints) e,g  SQL..
Data Manipulation language: DML s used to both read & update db(insert, updat,
del, retrieve) by data manipulation language (DML) r of two types
    a .  procedural lang : manipulate db record by record, allow users to state how t
oretrieve the data e,g c , C++ , java
    b.   non procedural lang : manipulates sets of records of db allow users to statewat
 data s needed e,g  SQL,QBE (query by examp)..
4GL : fourth generation language ::e,g SQL, QBE..
ENTITY :: s a distinct object (a person, place, thing , concept, event)
SEQUAL SERVER :: s a Ms sw whose name s SQL - SERVER ...
WHAT IS DATABASE TUTORIAL

lang use sql for databse ,,,,


design::: how many tables wat r primary key, wat should be the
fulnctionality...............
entity realtion model:::::::when we depect something from real world to a paper taht s
model
normalization::::::: to decompose a table in to sub table .....we will do here up to third
normal
form which  is BCNF biyce code normal form............
Ms ACCESS ::
queries .
form .
table .
report .
modules .
macro .
Threats  ::
managment sys 's functions  
RDBMS::: relational dbms

USES OF DATA BASE SYS:::


BANKS
NET e, g yahoo has users data base
ATM
NADRA
on line shopping check credit card data base..
supermarket the barcode data base.
travel agent access data bases of flights & holidays inns..
Library
insurance
university

Database Data Models


DATABASE MODELS TUTORIAL

DATA MODELS ::
an integrated collection of concept for describing data , relatinship b/w data &
constraints(conditions & rules regulation) n an organizations ...
Components of DM :
1. structural part  :: rules & regulation which makes db
2.manipulation part ::define operation on data
3.integrity rules :: data validation
Types of DM ::
1. object Based DM : uses concepts such as entity, attr, relationships .....types r
entity relationship
semantic
functional
object oriented
2. record based DM : db consists of a num of fixed format records of possibly
 different types
relational  :: by table , name of column should be unique .. intersection of row &
column
s cell
hireracharal :: tree str , link list
network ::data s represented as a collection of records. it's a circular list, so we don;t
have to waste time in searching because nodes r connected...
3.physical DM :: index mechanism , os + dbms work, how data s stord on HD,
access
mechanism of data ....

DATABASE RELATIONAL MODEL TUTORIAL

HISTORY OF RELATIONAL MODEL:


Relational model was 1st proposed by E.F.Codd
System R, then IBM developed it’s own DB known as DB2, then Oracle was created
Relation s actually the mathematical table.
RELATIONAL DATASTRUCTURES /STRUCTURAL PART OF
RELATION/ TERMINOLOGY

1. Relation : a table wth Col & rows.


2. Attribulte /fields : named column
3. Tuple : row of relation/record
4. Degree :num of att in a relation .if the colum/attr is only one then relation s of
degree
5. one also known as uniary . if a relation has two columns then it’s knowm as
degree 2 also
6. known as binary.
7. Cardinality : num of rows (tuple) in a relation .
8. Domain : data type .Set of allowable values for one or more att.
9. Relational Db: collection of normalized relations.
PROPERTIES OF RELATION:

1. Each table should have a distinct name.


2. Each cell should have one value (atomic value).
3. Attribute names should be unique.
4. Values of an attr are from the same domain.
5. Order of att has no significance.
6. Each tuple should be distinct. Means no duplicate rows.
7. Order of rows has no sigificance

DATABASE RELATIONAL KEYS TUTORIAL

RELATIONAL KEYS:
To access a record

1. Super Key: an att or set of att that uniquely identifies a tuple with in a
relation.combine
2.  all att.
3. Candidate keys: an att or set of att that uniquely identifies individual
occurrences of
4. entity type. e,g stdid, nic, passport num..
5. Composite key: if there are no such candidate keys then we concatenate more
than one
6.  attr & it makescomposite keys e,g st.name it’s f.name & it’s address combinely
can make a
7. composite
8. Primary key: a canditate keywhich is selected  to define a record e,g in univ we
pronounce
9. a person by it’s st.id not by it’s passport num .it’s the key which the
organizatoin take as base.
10. ]Usually a pkey s designated as underline in writing. There would be no
null in primary key.
11. alternate key : all those cand keys which are except pkey.
12. Foreign key: an att or set of att within one relation that matches the
caadidate key of
13. some (possibly the same ) relation.It can have only two things one the
info to which it s
14. related & then null(zero) nothing else.

RELATIONAL INTEGRITY:
Rules that ensures that data is accurate.

1. Entity Integrity: no nll in pkey ( Null: no value in a key even not space. )
2. Referential Integrity J (of reference) if a foreign key exists in a relation,
3. either the foreign key value must match a candidate key value of some tuple in
it’s
4. home relation or the foreign key value must be wholly null.
5. Enterprise Constraints: enterprise =organisation ..additional rules specified
by the
6.  users or db admin of a db

DATABASE RELATIONAL INTEGRITY TUTORIAL

RELATIONAL INTEGRITY:
Rules that ensures that data is accurate.

1. Entity Integrity: no nll in pkey ( Null: no value in a key even not space. )
2. Referential Integrity J (of reference) if a foreign key exists in a relation,
3. either the foreign key value must match a candidate key value of some tuple in
it’s
4. home relation or the foreign key value must be wholly null.
5. Enterprise Constraints: enterprise =organisation ..additional rules specified
by the
6.  users or db admin of a db.

DATABASE RELATIONAL ALGEBRA TUTORIAL

RELATIONAL LANGUAGES:
RELATIONAL ALGEBRA:
It’s a theoratical langauge which wth operations work on one or more relations to
define another
relation without changing thte original relation...
FACILITIES: (operations) of relational algebra:

1. Selection(restriction). Selection of rows E,g salary>100(staff).those employ who


have
2. salary more than 1000in salary table ..O condition  (R) e.g O salary>100  (Staff)
3. Projection: select columns from a relation. ∏ col1,…….coln (R)…… ∏ sno,fname,address
4. (Student)
5. Cartesian Product: concatinate rows of one relation to other relation’s record.
R * S.. (Sid,name)(strudent)*(cid)(courses)..sid , name are the record of student
relations &
6. cid is the record of course table
7. Union: to join two relations…..R ⋃S

        union compatible..>data type must be same .


        No duplication: no duplicate rows.

1. Difference: tuples which are in R but not n S . R - S ..wat r the members


which are
2. in one society but not n another society.
3. Joins Operators: joining of two relations. Join operators are
o Theta Join :matching of two field in two relation. It include =,<,><=,=!.....R  ⋈condit
o Equi join: Teta is general form so for equal it s equal join, for the greater it s gre
o join.
o Natural join: if there are two columns that will become one.
o Outer join: those which are matching & those which are not matching that is
complete
o relation. ⊳⊲
o Semi join: DDB(distributd DB) take relations from one side & then relations fro
other
o  side.  R ⊳f S…where f s  condition or predicate. protocol
4. Intersection: tuples that r n both R & S & must be union-compatible. R ⋂S
5. Division : R ∻S

DATABASE VIEW TUTORIAL

A view s the dynamic result of one or more relational operations operating on the
base
 relations to produce another relation. A view is a virtual relation that doesn’t actually
 exist n the db but is produced upon request by a particular user, at the time of
request.

Purpose of views:

1. Security
2. Customized access of data
3. Simplify complex operations on base relations.

Updating views:

1. Updates r allowed by query involving a single base relation & containing either
2. pkey or cand key of base relation.
3. no updates through views which involve multiple base relation.
4. no udate through views which involves aggregation or grouping operations.

DATABASE ERM AND ERD TUTORIAL


ENTITY RELATIONSHIP MODLE: (ERM)
ERM uses the ER diagram to represent the conceptual
schema(synopsis/outline/diagram)
 which is independent of DBMS. it includes:à

ENTITY TYPE:
Entity s an instance of an entity type that s uniquely identifiable.
S an obj or concept having independent existance / that thing abt which org wana
record data…..existance is of two kinds:
Physical e,g students, teachers
Conceptual e,g sale, examination

TYPES OF ENTITIES:
Æ      Weak Entities:  whose existance depend on strong entity e,g subject
selected. Represented by double rect
Æ      Strong Entities: who has it’s own existance e,g teacher. Represented by
single rect

ATTRIBUTES :
Property of an entity or a relation ship type. represented by oval.
e,g student has name , rno.
Types of attribute:

1. Simple att: an att composed of single component.. e,g sales , gender(either male
/
2. femal)
3. composite att: an att composed of multiple components.
4. single valued att: an att that holds single value for an entity e,g rno
5. multi valued att: an att that holds multiple value for an entity e,g a person has
two telephone #
6. derived att: an att that represents a value that s derivable from the value of a
related att or set of att , not necessarily in the same entity. e,g we can derive
age from DOB. So no need to put age because it can be derived any time. e,g
age

       KEYS
             all 6 keys . chap 3…

RELATIONSHIP TYPES: any meaningful association among entity types e,g


teaching , paying fees.
Degree of relationship: the number of participating entities in a relation.
uniary (student), binary(student ,teachers), ternary(teachers,student, subject),
Quaternary
Recursive Relationship: a relationship where the same entity participate more than
once in different roles..                                     
ATTRIBUTES ON REALATIONSHIPS: e,g teachers (entity)
checks(relationship) the papers(entity)
But we can put the checking date  which s an att on relationships…

PARTICIPATING CONSTRAINTS:
Employee------------completes--------------courses----course ID
                                                                                 -
                                                                              
determies whether the existance of am entity depends upon it’s being related to
another enityt through relation
there could be two problems :
ambigous:……….. FAN trap
missing link: …………chams trap
FAN TRAP: Exist when a model represents a relationship b/w entity types , but
the pathway b/w certain entity accurreness is ambiguous(missing link or path
doesn't exist)...
                CHASM TRAP:
 
 
                NOTATION                                          MEANING
                                                                                Strong Entity Type
                                                                                Weak Entity Type
                                                                                Weak Relationship
                                                                                Attribute
                                                                                Primary Key Attribute
                                                                                Multi Valued Attribute
                                                                                Derived Attribute
                                                                                Composite Attribute

Db Normalization
DATABASE NORMALIZATION TUTORIAL

Normalization is a technique for producing a set of relations with desirable


prop, given the data requirements of an enterprise...
 
                1: Insertion Anomalies:
                2: Deletion  Anomalies:
                3: Modification  Anomalies:
 
FUNCTIONAL DEPENDENCY:
                FD describes relationship b/w Attribute in a relation. For Example,
if A & B are Attribute of
a relation R, B is functionally dependent on A (A--->B), if each value of A is in R
is associated with exactly
 one value of B in R...
                A (on the left side of arrow) is known as Determenant, which is any
Attribute on which same
other Attribute is fully functionally dependent...
 
FULL FUNCTIONAL DEPENDENCY:
                If A--->B but B isn't functionally dependent on any proper subset of
A...
 
TRANSITIVE DEPENDENCY:
                If A, B, C are Attribute of a relation such that A--->B & B--->C than
C is transitively dependent on
A via B, (provided that A is not functionally dependent on B or C)...

DATABASE 1NF 2NF 3NF TUTORIAL

 UNF: A table that contains 1/more repeating gps.


                1NF: Each cell must have one value & no repeating gps.
                2NF: Every non-primary key Attribute is fully functionaly dependent
on primary key. i.e. Remove
 partially dependency.
                3NF: Dependent on primary key. i.e. Remove transitive dependency.
                BCNF: Boyce Codd Normal Form: Every determenent is a candidate
key.
                4NF---->5NF: Higher Normal Form

Database Security

DATABASE SECURITY THREATS TUTORIAL


The protection of DB against international or uninternational threats using
both technical and administrative controls...
                We consider DB security in following situations...
                1: Theft & Fraud
                2: Loss of Confidentiality
                3: Loss of Privacy
                4: Loss of Integrity
                5: Loss of Availability
 
THREATS:
                Any situation or event, whether international or uninternational,
that will adversely effect a sys & consequently an org...
                1: HARDWARE:
                                # Fire, Flood, Bomb
                                # Power Failure, Fluctuations
                                # Thrteats of equipments
                                # Physical Damage
                                # Radiation(mob etc)
 
                2: COMMUNICATION NETWORK:
                                Ensure that no wiring break
 
                3: DBMS:
                                # Theft
                                # Greater Access
               
                4: USER:
                                # Hacking
                                # Viewing & Disclosing
               
                5: Programing & Operators:
                                # Less Trained
                                # Creates Unsequre SW

DATABASE SECURITY SOL TUTORIAL

COUNTER MEASURES COMP BASED:


                1: Authorization: Granting of rights, which enable a sub to have
access to a sys ...
                2: Views(sub schema): define before...
                3: Backing Up: Copies of DB onto offline storage media...
                4: Journaling: Keeping a journal(log) of all changes made to DB to
enable recovery in case of failure...
                5: Check Pointing: Ensure that data in main memory is written out
to disk...
                6: Integrity:
                7: Encryption: Encoding of data by a SP algo...
 
COUNTER MEASURES NON COMP BASED:
                1: Security Policy: Assign responsibility to people...
                2: Personnel Controls: Monitoring Employees, Staff Training,
Separation of Duties.
                3: Secure Positioning of Equipments:
                4: Secure Data & SW:
                5: Escrow Agreement:
                6: Maintainence Agreement:
                7: Physical Access Controls:
                8: Building Controls:
                9: Emergency Arrangements

Das könnte Ihnen auch gefallen