0% found this document useful (0 votes)
8 views8 pages

Reviewer Sa Databseshit

Uploaded by

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

Reviewer Sa Databseshit

Uploaded by

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

WEEK 2

Introduction to Database Systems

DATA–The term that means groups of information that represent the qualitative or quantitative
attributes of a variable or set of variables.

INFORMATION–defined as a refined or processed data that has been transformed into


meaningful and useful form of data for specific users.

DATABASE–A data base is a collection of information that is organized so that it can easily be
accessed,managed and updated.

DATABASE MANAGEMENT SYSTEM (DBMS) - It is a collection of interrelated data and aset


of programs to access the data.

DATABASE ENVIRONMENT – A database environment is a collective system of components


that comprise and regulates the group of data,management,and use of data,which consist of
software,hardware,people,techniques of handling database,and the data also.

Databases & Data Modeling

1960–File Processing Systems (punchcards,papertape,magnetictape,batchprocessing)

File System Data Processing It is the job of updating,sorting,or validating a data file.A file is a
chunk of data. So file processing means anything you do to that data. Such as update ,rename,
move,copy and the like.
1970–Hierarchical and network (limited data dependence,no widely accepted theoretical model)
1980–Relational Database was developed by Dr.E.F.Codd
1990–Object-oriented database (large amount of structured and unstructured data)
2000– and beyond–multi-tier,client-server,distributed environments,web-based,datamining

Personal Database–PC’s,PDAs,cellphones used in special situations where there is a need to


share data among users.

Workgroup Database–Designed to support collaboration in a small team(less than 25 people)

Department Database–typically larger than a workgroup(25-100people) and more diverse


range of functions.

Enterprise Database–Scope of the whole organization.

Hierarchical Database–The most intuitive way to visualize this type of relationship is by


visualizing an upside down tree of data .In this tree, a single table acts as the "root" of the
database from which other tables "branch"out.
Network Database–This model solves the problem of data redundancy by representing
relationships interms of sets rather than hierarchy.

Relational Database–A relational database uses relations or two-dimensional tables to store


information.

Object Relational Database–is a database management system(DBMS)similar to a relational


database,but with an object-oriented database model.

Datamodeling- is the process of creating a simplified diagram of a software system and the
data elements it contains,using text and symbols to represent the data and how it flows.

Phases of Data Modeling

Conceptual Model- It is the typical starting point for datamodeling,identifying the various data
sets and data flow through the organization.

Logical Model- It describes the data flow and database content .It adds detail to the overall
structure in the conceptual model.

Physical Model- It describes the specifics of how the logical model will be realized.It is specific
to a designated database software system.

Data Modeling Techniques

Entity-Relationship Data Modeling- It visually map entities, their attributes and the
relationships between differententities.

Dimensional Modeling-They consist of fact tables that contain data about transactions or other
events and dimension tables that list attributes of the entities in the fact tables.

Graph Modeling- Typically paired with graph databases, it's often used to describe datasets
that contain complex relationships.
WEEK 3

Business Rules and Data Abstraction

Business Rules- Abusiness rule is a set of approved guidelines or framework within an


organization.

Types of Business Rules

•Database–oriented

•Application-oriented

Database–oriented- Database oriented business rules impose constraints that you can
establish within the logical design of the database. You implement a given constraint by
modifying various field specification elements, relationship characteristics,or a combination of
the two.

Application–oriented- Application oriented business rules impose constraints that you cannot
establish within the logical design of the database.You must instead establish them within the
physical design of the database or within the design of a database application,where they will be
more applicable and meaningful.

Data Abstraction- refers to the process of hiding irrelevant details from the user.

Levels of Data Abstraction

Data Independence-users and data should not directly interact with each other. The user
should be at a different level and the data should be present at some other level.

View Level- This level tells the application about how the data should be shown to the user.

Conceptual Level or Logical Level- This level tell show the data is actually stored and
structured.

Physical Level or Internal Schema- Physical level tells us that where the data is actually
stored; it tells the actual location of the data that is being stored by the user.
WEEK 4

The Relational Database Model

RelationalModel(RM) represents the database as a collection of relations. A relation is nothing


but a table of values.Every row in the table represents a collection of related data values.These
rows in the table denote a real-world entity or relationship.

Relational Model Concepts

Tuple: It is nothing but a single row of a table,which contains a single record.

RelationSchema:A relation schema represents the name of the relation with its attributes.

Degree:The total number of attributes which in the relation is called the degree of the relation.

Cardinality:Total number of rows present in the Table.

Column:The column represents the set of values for a specific attribute.

Relationinstance:Relationinstance is a finite set of tuples in the RDBMS system.


Relationinstances never have duplicate tuples.

Relation key:Every row has one,two or multiple attributes,which is called relation key.

Attributedomain:Every attribute has somepre-defined value and scope which is known


asattribute domain.

RelationalIntegrityconstraints- in DBMS are referred to conditions which must be present for


a valid relation.These Relational constraints in DBMS are derived from the rules in the mini-
world that the database represents.

DOMAIN Constraints

Domain constraints – can be violated if an attribute value is not appearing in the


corresponding domain or it is not of the appropriate data type.

KEY Constraints

An attribute that can uniquely identify a tuple in a relation is called the key of the table. The
value of the attribute for different tuples in the relation has to be unique.
REFERENTIAL Integrity Constraints

Referential Integrity constraints in DBMS are based on the concept of ForeignKeys. A


foreignkey is an important attribute of a relation which should be referred to in other
relationships. Referential integrity constraint state happens where relation refers to a key
attribute of a different or same relation.However,that key element must exist in the table.

WEEK 5

Relational Database cont.

Key Constraints (cont.) There must be atleast one minimal subset of attributes in the
relation,which can identify a tuple uniquely. This minimal subset of attributes is called key for
that relation.If there are more than one such minimal subsets,these are called candidate keys.

Data Redundancy

Redundancy means having multiple copies of same data in the database.This problem a rises
when a database is not normalized.Suppose a table of student details attributes
are:studentId,studentname,collegename,collegerank,courseopted.

Insertion Anomaly - If a student detail has to be inserted whose course is not being decided
yet then insertion will not be possible till the time course is decided for student.This problem
happens when the insertion of a data record is not possible without adding somea dditional
unrelated data to the record.

DeletionAnomaly –If the details of students in this table are deleted then the details of college
will also get deleted which should not occur by commonsense.This anomaly happens when
deletion of a datarecord results in losing some unrelated information that was stored as part of
the record that was deleted fromatable.

UpdateAnomaly – Suppose if the rank of the college changes then changes will have to be all
over the database which will be time-consuming and computationally costly.

Database Relationships

One-to-OneRelationship

A one-to-one (1:1) relationship means that each record in Table A relates to one, and only
one,recordin TableB,and each recordinTable Brelates to one,and only one,recordinTableA.
One-to-ManyRelationship

A one-to-many (1:N) relationship means a record in Table A can relate to zero, one, or many
records in TableB. Many records in TableB can relate to one record in TableA. The potential
relationship is what's important; for a single record in TableA, there might be no related records
inTableB,or there might be only one related record,but there could be many.

Many-to-ManyRelationship

The given tables hold data about employees and the projects to which they are assigned. Each
project can involve more than one employee and each employee can be working on more than
one project (the"domorewithless"thing).This constitutes a many-to-many(N:N)relationship.

Codd’s Relational Database Rules

Rule 1: Information Rule The data stored in a database, may it be user data or metadata,
must be a value of some tablecell. Everything in a database must be stored in a table format.

Rule 2: Guaranteed Access Rule Every single data element (value) is guaranteed to be
accessible logically with a combination of table-name,primary-key(rowvalue),and attribute-
name(columnvalue).No other means,such as pointers,can be used to access data.

Rule 3: Systematic Treatment of NULL values The NULL values in a database must be given
a systematic and uniform treatment. This is a very important rule because a NULL can be
interpreted as one the following−data is missing,data is not known,or data is not applicable.

Rule 4: Active Online Catalog The structure description of the entire database must be stored
in an online catalog, known as data dictionary, which can be accessed by authorized users.
Users can use the same query language to access the catalog which they use to access the
database itself.

Rule 5: Comprehensive Data Sub-Language Rule A database canonly be accessed using a


language having linear syntax that supports data definition, data manipulation, and
transaction management operations. This language can be used directly or by means of
some application. If the database allows access to data without any help of this language,then it
is considered as a violation.

Rule 6: View Updating Rule All the views of a database, which can theoretically be updated,
must also be up datable by the system.

Rule 7: High-Level Insert, Update, and Delete Rule A database must support high-level
insertion,update,and deletion. This must not be limited to a singlerow, that is, it must also
support union,intersection and minus operations to yield sets of data records.
Rule 8: Physical Data Independence The data stored in a database must be independent of
the applications that access the database.Any change in the physical structure of a database
must not have any impact on how the data is being accessed by external applications.

Rule 9: Logical Data Independence The logical data in a database must be independent of its
user’s view (application) Any change in logical data must not affect the applications using it. For
example,if two tables are merged or one is split in to two different tables, there should be no
impact or change on the user application.This is one of the most difficult rule to apply.

Rule 10: Integrity Independence A database must be independent of the application that use
sit. All its integrity constraints can be independently modified without the need of any change in
the application.This rule makes a database independent of the front-end application and its
interface.

Rule 11: Distribution Independence The end-user must not be able to see that the data is
distributed over various locations. Users should always get the impression that the data is
located at one site only.This rule has been regarded as the foundation of distributed database
systems.

Rule 12: Non-Subversion Rule If a system has an interface that provides access to low-level
records,then the interface must not be able to subvert the system and by pass security and
integrity constraints.

Relation Set Operators in DBMS

DBMS supports relational set operators as well. The major relational set operators are union,
intersection and set difference.All of these can be implemented in DBMS using different queries.

Union

Union combines two different results obtained by a query into a single result in the formofatable.
However, the results should be similar if union is to be applied on them. Union removes all
duplicates,if any from the data and only displays distinct values.If duplicate values are required
in the resultant data,then UNIONALL isused.

Intersection

The intersection operator gives the common data values between the two data sets that are
intersected. The two data sets that are intersected should be similar for the intersection operator
to work.Intersectional so removes all duplicates before displaying the result.

SetDifference

The set difference operators takes the two sets and returns the values that are in the first set but
not the second set.
Types of Views

USER View – The user view lists only those tables and views which are created by the current
user/schema. It does not list the tables and views of other schemas nor the ones to which it has
access.It displays only those objects that are created by it.

ALL View The ALL view lists all the tables and views that are owned by the current user as well
as those tables and views to which it has access.That means it lists the tables and views that
are created by it, and those tables and views of other user/schema to which it has access.

DBA View DBA view will have access to all the tables and view so fall the users/schema. But
these views will be accessible by only those who have DBA privileges.

You might also like