Cs403 Short Notes
Cs403 Short Notes
Ch02
Data:
collection of raw facts.
Information:
Meaningful form of the Data is called information.
Schema: is a repository or structure to express the format.
Database is a self describing collection of …………..records.”?
i): interrelated ii): intera-related
Two basic operations performed by the DBMS are:
• Management of Data in the Database.
• Management of Users associated with the database.
Concurrency means the access of database form as number of points
simultaneously.
Data inconsistency leads to a number of problems:
Loss of information and incorrect results.
Different types of costs:
1. Financial
2. Personnel
Levels of Data: (03)
1. Real-world data
2. Metadata (also known as schema)
3. Data Occurrence
Q: Level of data at which entities or objects exist in reality is called?
a. Real world data
Q: Which one of the following is NOT a characteristic of meta data?
a. Data about data
b. Describes a data dictionary
c. Self-describing
d. Includes user data
Meta data consist on:
1. type of data
2. size of a certain attribute
Ch03
Database standard proposed by ANSI/SPARK in 1975 is being used
worldwide.
ANSI/SPARC architecture: The conceptual level is a level of indication
between the internal level and the external level. (Page 33)
The three levels architecture is useful for hiding the details of internal
systems.
Three level architecture:
1. External View or User view (Level, Schema or Model)
2. Logical View or Conceptual View (Community view)
3. Internal view or Physical View / Schema
Architecture: repository used for storing definitions of the structures used in
database.
Extension -It is the number of tuples present in a table at any instance. This is
time dependent.
Intension - It is a constant value that gives the name, structure of table and
the constraints laid on it.
Intension is undesirable to change intension.
Q: A change to the data made for the extension of data will effect only a
….record?
i): Single ii): Whole
Q: A change to the internal level (Intention) of the database the change effects
….. the stored records.
i) All/whole ii): Single
Other name of Logical or conceptual view (Level or model):
Community view
Community view:
It stores the complete data of the organization.
Q: Conceptual schema as it describes the ……. of the database?
i): Intention ii): Extension
Data stored onto a magnetic media is stored in binary format.
Mapping: changed format of the
The mechanism through which the records or data at one level is related to
the changed format of the same data at another level is known as
mapping.
External/conceptual mapping:
When we associate one form of data at the external level with the same data in
another form is know as the external/conceptual mapping of the data.
Conceptual/Internal mapping:
when data at the conceptual level is correlated with the same data at the
internal level, this is called the conceptual/Internal mapping.
The data store on the physical level is in binary format.
At the internal level we can see that data is prefixed with:
1. Block Header BH
2. Record header RH
The Record header is prefixed to every record.
The block header is prefixed to a group of records.
The block size is generally larger than the record size.
Data independence types:
o Logical Data Independence
o Physical Data Independence
Logical Data Independence Physical Data Independence
Changes in conceptual/
Logical model do not Changes in the internal
affect the external views model/physical do not affect the
conceptual model
Ch: 05
Database Application development Process includes the Following
Stages or steps:
Database Design Application/program Implementation
Q: Database Application development Process occur in …..?
i): Parallel ii): Series
Physical Design:
transform our logical design into a Physical design.
DFD-Symbols:
Data Flow Diagram: It is used to design systems graphically.
Links between processes describe the information flow.
DATAFLOW:
DATA STORE:
Data store is a repository for the storage of the data.
It is express with a rectangle open on right width and left width of the
rectangle drawn with double lines.
Name of the DATASTORE is a noun.
Processes:
Processes are expressed with ovals or rounded rectangles.
Processes are used to express the transformation of incoming dataflow into
outgoing dataflow.
DFD-Process:
External Entities:
These are the entities interacting with the system in any of two different ways:
1. They may be either receiving the data from the system,
2. They may be producing the data for the system to consume.
Shape used to express external entities is rectangle.
Collector:
Multiple to Single
Collector is used to show the convergence of data to a single point.
Separator:
Single to Multiple
The dataflow symbol which is used for separating data from a single source to
multiple sinks is known as a separator.
AND Operator:
This operator is used when data from a source process must flow to all the
connected sinks.
Types of DFD:
o Context diagram (least amount of details)
o Level 0 diagram
o Detailed diagram
CDFD: Context Data Flow Diagram
DDFD: Detailed Data Flow Diagram
Context Diagram:
least amount of details about the working of the system.
They always consist of single process and describe the single system.
Name of the CDFDs is generally a Noun Phrase.
no data stores are created.
Level 0 Data Flow Diagrams:
is used to describe the working of the whole system.
Ch: 07
Ch: 08
A key is an attributes or set of attribute which is used to uniquely identifies a
tuple or Row.
Super key is general key.
Simple Key: consisting of single attribute.
Composite key or (Concatenated Key): it could be composite which consists
of two or more attributes.
Following are the major types of keys:
o Super Key o Candidate Key (Minimal super key)
o Primary Key o Alternate Key
o Secondary Key o Foreign Key
A super key is key that identify a record uniquely.
Primary key:
1. Not be a null
2. Uniquely identify
Candidate key, Primary key, Alternate key these all are super key.
3. Candidate key/ Minimal super key:
A super key for which no subset is a super key is called a candidate key
or the minimal super key is the candidate key.
4. (A candidate key is a super key which have no extra attributes)
It means that there are two conditions for the candidate key:
1. It identifies the entity instances uniquely, as is required in case of super
key,
2. It should be minimum, that is, no proper subset of candidate key is a
key.
Every candidate key is a super key.
Every primary key (PK) is a candidate key and every candidate key is a super
key.
Note:
Every candidate key is a super key but not the other way round.
The relation that holds between super and candidate keys also holds between
candidate and primary keys, that is,
Note:
Every primary key (PK) is a candidate key and every candidate key is a super
key.
NULL: that means “not given” or “not defined”.
There is not the compulsion or it is not necessary for secondary key to return
unique instance,
In case of super, candidate, primary and alternate keys it is compulsion that
they will always return unique instance.
Q: Which key is not necessary or not compulsion to return unique instance?
► Secondary key
► super key
► candidate key
► primary key
►alternate key
Ch: 09
Participants:
Entities enrolled in a relationship are called its participants.
Mapping
One-to-One mapping:
A mapping R from X to Y is one-to-one
if each entity in X is associated with at most one entity in Y and vice versa.
Many-to-One mapping:
A mapping R from X to Y is many-to-one
if each entity in X is associated with at most one entity in Y but each entity in
Y is associated with many entities in X.
One-to-Many mapping:
A mapping R from X to Y is one-to-many
if each entity in X is associated with many entities in Y but each entity in Y is
associated with one entity in X.
Many-to-Many mapping:
A mapping R from X to Y is many-to-many if each entity from X is associated
with many entities in Y and one entity in Y is associated with many entities in
X.
Ch: 10
Relationship Cardinalities:
is the number of entities to which another entity can map under that
relationship.
Maximum cardinality: tells us that how many instance of an entity can be
placed in the second relation at most.
Minimum cardinality: show us that how many instance of one entity can be
placed in another relation at least.
Minimum cardinality Sign or notation:
Maximum cardinality Sign or notation:
Optional
Mandatory
Above all notations are called crow’s foot notation.
One cardinality we have used 1.
Many cardinality M or N is used.
Single arrow: show the one cardinality
Double arrow: show the many cardinality.
The black filled Dot is used for showing many cardinality.
Roles: The way an entity is involved in a relationship.
Two types of relationships:
1. Recursive Relationship: (Such a link initiates from one entity and
terminates on the same entity.
e.g. A one to one relationship
2. Multiple Relationships:
Two ETs having more than one relationship
Type of Dependencies:
Constraint:
Rule or constraint defines the existence of a super type entity in a subtype
entity.
Disjointness constraint
Disjoint rule
Overlap rule
Disjointne rule: Super type Sub type
Existence: exactly one instance
Overlap rule: Super type Sub type
Existence: multiple instances
Disjoint situation where one supertype entity instance can be placed only in
one subtype of that supertype.
Overlapping constraint; it is the situation where one supertype attribute can
be placed in more than one subtype entities.
To store several entities and neglect others, and it is called as partial
completeness constraint rule.
Subtype Discriminator:
methodology to determine that to which subtype one
instance of a supertype belongs.
Ch: 12
CRM: Cross Reference Matrix: doth:
Reports vs Items
Columns Vs Rows
The major item names on a matrix in the row wise order
The reports which will be generated will be written on top or in
column wise order.
Ch: 13
The cardinality between:
Student and program is one
Course offered and teacher is one
programs and students can be zero to many (0 - *)
teacher and course offered is one to many
Cardinality
Program and courses one to many (1 -*)
Courses and program zero to many (0 - *).
Student and program zero to many (0 - *)
semester and course many to many ( * *)
course offered and teacher one to many ((1 -*))
One to many (1 -*)
Zero to many (0 - *)
Many to many ( * -*)
CDD: Conceptual Database Design
LDD: Logical Database Design
The outcome of analysis phase is the……..?
i): CDD ii): LDD
Conceptual Database Design Logical Database Design.
Conceptual Database Design Logical Database Design
This design is independent of any tool dependent.
tool or data model.
Graphically Descriptive
More expressive less expressive
Ch: 14
Data model “a set of constructs/tools used to develop a database design.
The components of data model / Relational model (RDM):
Three components
1. Constructs /Structure
2. Manipulation language
3. Integrity constraints
RDM: Relational Data model
An IBM scientist E.F. Codd proposed the relational data model in 1970.
The RDM is based on a single structure and that is a relation.
The relation in RDM is similar to the mathematical relation.
The RDM is mainly used for designing/defining external and conceptual
schemas.
Table:
Database relation is also represented in a two dimensional structure called
table.
A table consists of rows and columns.
{
A row or tuple of a table represents a record or an entity instance,
Columns of the table represent the properties or attributes.
}
Q: There are ….. basic properties of the database relations?
i): Six
Each cell of a table contains atomic/single value.
A cell is the intersection of a row and a column.
The order of the columns is immaterial. / does not matter
An attribute can contain only a single value.
• Each column has a distinct name; the name of the attribute it represents
• The values of the attributes come from the same domain
• The order of the columns is immaterial (Order does not matter)
• The order of the rows is immaterial (Order does not matter)
• Each row/tuple/record is distinct, no two rows can be same.
As with the columns, if rows’ order is changed the table remains the same.
Two rows of a table cannot be same.
In the database context each ordered pair represents a tuple.
Elements in the ordered pairs represent values of the attributes.
Rows/tuples represent records
Columns represent the attributes.
Ch: 15
Order of columns:
Mathematical relations order does matter.
Database relations order does not matter.
Relationship is a link or association between one or more entity types.
Degree of a relation:
The number of columns in that relation.
Cardinality of a Relation:
The number of rows present in that relation.
Q: …..will be used quite frequently in the RDM?
i): Foreign key ii): Primary Key
There can be more than:
zero, one or multiple foreign keys in a table.
Primary Key:
Foreign Key: …………
Integrity Constraints:
Two main types
Entity integrity constraint (row Integrity) (PK)
Primary key cannot have null value
Referential integrity constraint (FK)
Value of Foreign key is either null or matches with a value in its home
relation
conceptual database into logical database
of
E-R data model into relational data model.
Null Constraints: value is not yet given, not defined yet.
By default a non-key attribute can have Null value.
Default Value:
We do not give any value to any particular attribute.
Default Value: used for efficiency purposes.
Transforming Rules: (2)
Converting conceptual database into logical database design:
1. Manually
2. automatically with CASE tools
Composite Attributes:
a combination of two or more than two attributes.
Multi-valued Attributes:
more than one value against an attribute.
Ch: 16
Relation is a structure, which is obtained by converting an entity type in E-R
model into a relation.
Relationship is in between two relations of relational data model.
Relationships in relational data model are mapped according to their degree
(Columns) and cardinalities (Rows).
Following are the three types of cardinalities for binary relationships:
o One to One
o One to Many (P K TO F K)
o Many to Many
Ch: 18
Join Operation: 42
Join is a special form of cross product of two tables.
Semi Join:
In semi join, first we take the natural join of two relations then we project the
attributes of first table only.
Predicate calculus:
Relational calculus takes name from a branch of symbolic logic called the
predicate calculus.
It has two following forms: -
1. Tuple Oriented Relational Calculus
2. Domain Oriented Relational Calculus
Tuple Variable:
A tuple variable is a variable that takes on only the tuples of some relation or
relations as its range of values.
It is expressed as
{S | P (S)}
Anomaly means inconsistency in the pattern from the normal form.
Q: How many types of Anomalies?
ANS:
There are four types of anomalies, which are of
i): Redundancy, ii): Insertion, iii): Deletion iv): Updation.