Search for notes by fellow students, in your own course and all over the country.
Browse our notes for titles which look like what you need, you can preview any of the notes via a sample of the contents. After you're happy these are the notes you're after simply pop them into your shopping cart.
Document Preview
Extracts from the notes are below, to see the PDF you'll receive please use the links above
ER Diagram Representation
Now let's look at how the ER Model is represented in an ER
diagram
...
Entity
Entities are represented by means of rectangles
...
Attributes
Attributes are the properties of entities
...
Every ellipse represents one
attribute and is directly connected to its entity (rectangle)
...
Then, each node is linked to its associated
property
...
Multivalued attributes are depicted by double ellipse
...
Relationship
Relationships are displayed using diamond-shaped boxes
...
Each of the
entities (rectangles) engaged in a relationship are connected by
a line
...
The number of instances of an entity from a relation that
can be connected to the connection is known as its cardinality
...
The following image reflects that only one instance of
each entity should be associated with the relationship
...
•
One-to-many − When more than one instance of an
entity is associated with a relationship, it is marked as
'1:N'
...
It depicts one-to-many
relationship
...
The following image reflects that more than one
instance of an entity on the left and only one instance
of an entity on the right can be associated with the
relationship
...
•
Many-to-many − The following image reflects that
more than one instance of an entity on the left and
more than one instance of an entity on the right can be
associated with the relationship
...
Participation Constraints
• Total Participation − Each entity is involved in the
relationship
...
• Partial participation − Not all entities are involved in
the relationship
...
Generalization Aggregation
Database entities may be theoretically expressed hierarchically
using the ER Model
...
Moving up the structure, or generalization, is the process
through which items are brought together to reflect a wider
viewpoint
...
Both the
thing and the person shall be the pupil
...
Generalization
As was already mentioned, generalization is the process of
creating generalized entities that have all of the properties of all
other generalized entities
...
Crow, dove, house sparrow, and pigeon, for instance, can
all be categorized as birds in general
...
In specialization,
a collection of things is broken down into smaller groups
according to their traits
...
An individual has a name, birthdate, gender, etc
...
But depending on their
position within the organization, people can be classified as an
employee, employer, customer, or vendor
...
Inheritance
We use all the above features of ER-Model in order to create
classes of objects in object-oriented programming
...
Inheritance is an important feature of Generalization and
Specialization
...
For example, the attributes of a Person class such as name, age,
and gender can be inherited by lower-level entities such as
Student or Teacher
...
Edgar F
...
Any database management system that merely uses its
relational capabilities to manage stored data is subject to these
criteria
...
Rule 1: Information Rule
The data stored in a database, may it be user data or metadata,
must be a value of some table cell
...
Rule 2: Guaranteed Access Rule
Every single data element (value) is guaranteed to be accessible
logically with a combination of table-name, primary-key (row
value), and attribute-name (column value)
...
Rule 3: Systematic Treatment of NULL Values
The NULL values in a database must be given a systematic and
uniform treatment
...
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
...
Rule 5: Comprehensive Data Sub-Language Rule
A database can only be accessed using a language having linear
syntax that supports data definition, data manipulation, and
transaction management operations
...
If the database allows
access to data without any help of this language, then it is
considered as a violation
...
Rule 7: High-Level Insert, Update, and Delete Rule
A database must support high-level insertion, updation, and
deletion
...
Rule 8: Physical Data Independence
The data stored in a database must be independent of the
applications that access the database
...
Rule 9: Logical Data Independence
The logical data in a database must be independent of its user’s
view (application)
...
For example, if two tables are merged or
one is split into two different tables, there should be no impact
or change on the user application
...
Rule 10: Integrity Independence
A database must be independent of the application that uses it
...
This rule
makes a database independent of the front-end application and
its interface
...
Users should always get the impression
that the data is located at one site only
...
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 bypass security and integrity constraints
...
The
traits and abilities needed to handle data efficiently for storage
are all included in this straightforward paradigm
...
This format stores the relation among entities
...
Tuple − A single row of a table, which contains a single record for
that relation is called a tuple
...
Relation instances
do not have duplicate tuples
...
Relation key − Each row has one or more attributes, known as
relation key, which can identify the row in the relation (table)
uniquely
...
Constraints
Every relation has some conditions that must hold for it to be a
valid relation
...
There are three main integrity constraints −
•
•
•
Key constraints
Domain constraints
Referential integrity constraints
Key Constraints
There must be at least one minimal subset of attributes in the
relation, which can identify a tuple uniquely
...
If there are more than
one such minimal subsets, these are called candidate keys
...
a key attribute can not have NULL values
...
Domain Constraints
In a real-world setting, attributes have particular values
...
The
attributes of a relation have been subjected to the same
limitations
...
Age, for instance, cannot be less than zero, and
telephone numbers cannot have digits other than 0 and 9
...
A foreign key is a key attribute of a relation that can be
referred in other relation
...
Relational Algebra
A query language that can help users query the database
instances is expected to be included in relational database
systems
...
Relational Algebra
Relational algebra is a procedural query language, which takes
instances of relations as input and yields instances of relations as
output
...
An operator can be
either unary or binary
...
Relational algebra is performed
recursively on a relation and intermediate results are also
considered relations
...
Select Operation (σ)
It selects tuples that satisfy the given predicate from a relation
...
p is prepositional logic formula which may use
connectors like and, or, and not
...
For example −
σsubject = "database"(Books)
Output − Selects tuples from books where subject is 'database'
...
σsubject = "database" and price = "450" or year > "2010"(Books)
Output − Selects tuples from books where subject is 'database'
and 'price' is 450 or those books published after 2010
...
Notation − ∏A1, A2, An (r)
Where A1, A2 , An are attribute names of relation r
...
For example −
∏subject, author (Books)
Selects and projects columns named as subject and author from
the relation Books
...
For a union operation to be valid, the following conditions must
hold −
r, and s must have the same number of attributes
...
• Duplicate tuples are automatically eliminated
...
Set Difference (−)
The result of set difference operation is tuples, which are present
in one relation but are not in the second relation
...
∏ author (Books) − ∏ author (Articles)
Output − Provides the name of authors who have written books
but not articles
...
Notation − r Χ s
Where r and s are relations and their output will be defined as −
r Χ s = { q t | q ∈ r and t ∈ s}
σauthor = 'tutorialspoint'(Books Χ Articles)
Output − Yields a relation, which shows all the books and articles
written by tutorialspoint
...
The rename operation allows us to rename the output
relation
...
Notation − ρ x (E)
Where the result of expression E is saved with name of x
...
Relational calculus exists in two forms −
Tuple Relational Calculus (TRC)
Filtering variable ranges over tuples
Notation − {T | Condition}
Returns all tuples T that satisfies a condition
...
name | Author(T) AND T
...
TRC can be quantified
...
For example −
{ R| ∃T ∈ Authors(T
...
name=T
...
Domain Relational Calculus (DRC)
In DRC, the filtering variable uses the domain of attributes
instead of entire tuple values (as done in TRC, mentioned above)
...
, an | P (a1, a2, a3,
...
For example −
{< article, page, subject > | ∈ TutorialsPoint ∧ subject =
'database'}
Output − Yields Article, Page, and Subject from the relation
TutorialsPoint, where subject is database
...
DRC also involves relational operators
...