Professional Documents
Culture Documents
Database Fundamentals
Database Fundamentals
Database
Define Database
SLO # 7.1.1
What is Database?
Database refers to a collection of electronic records that could
be processed to produce useful information. The data can be
accessed, modified, managed, controlled and organized to
perform various data-processing operations.
SLO # 7.1.3
Role and Responsibilities of Database
Administrator
✔ Actively participates in planning the installation of new organization-wide
systems and applications. He also assists during the installation as per specific
functions.
✔ Implements the work plan for the Department. He meets the staff to identify
any problems, take measures, and resolves it.
✔ Monitors the efficiency and effectiveness of all database resources and thus,
keep the flow of work uninterrupted.
A hierarchical database
model is a data model in
which the data are
organized into a tree-like
structure. The data are
stored as records which are
connected to one another
through links. A record is a
collection of fields, with
each field containing only
one value.
Network Database
Model
A network database
model is a database
model that allows multiple
records to be linked to the
same owner file.
The model can be seen as
an upside down tree where
the branches are the
member information linked
to the owner, which is the
bottom of the tree.
Relational Database
Model
The relational database was
invented in 1970 by E. F.
Codd, then a young
programmer at IBM. In his
paper, "A Relational Model of
Data for Large Shared Data
Banks," Codd proposed
shifting from storing data in
hierarchical or navigational
structures to organizing data in
tables containing rows and
columns.
Object Oriented
Database Model
An object-oriented database is
a database that subscribes to a
model with information
represented by objects.
Object-oriented databases are
a niche offering in the
relational database
management system (RDBMS)
field and are not as successful
or well-known as mainstream
database engines.
An Object relational model is a
combination of a Object oriented
Object database model and a Relational
Relational database model. So, it
supports objects, classes,
Database inheritance etc. just like Object
Oriented models and has support
Model for data types, tabular structures
etc. like Relational data model.
Define structured query
language
(SQL)
SLO # 7.1.5
SQL stands for Structured Query
Language
SQL lets you access and manipulate
Structured databases
Query SQL became a standard of the
American National Standards
Language (SQL) Institute (ANSI) in 1986, and of the
International Organization for
Standardization (ISO) in 1987
✔ SQL can execute queries against a database
✔ SQL can retrieve data from a database
✔ SQL can insert records in a database
✔ SQL can update records in a database
What can SQL ✔ SQL can delete records from a database
✔ SQL can create new databases
do? ✔ SQL can create new tables in a database
✔ SQL can create stored procedures in a
database
✔ SQL can create views in a database
✔ SQL can set permissions on tables,
procedures, and views
Differentiate among the types of
SQL languages, i.e. data definition
language (DDL), data manipulation
language (DML) and data control
language (DCL)
SLO # 7.1.6
SQL statements are categorized into four
Types of SQL different type of statements, which are
Statements ✔ DML (DATA MANIPULATION LANGUAGE)
✔ DDL (DATA DEFINITION LANGUAGE)
✔ DCL (DATA CONTROL LANGUAGE)
✔ TCL (TRANSACTION CONTROL LANGUAGE)
Types of SQL
Statements
The SQL commands that deals with the
manipulation of data present in database belong to
DML or Data Manipulation Language and this
includes most of the SQL statements.
SELECT
Select statement is used to select the collection of records
Data from the table, which is based on some condition.
INSERT
Manipulation Insert statement is used to insert the set of values into
the table.
Language UPDATE
Update statement is used to update the existing values in
the table, which is based on some condition.
DELETE
Delete statement is used to delete the existing record in
the table, which is based on some condition.
DDL or Data Definition Language actually
consists of the SQL commands that can be
used to define the database schema. It simply
deals with descriptions of the database
schema and is used to create and modify the
structure of database objects in database.
Data CREATE
is used to create the database or its objects (like
table, index, function, views, store procedure and
Definition triggers).
Language ALTER
is used to alter the structure of the database.
DROP
is used to delete objects from the database.
DCL includes commands such as GRANT and
REVOKE which mainly deals with the rights,
permissions and other controls of the
database system.
Data GRANT
gives user’s access privileges to database.
Control
Language REVOKE
withdraw user’s access privileges given by using the
GRANT command.
Basic Database
Terminologies
Define the following terms related to relational
database:
SLO # 7.2.1
Database Terminologies
The terms field and attribute have similar Figure 1.1. A column (highlighted).
meanings.
Database Terminologies
Row (record, tuple)
View
A view is an alternative way to present a table (or tables). You might think of a view as a
"virtual" table. A view is (usually) defined in terms of one or more tables. When you
create a view, you are not storing more data, you are instead creating a different way of
looking at existing data. A view is a useful way to give a name to a complex query that you
may have to use repeatedly.
Database Terminologies
Data type
Data types define what type of data a column can contain.
Key
A DBMS key is an attribute or set of an attribute which helps you to identify a row(tuple)
in a relation(table). They allow you to find the relation between two tables. Keys help you
uniquely identify a row in a table by a combination of one or more columns in that table.
Define the data types available in a
relational database; i.e. character,
integer, real number, Boolean data,
date and time;
SLO # 7.2.2
Data types in relational database
Character
Character data types to deal with printable and displayable characters. Char holds a
single character whereas String contains an indefinite number of characters.
Integer
Integer data types hold numbers that are whole, or without a decimal point.
Example
234 45678 1 67
Data types in relational database
Real number
These data types have a precision, or a positive integer that defines the number of
significant digits. This type of data representation is commonly called floating-point
representation.
Example
2.2 34.56 1.1
Boolean data
The Boolean data type is a data type that has one of two possible values (usually
denoted true and false).
Data types in relational database
Date and time
The DATETIME type is used for values that contain both date and time parts.
Differentiate among primary key,
candidate key, alternate key,
secondary key, foreign key;
SLO # 7.2.3
Keys in relational database
What is a Primary Key?
A column or group of columns in a table which helps us to uniquely identifies every
row in that table is called a primary key. This DBMS can't be a duplicate. The same
value can't appear more than once in the table.
SLO # 7.3.1
Planning a Database
The first step in the problem solving and decision making process is to identify and
define the problem.
A problem can be regarded as a difference between the actual situation and the
desired situation. This means that in order to identify a problem the team must
know where it is meant to be and have a clear understanding of where it currently
is in relation to the perceived problem.
Planning a Database
Feasibility study
It involves interviews with user groups and other stakeholders to identify what
functionality they require from the database, what kinds of data they wish to
process and the most frequently performed operations.
Entities
An Entity may be an object with a physical existence – a particular person, car,
house, or employee – or it may be an object with a conceptual existence – a
company, a job, or a university course.
Attributes
Attributes are the properties which define the entity type. For example, Roll_No,
Name, DOB, Age, Address, Mobile_No are the attributes which defines entity type
Student.
Data Modeling
Explain the process of data modeling
SLO # 7.4.1
What is Data Modelling?
Data modeling is the process of creating a data model for the data to be
stored in a Database. This data model is a conceptual representation of
:
• Data objects
• The associations between different data objects
• The rules
SLO # 7.4.2
What is ER Diagrams?
• Entities
• Attributes
• Relationships
Example
For example, in a University database, we might have entities for Students, Courses,
and Lecturers. Students entity can have attributes like Rollno, Name, and DeptID.
They might have relationships with Courses and Lecturers.
What is Entity?
An entity can be place, person, object, event or a concept, which stores
data in the database. The characteristics of entities are must have an
attribute, and a unique key. Every entity is made up of some 'attributes'
which represent that entity.
An attribute is represented by an
Ellipse.
What are Relationship?
Relationship is nothing but an association among two or more entities. E.g.,
Tom works in the Chemistry department.
SLO # 7.4.3
One to One
One entity from entity set X can be associated with at most one entity of
entity set Y and vice versa.
Example: One student can register for numerous courses. However, all those
courses have a single line back to that one student.
One to Many
One entity from entity set X can be associated with multiple entities of entity
set Y, but an entity from entity set Y can be associated with at least one
entity.
SLO # 7.4.4
What are Cardinality?
SLO # 7.4.5
Describe the normalization of relational
database;
SLO # 7.4.6
What is Normalization?