Attributes:: Example: Student (Stu - Lastname, Stu - Middlename, Stu - Firstname

Download as docx, pdf, or txt
Download as docx, pdf, or txt
You are on page 1of 30

DBMS

ATTRIBUTES:
Attributes are the characteristics of entities. Some entities can have
many attributes while others may only have a couple. As well, there
are five categories that attributes are classified in. This simple table
will be used to explain how each attribute can be a different type of
attribute:
Example: Student (stu_LastName, stu_MiddleName, stu_FirstName,
stu_Age, stu_Phone, stu_Email).
Required or Optional Attributes:
A required attribute is an attribute that must have a value in it, while
an optional attribute may not have a value in it and can be left blank.
The reasoning for making an attribute required is to put emphasis on
what is important in that entity and what makes it stand out from other
entities.
Example: Consider the entity Student above
stud_LastName and studFirstName would be required attributes as it
uniquely defines that table and we assume all students have a first and
last name. Optional attributes in the table Student could
be stu_MiddleName, stu_Email, and stu_Phone since some students
may not have a middle name, a phone number, or an email address .
Keys and Non-keys Attributes:
In every entity an attribute or grouped attributes uniquely identify that
entity. These attributes are the key attributes and range from Primary
key (single attribute identifier) to a Composite Key (Multi attribute
Identifier). The rest of the attributes after the identifier are considered
the non-key attributes or descriptors, which just describe the entity.
Example: Above in the table Student there is only one unique
identifier, stu_LastName, which is the primary key of the table. The rest
of the attributes are descriptors.
Single and Composite Attributes:
Attributes can be classified as having many parts to them or just a
single unbreakable attribute. The composite attribute is an attribute

that can be subdivided into other single attributes with meanings of


their own. A single attribute is just an attribute that cannot be
subdivided into parts.
Example: Imagine from the entity Student that instead of having the
three attributes: stu_LastName, stu_MiddleName, stu_FirstName it had
one attribute called stu_Name. The attribute stu_Name would be
considered a composite attribute since it can be subdivided into the
other three attributes: stu_LastName, stu_MiddleName, stu_FirstName.
The rest of attributes would be consider single attributes since they
can't be subdivided into parts.
Single-valued and multi-valued Attributes:
Attributes can be classified as single or multi-value. The single-value
attribute can only have one value, while the multi-valued attributes
usually can store multiple data in them.
Example: In the entity Student, stu_Address could be considered a
multi-value attribute since a student could have multiple addresses
where he lives at. An example of a single-value attribute would
be stu_LastName since a student usually has one last name that
uniquely identifies him/her.
Derived Attributes :
The last category that attributes can be defined is called a derived
attribute, where one attribute is calculated from another attribute. The
derived attribute may not be stored in the database but rather
calculated using algorithm.
Example: In the entity Student, stu_Age would be considered a
derived attribute since it could be calculated using the student's date
of birth with the current date to find their age.
Examples of derived attributes are: salary and age, start date and end
date of job tells us how many years person has contributed to the
company.
DOB is not an example of a derived attribute because it is inputted
information and not calculated.
Difference between strong entity and weak entity.

Data abstraction: Data abstraction is the reduction of a particular


body of data to a simplified representation of the whole. Abstraction,
in general, is the process of taking away or removing characteristics
from

something

in

order

to

reduce

it

to

set

of

essential

characteristics.
DBMS:
A database is an organized collection of data. It is the collection of
schemas, tables, queries, reports, views and other objects. The data is
typically organized to model aspects of reality in a way that
supports processes requiring information.
A database

management

system (DBMS)

is

a computer

software application that interacts with the user, other applications,


and the database itself to capture and analyze data. A general-purpose
DBMS is designed to allow the definition, creation, querying, update,
and administration of databases.
Advantages of DBMS
The

database

management

system

advantages, which are explained below:

has

promising

potential

1. Controlling Redundancy: In file system, each application has its


own

private

files,

which

cannot

be

shared

between

multiple

applications. This can often lead to considerable redundancy in the


stored data, which results in wastage of storage space. By having
centralized database most of this can be avoided. Sometimes there are
sound business and technical reasons for maintaining multiple copies
of the same data. In a database system, however this redundancy can
be controlled.
For example: In case of college database, there may be the number
of applications like General Office, Library, Account Office, Hostel etc.

It is clear from the above file systems, that there is some common data
of the student which has to be mentioned in each application, like
Rollno, Name, Class, Phone_No~ Address etc. This will cause the
problem of redundancy which results in wastage of storage space and
difficult to maintain, but in case of centralized database, data can be
shared by number of applications and the whole college can maintain
its computerized data with the following database:

It

is

clear

in

the

above

database

that

Rollno,

Name,

Class,

Father_Name, Address,
Phone_No, Date_of_birth which are stored repeatedly in file system in
each application, need not be stored repeatedly in case of database,
because every other application can access this information by joining
of relations on the basis of common column i.e. Rollno. Suppose any
user of Library system need the Name, Address of any particular
student and by joining of Library and General Office relations on the
basis of column Rollno he/she can easily retrieve this information.
Thus, we can say that centralized system of DBMS reduces the
redundancy of data to great extent but cannot eliminate the
redundancy because Roll_No is still repeated in all the relations.
2. Integrity can be enforced: Integrity of data means that data in
database is always accurate, such that incorrect information cannot be
stored in database. In order to maintain the integrity of data, some

integrity constraints are enforced on the database. A DBMS should


provide capabilities for defining and enforcing the constraints.
For Example: Let us consider the case of college database and
suppose that college is having only BTech, MTech, MSc and BCA
classes. But if a user enters the class BBA, then this incorrect
information must not be stored in database and must be prompted that
this is an invalid data entry. In order to enforce this, the integrity
constraint must be applied to the class attribute of the student entity.
In case of DBMS, this integrity constraint is applied only once on the
class field of the
General Office and all other applications will get the class information
about the student from the General Office table so the integrity
constraint is applied to the whole database.
3. Inconsistency can be avoided: When the same data is duplicated
and changes are made at one site, which is not propagated to the
other site, it gives rise to inconsistency and the two entries regarding
the same data will not agree. At such times the data is said to be
inconsistent. So, if the redundancy is removed chances of having
inconsistent data is also removed.
Let us again, consider the college system and suppose that in case of
General_Office file
it is indicated that Roll_Number 5 lives in Amritsar but in library file it is
indicated that
Roll_Number 5 lives in Jalandhar. Then, this is a state at which tIle two
entries of the same object do not agree with each other (that is one is

updated and other is not). At such time the database is said to be


inconsistent.
An

inconsistent database

is

capable of

supplying

incorrect

or

conflicting information. So there should be no inconsistency in


database. It can be clearly shown that inconsistency can be avoided in
centralized system very well as compared to file system.
Let us consider again, the example of college system and suppose that
RollNo 5 is .shifted from Amritsar to Jalandhar, then address
information of Roll Number 5 must be updated, whenever Roll number
and address occurs in the system. In case of file system, the
information must be updated separately in each application, but if we
make updation only at three places and forget to make updation at
fourth application, then the whole system show the inconsistent results
about Roll Number 5.
In case of DBMS, Roll number and address occurs together only single
time in General_Office table. So, it needs single updation and then an
other application retrieve the address information from General_Office
which is updated so, all application will get the current and latest
information by providing single update operation and this single
update operation is propagated to the whole database or all other
application automatically, this property is called as Propagation of
Update.
We can say the redundancy of data greatly affect the consistency of
data. If redundancy is less, it is easy to implement consistency of data.
Thus, DBMS system can avoid inconsistency to great extent.
4. Data

can

be

shared: The

data

about

Name,

Class,

and

Father_name etc. of General_Office is shared by multiple applications

in centralized DBMS as compared to file system so now applications


can be developed to operate against the same stored data. The
applications may be developed without having to create any new
stored files.
Po955. Standards can be enforced: Since DBMS is a central system,
so standard can be enforced easily may be at Company level,
Department

level,

National

level

or

International

level.

The

standardized data is very helpful during migration or interchanging of


data. The file system is an independent system so standard cannot be
easily enforced on multiple independent applications.
6. Restricting unauthorized access: When multiple users share a
database, it is likely that some users will not be authorized to access
all information in the database. For example, account office data is
often considered confidential, and hence only authorized persons are
allowed to access such data. In addition, some users may be permitted
only to retrieve data, whereas other are allowed both to retrieve and to
update. Hence, the type of access operation retrieval or update must
also be controlled. Typically, users or user groups are given account
numbers protected by passwords, which they can use to gain access to
the database. A DBMS should provide a security and authorization
subsystem, which the DBA uses to create accounts and to specify
account restrictions. The DBMS should then enforce these restrictions
automatically.
7. Solving

Enterprise

Requirement

than

Individual

Requirement: Since many types of users with varying level of


technical knowledge use a database, a DBMS should provide a variety
of user interface. The overall requirements of the enterprise are more
important than the individual user requirements. So, the DBA can

structure the database system to provide an overall service that is


"best for the enterprise".
For example: A representation can be chosen for the data in storage
that gives fast access for the most important application at the cost of
poor performance in some other application. But, the file system favors
the individual requirements than the enterprise requirements.
8. Providing Backup and Recovery: A DBMS must provide facilities
for recovering from hardware or software failures. The backup and
recovery subsystem of the DBMS is responsible for recovery. For
example, if the computer system fails in the middle of a complex
update program, the recovery subsystem is responsible for making
sure that the database is restored to the state it was in before the
program started executing.
9. Cost of developing and maintaining system is lower: It is
much easier to respond to unanticipated requests when data is
centralized in a database than when it is stored in a conventional file
system. Although the initial cost of setting up of a database can be
large, but the cost of developing and maintaining application programs
to be far lower than for similar service using conventional systems. The
productivity of programmers can be higher in using non-procedural
languages that have been developed with DBMS than using procedural
languages.
10. Data Model can be developed: The centralized system is able
to represent the complex data and interfile relationships, which results
better data modeling properties.
11. Concurrency Control: DBMS systems provide mechanisms to
provide concurrent access of data to multiple users.

Disadvantages of DBMS
The disadvantages of the database approach are summarized as
follows:
1. Complexity: The provision of the functionality that is expected of a
good DBMS makes the DBMS an extremely complex piece of software.
Database designers, developers, database administrators and endusers must understand this functionality to take full advantage of it.
Failure to understand the system can lead to bad design decisions,
which can have serious consequences for an organization.
2. Size: The complexity and breadth of functionality makes the DBMS
an extremely large piece of software, occupying many megabytes of
disk space and requiring substantial amounts of memory to run
efficiently.
3. Performance: Typically, a File Based system is written for a specific
application, such as invoicing. As result, performance is generally very
good. However, the DBMS is written to be more general, to cater for
many applications rather than just one. The effect is that some
applications may not run as fast as they used to.
4. Higher impact of a failure: The centralization of resources
increases the vulnerability of the system. Since all users and
applications rely on the availabi1ity of the DBMS, the failure of any
component can bring operations to a halt.
5. Cost of DBMS: The cost of DBMS varies significantly, depending on
the environment and functionality provided. There is also the recurrent
annual maintenance cost.

6. Additional Hardware costs: The disk storage requirements for


the DBMS and the database may necessitate the purchase of
additional storage space. Furthermore, to achieve the required
performance it may be necessary to purchase a larger machine,
perhaps even a machine dedicated to run the DBMS. The procurement
of additional hardware results in further expenditure.
7. Cost of Conversion: In some situations, the cost of DBMS and
extra hardware may be insignificant compared with the cost of
converting existing applications to run on the new DBMS and hardware.
This cost also includes the cost of training staff to use these new
systems and possibly the employment of specialist staff to help with
conversion and running of the system. This cost is one of the main
reasons why some organizations feel tied to their current systems and
cannot switch to modern database technology.
Database System Structure:
A database System is divided into modules based on their function.
The functional components of a database system can be broadly
divided

into

the

storage

manager

and

the

query

processor

components.
Storage Manager
Query Processor
Storage Manager
The storage manager is important because database typically require a
large amount of storage space. So it is very important efficient use of
storage, and to minimize the movement of data to and from disk.
A storage manager is a program module that provides the interface
between the low-level data stored in the database and the application
programs and the queries submitted to the system. The Storage
manager is responsible for the interaction with the file manager. The

Storage manager translates the various DML statements into low level
file system commands. Thus the storage manager is responsible for
storing, retrieving, and updating data in the database. The storage
manager components include the following.
Authorization and Integrity Manager
Transaction Manger
File Manager
Buffer Manger
Authorization and Integrity Manger tests for the satisfaction of integrity
constraints and checks the authority of users to access data.
Transaction manager ensures that the database remains in a
consistent state and allowing concurrent transactions to proceed
without conflicting. The file manager manages the allocation of space
on disk storage and the data structures used to represent information
stored on disk. The Buffer manager is responsible for fetching the data
from disk storage into main memory and deciding what data to cache
in main memory.
The storage manager implements the following data structures as part
of the physical system implementation. Data File, Data Dictionary,
Indices. Data files stores the database itself. The Data dictionary stores
metadata about the structure of database, in particular the schema of
the database. Indices provide fast access to data items.
The Query Processor
The Query Processor simplifies and facilitates access to data. The
Query processor includes the following component.
DDL Interpreter
DML Compiler
Query Evaluation Engine
The DDL interpreter interprets DDL statements and records the
definition in the data dictionary. The DML compiler translates DML

statements in a query language into an evaluation plan consisting of


low-level instructions that the query evaluation engine understands.
The DML compiler also performs query optimization that is it picks the
lowest cost evaluation plan from among the alternatives. Query
evaluation engine executes low level instructions generated by the
DML compiler.
RELATIONAL ALGEBRA:
Relational database systems are expected to be equipped with a
query language that can assist its users to query the database
instances. There are two kinds of query languages relational
algebra and relational calculus.

Relational Algebra
Relational algebra is a procedural query language, which takes
instances of relations as input and yields instances of relations as
output. It uses operators to perform queries. An operator can be
either unary or binary. They accept relations as their input and yield
relations as their output. Relational algebra is performed recursively
on a relation and intermediate results are also considered relations.
The fundamental operations of relational algebra are as follows

Select

Project

Union

Set different

Cartesian product

Rename

We will discuss all these operations in the following sections.

Select Operation ()
It selects tuples that satisfy the given predicate from a relation.
Notation p(r)
Where stands for selection predicate and r stands for relation. p is
prepositional logic formula which may use connectors like and,
or, and not. These terms may use relational operators like
=, , , < , >, .
For example
subject = "database"(Books)

Output Selects tuples from books where subject is 'database'.


subject = "database" and price = "450"(Books)

Output Selects tuples from books where subject is 'database' and


'price' is 450.
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.

Project Operation ()
It projects column(s) that satisfy a given predicate.
Notation A1, A2, An (r)
Where A1, A2 , An are attribute names of relation r.
Duplicate rows are automatically eliminated, as relation is a set.
For example

subject, author (Books)

Selects and projects columns named as subject and author from the
relation Books.

Union Operation ()
It performs binary union between two given relations and is defined
as
r s = { t | t r or t s}

Notion r U s
Where r and s are either database relations or relation result set
(temporary relation).
For a union operation to be valid, the following conditions must hold

r, and s must have the same number of attributes.

Attribute domains must be compatible.

Duplicate tuples are automatically eliminated.

author

(Books)

author

(Articles)

Output Projects the names of the authors who have either written
a book or an article or both.

Set Difference ()
The result of set difference operation is tuples, which are present in
one relation but are not in the second relation.
Notation r s
Finds all the tuples that are present in r but not in s.

author

(Books)

author

(Articles)

Output Provides the name of authors who have written books but
not articles.

Cartesian Product ()
Combines information of two different relations into one.
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.

Rename Operation ()
The results of relational algebra are also relations but without any
name. The rename operation allows us to rename the output relation.
'rename' operation is denoted with small Greek letter rho .
Notation

(E)

Where the result of expression E is saved with name of x.


Additional operations are

Set intersection

Assignment

Natural join

Relational Calculus

In contrast to Relational Algebra, Relational Calculus is a nonprocedural query language, that is, it tells what to do but never
explains how to do it.
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.
For example
{ T.name | Author(T) AND T.article = 'database' }

Output Returns tuples with 'name' from Author who has written
article on 'database'.
TRC can be quantified. We can use Existential () and Universal
Quantifiers ().
For example
{ R| T Authors(T.article='database' AND R.name=T.name)}

Output The above query will yield the same result as the previous
one.

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).
Notation
{ a1, a2, a3, ..., an | P (a1, a2, a3, ... ,an)}

Where a1, a2 are attributes and P stands for formulae built by inner
attributes.
For example
{< article, page, subject > | TutorialsPoint subject = 'database'}

Output Yields Article, Page, and Subject from the relation


TutorialsPoint, where subject is database.
Just like TRC, DRC can also be written using existential and universal
quantifiers. DRC also involves relational operators.
The expression power of Tuple Relation Calculus and Domain Relation
Calculus is equivalent to Relational Algebra.
Storage management
The term storage management encompasses the technologies and
processes the organizations use to maximize or improve the
performance of their data storage resources. It is a broad category
that includes virtualization, replication, mirroring, security,
compression, traffic analysis, process automation, storage
provisioning and related techniques.
By some estimates, the amount of digital information stored in the
world's computer systems is doubling every year. As a result,
organizations feel constant pressure to expand their storage
capacity. However, doubling a company's storage capacity every year
is an expensive proposition. In order to reduce some of those costs
and improve the capabilities and security of their storage solutions,
organizations turn to a variety of storage management solutions.

Functions of Database Management System (DBMS):


Here we discus the different Functions of Database Management
System(DBMS). DBMS performs several important functions that

guarantee the integrity and consistency of the data in the database.


The most important functions of Database Management System are
Data Dictionary Management, Data Storage Management, Data
Transformation and Presentation, Security Management, Multi user
Access Control, Backup and Recovery Management, Data Integrity
Management, Database Access Languages and Application
Programming Interfaces and Database Communication interfaces. Each
of these functions is explained below.
1. Data Dictionary Management

One of the most important Function of The Database Management


System is Data Dictionary Management.
DBMS stores definitions of the data elements and their relationships
(metadata) in a data dictionary. So, all programs that access the data
in the database work through the DBMS. The DBMS uses the data
dictionary to look up the required data component structures and
relationships which relieves you from coding such complex
relationships in each program. Additionally, any changes made in a
database structure are automatically recorded in the data dictionary,
thereby freeing you from having to modify all of the programs that
access the changed structure.
In other words, the DBMS provides data abstraction, and it removes
structural and data dependence from the system.

2. Data Storage Management

The DBMS creates and manages the complex structures required for
data storage, thus relieving you from the difficult task of defining and
programming the physical data characteristics.
A modern DBMS provides storage not only for the data, but also for
related data entry forms or screen definitions, report definitions, data

validation rules, procedural code, structures to handle video and


picture formats, and so on. Data storage management is also
important for database performance tuning. Performance tuning
relates to the activities that make the database perform more
efficiently in terms of storage and access speed. So, the data storage
management is another important function of Database Management
System.

3. Data transformation and presentation


The DBMS transforms entered data to conform to required data
structures. The DBMS relieves you of the chore of making a distinction
between the logical data format and the physical data format. That is,
the DBMS formats the physically retrieved data to make it conform to
the users logical expectations.
For example, imagine an enterprise database used by a multinational
company. An end user in England would expect to enter data such as
July 11, 2009, as 11/07/2009. In contrast, the same date would be
entered in the United States as 07/11/2009. Regardless of the data
presentation format, the DBMS must manage the date in the proper
format for each country.
4. Security Management

Security Management is another important function of the Database


Management System. The DBMS creates a security system that
enforces user security and data privacy. Security rules determine
which users can access the database, which data items each user can
access, and which data operations (read, add, delete, or modify) the
user can perform. This is especially important in multiuser database
systems.

5. Multi User Access Control

To provide data integrity and data consistency, the DBMS uses


sophisticated algorithms to ensure that multiple users can access the
database concurrently without compromising the integrity of the
database.

6. Backup and Recovery Management

The DBMS provides backup and data recovery to ensure data safety
and integrity. Current DBMS systems provide special utilities that allow
the DBA to perform routine and special backup and restore
procedures. Recovery management deals with the recovery of the
database after a failure, such as a bad sector in the disk or a power
failure. Such capability is critical to preserving the databases integrity.

7. Data Integrity Management

The DBMS promotes and enforces integrity rules, thus minimizing data
redundancy and maximizing data consistency. The data relationships
stored in the data dictionary are used to enforce data integrity.
Ensuring data integrity is especially important in transaction-oriented
database systems.

8. Database Access Languages and Application Programming


Interfaces

The DBMS provides data access through a query language. A query


language is a non procedural languageone that lets the user specify
what must be done without having to specify how it is to be done.
Structured Query Language (SQL) is the defacto query language and
data access standard supported by the majority of DBMS vendors.

9. Database Communication Interfaces

Current-generation DBMS's accept end-user requests via multiple,


different network environments. For example, the DBMS might provide
access to the database via the Internet through the use of Web
browsers such as Mozilla Firefox or Microsoft Internet Explorer. In this
environment, communications can be accomplished in several ways:

- End users can generate answers to queries by filling in screen forms


through their preferred Web browser.
- The DBMS can automatically publish predefined reports on a Website.
- The DBMS can connect to third-party systems to distribute
information via e-mail or other productivity applications.
RELATIONAL DATA MODELS:
A relational database is a collection of data items organized as a set
of formally-described tables from which data can be accessed or
reassembled in many different ways without having to reorganize
the database tables.

SQL VIEW:
A view is nothing more than a SQL statement that is stored in the
database with an associated name. A view is actually a composition of
a table in the form of a predefined SQL query.
A view can contain all rows of a table or select rows from a table. A
view can be created from one or many tables which depends on the
written SQL query to create a view.
Views, which are kind of virtual tables, allow users to do the
following:

Structure data in a way that users or classes of users find natural or intuitive.

Restrict access to the data such that a user can see and (sometimes) modify
exactly what they need and no more.

Summarize data from various tables which can be used to generate reports.

Integrity constraints:

Integrity constraints are used to ensure accuracy and


consistency of data in a relational database. Data integrity is
handled in a relational database through the concept of
referential integrity.

There are many types of integrity constraints that play a role in


referential integrity (RI). These constraints include Primary Key,
Foreign Key, Unique Constraints and other constraints
mentioned above.

REFER PDF ALSO.

FUNCTIONAL DEPENDENCY:
Functional dependency is a relationship that exists when one attribute
uniquely determines another attribute.

If R is a relation with attributes X and Y, a functional dependency


between the attributes is represented as X->Y, which specifies Y is
functionally dependent on X. Here X is a determinant set and Y is a
dependent attribute. Each value of X is associated precisely with one Y
value.
Functional dependency in a database serves as a constraint between two
sets of attributes. Defining functional dependency is an important part of
relational database design and contributes to aspect normalization.

Employee Department Model


A classic example of functional dependency is the employee, department model. The following table

Employee ID

Employee Name

Department ID

Department Name

0001

John Doe

Human Resources

0002

Jane Doe

Marketing

0003

John Smith

Human Resources

0004

Jane Goodall

Sales

This case represents an example where multiple functional dependencies are embedded in a single
representation of data. Note that because an employee can only be a member of one department, the
unique ID of that employee determines the department.

Employee ID Employee Name

Employee ID Department ID

In addition to this relationship, the table also has a functional dependency through a non-key attribute

Department ID Department Name

This example demonstrates that even though there exists a FD Employee ID Department ID - the
employee ID would not be a logical key for determination of the department ID. The process of
normalization of the data would recognize all FD's and allow the designer to construct tables and
relationships that are more logical based on the data.

CHARACTERISTICS OF SQL:

SQL (Structured Query Language) is a standard interactive and


programming language for getting information from and updating
a database.
Although SQL is both an ANSI and an ISO standard, many database
products support SQL with proprietary extensions to the standard
language.
Queries take the form of a command language that lets you select,
insert, update, find out the location of data, and so forth. There is
also a programming interface.
Advantages of SQL:

High Speed:
SQL Queries can be used to retrieve
records from a database quickly and efficiently.

large

amounts

of

Well Defined Standards Exist:


SQL
databases
use
long-established
which
is
being
adopted
by
ANSI
&
ISO.
databases
do
not
adhere
to
any
clear

standard,
Non-SQL
standard.

No Coding Required:
Using
standard
systems without

SQL
it
having to

is
easier
to
manage
database
write substantial amount of code.

Emergence of ORDBMS:
Previously
relational
Oriented
extended

SQL
databases
database.
With
DBMS,
object
to

were
synonymous
with
the
emergence
of
Object
storage
capabilities
are
relational
databases.

CONSTRAINTS:
Constraints are the rules enforced on data columns on table. These
are used to limit the type of data that can go into a table. This
ensures the accuracy and reliability of the data in the database.
Constraints could be column level or table level. Column level
constraints are applied only to one column, whereas table level
constraints are applied to the whole table.
Following are commonly used constraints available in SQL. These
constraints have already been discussed in SQL - RDBMS
Concepts chapter but its worth to revise them at this point.

NOT NULL Constraint: Ensures that a column cannot have NULL value.

DEFAULT Constraint: Provides a default value for a column when none is


specified.

UNIQUE Constraint: Ensures that all values in a column are different.

PRIMARY Key: Uniquely identified each rows/records in a database table.

FOREIGN Key: Uniquely identified a rows/records in any another database table.

CHECK Constraint: The CHECK constraint ensures that all values in a column
satisfy certain conditions.

INDEX: Use to create and retrieve data from the database very quickly.

Constraints can be specified when a table is created with the CREATE


TABLE statement or you can use ALTER TABLE statement to create
constraints even after the table is created.

Example:

CREATE TABLE Orders


(
O_Id int NOT NULL,
OrderNo int NOT NULL,
P_Id int,
PRIMARY KEY (O_Id),
FOREIGN KEY (P_Id) REFERENCES Persons(P_Id)
)
REASONS TO USE FOREIGN KEYS:

you won't get Orphaned Rows.

you can get nice "on delete cascade" behavior, automatically cleaning up tables

knowing about the relationships between tables in the database helps the Optimizer plan
your queries for most efficient execution, since
it is able to get better estimates on join cardinality. FKs give a
pretty big hint on what statistics are most important to collect on
the database, which in turn leads to better performance

they enable all kinds of auto-generated support -- ORMs can generate themselves,
visualization tools will be able to create nice schema
layouts for you, etc

someone new to the project will get into the flow of things faster since otherwise implicit
relationships are explicitly documented

OBJECT ORIENTATION:
EXAMPLE:
For example, object-oriented programming (OOP) refers to a special
type of programming that combines data structures withfunctions to
create re-usable objects. Object-oriented graphics is the same
as vector graphics.
NESTED RELATIONS:

Object relational data models extends the relational data model by providing a
richer

type

system

including

complex

data

types

and

object orientation.
The nested Relational model is an extension of the relational model in which
domains may be either atomic or relation valued. Thus the value of a tuple
within relations. A complex object thus can be represented by a single tuple of
a nested relation.
Example: For

nested

relation:

Suppose we store the following information for each book.


1. Book title
2. Set of authors
3. Publisher
4. Set of keywords

If we defined a relation for the proceeding information, several domains will be


non
atomic.
Author: A book may have set of authors so we have to use subpart of Domain
element set of authors.
Keywords: If we store a set of keywords for a book, we expect to be
able to retrieve all books whose keywords include one or more
Keywords. So the domain of the set of keywords as non atomic.
Publisher: Publisher does not have a set valued domain. We may
view published as consisting of the subfields name and branch. This
view
makes
the
domain
of
publisher
non

atomic.
NON
1

NF
books
relation,
books.
Books a, 1- NF version of non INF relation books.
Books a relation is disappeared if we assume that the following
Multivalued dependencies.

1. Title author
2. Title keyword
3. Title pub-name, pub-branch
Thus, we can decompose the relation into 4 NF using the schemas.
1. Authors (title, author)
2. Keywords (title, keyword)
3. Books 4 (title, pub-name, pub-branch)
Book database can be adequately expressed without using nested relations, the
use of nested relation leads to an easier to understand model. The 4 NF design
would require user to include joins in their queries, thereby complicating
interaction with the system.
Non nested relation (e.g. Books a relation) eliminates the need for users to
write joins in their query. But it will loose one-to-one correspondence between
tuples and books.

PARALLEL DATA BASE:


A parallel database system seeks to improve performance through parallelization of various
operations, such as loading data, building indexes and evaluating queries. [1]Although data may be
stored in a distributed fashion, the distribution is governed solely by performance considerations.
Parallel databases improve processing and input/outputspeeds by using multiple CPUs and disks in
parallel. Centralized and clientserver database systems are not powerful enough to handle such
applications. In parallel processing, many operations are performed simultaneously, as opposed to
serial processing, in which the computational steps are performed sequentially. Parallel databases can
be roughly divided into two groups, the first group of architecture is the multiprocessor architecture, the
alternatives of which are the followings:
Shared memory architecture
Where multiple processors share the main memory space.
Shared disk architecture

Where each node has its own main memory, but all nodes share mass storage, usually
a storage area network. In practice, each node usually also has multiple processors.
Shared nothing architecture
Where each node has its own mass storage as well as main memory.
The other architecture group is called hybrid architecture, which includes:

Non-Uniform Memory Architecture (NUMA), which involves the non-uniform memory access.

Cluster (shared nothing + shared disk: SAN/NAS), which is formed by a group of connected
computers

Refer pdf also


CONCURRENCY CONTROL:
Definition
Concurrency control is a database management systems (DBMS) concept that is used to address
conflicts with the simultaneous accessing or altering of data that can occur with a multi-user system.
concurrency control, when applied to a DBMS, is meant to coordinate simultaneous transactions while
preserving data integrity. [1] The Concurrency is about to control the multi-user access of Database

You might also like