Download - Basic Database Terms
-
8/13/2019 Basic Database Terms
1/14
Basic Database Terms
-
8/13/2019 Basic Database Terms
2/14
• FIELD/COLUMN: represents one related part of a table
and is the smallest logical structure of storage in the
database.
• RECORD/ROW: collection of multiple related fields that
can be treated as a unit.
• TABLE: collection of logically related multiple records.
• DATA TYPE: determines the type of data that can bestored in a column.
• KEY: column value in a table that is used to either
uniquely identify a row of data in a table, or establish a
relationship with another table.
– Primary Key
– Foreign Key
– Candidate Key
-
8/13/2019 Basic Database Terms
3/14
Primary Key
• Denotes a key that is chosen by the database designer
as the principal means of identifying unique records
within a table.
• For example, the employee’s code field can be
designated as the primary key because all employee
codes are unique and the value once entered is never
changed until the person is in the organization.
-
8/13/2019 Basic Database Terms
4/14
Foreign Key
• It is the combination of one or more columns in a table(parent table) that references a primary key in another
table (child table).
Purchase_ID Purchase_DATE ITEM_CODE
ITEM_CODE ITEM_COST ITEM_QUANTITY
Foreign Key
Primary Key
Primary Key
ITEM
PURCHASE
-
8/13/2019 Basic Database Terms
5/14
Candidate Key
• A combination of one or more fields whose value
uniquely identifies a record in a table, i.e., no two records
in a table can have the same key value.
• Every key field is a candidate key but there cannot be
more than one primary key in a table.
-
8/13/2019 Basic Database Terms
6/14
Logical Data Concepts
• Entity: an object that has its existence in the real world.• Attribute: units that describe the characteristics or
properties of entities.
• Relationship: an association, dependency or link
between two or more entities.
CUSTOMER GOODSGoods
Bough
t
Code
Name
Address Code Price
-
8/13/2019 Basic Database Terms
7/14
Components of a DBMS
• Users: – Application Programmers
– End Users
– DBA
• Software: – DBMS
– Operating System
– Network Software (if necessary)
– Application Programs
• Hardware: – Storage and input & output devices
• Data
-
8/13/2019 Basic Database Terms
8/14
PhysicalDatabase
Transaction Manager
Recovery Manager
DBMSUser
Interface
DataManager
FileManager
DiskManager
User requestRequest for
specific record
Request for
specific blockInput/Output
DBMS Components
-
8/13/2019 Basic Database Terms
9/14
Database Administrator
• Custodian of database accuracy, efficiency, maintenance,
and development.
• Responsibilities:
– Granting different types of authorization to regulate which parts of
the database various users can access.
– Ensuring regular backups of a database and in case of failure,suitable recovery procedures are used to restore the database
services with as little down time as possible.
– Ensuring regular and accurate update of database.
– Collaborating in the design and development of databases to
meet new user needs and respond to anticipate technologicalinnovations.
– Identifying and resolving user’s problems.
– Communicating regularly with internal technical applications and
operational staff to ensure the database integrity and security.
-
8/13/2019 Basic Database Terms
10/14
Database Languages
• Data Definition Language (DDL): used to create
database and its objects. Used by the DBA during the
building and removal phases of a database project.
• Data Manipulation Language (DML): used to retrieve,
insert, modify and delete database information. Used by
all database users during the routine operation of the
database.
-
8/13/2019 Basic Database Terms
11/14
Normalisation
• It is the process of reducing data redundancy in a
relational database.
• Fundamental Principle: the same data should not be
stored in multiple places.
• Types of Normalisation:
– 1NF
– 2NF
– 3NF
-
8/13/2019 Basic Database Terms
12/14
First Normal Form (1NF)
STUDENTS Table-
STUDENT_ID STUDENT_NAME SUBJECT_1 SUBJECT_2
STUDENTS Table-
SUBJECTS Table-
STUDENT_ID STUDENT_NAME
GRADESTUDENT_ID SUBJECT_NAME
So, A table is in 1st Normal Form if it contains no repeating
groups, i.e., no two fields stores the same kind of information in
a single table.
-
8/13/2019 Basic Database Terms
13/14
Second Normal Form (2NF)
• Depends on the concepts of the primary key and
functional dependency.
• A database is said to be in 2NF if it is in 1NF and every
attribute is fully functionally dependent on the primary
key.
• Thus, the relation is in 1NF with no repeating groups,
and all non-key attributes must depend on the whole
key, not just some part of it.
-
8/13/2019 Basic Database Terms
14/14
Third Normal Form (3NF)
• A table is said to be in 3NF if all the non-key fields are
independent, i.e., no two non-key fields of the table
depend on each other.
• 3NF seeks to eliminate all attributes from a table that are
not directly dependent upon the primary key.
PROJECT_ID MANAGER ADDRESS
P1 Vivek Gamma
P2 Vikas Delta
P3 Vivek Gamma
P4 Vivek Gamma
Projects Table PROJECT_ID MANAGER
P1 Vivek
P2 Vikas
P3 Vivek
P4 Vivek
Projects Table
MANAGER ADDRESS
Vivek Gamma
Vikas Delta
MANAGERS Table