Sei sulla pagina 1di 14

Basic Database Terms

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 be stored 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

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 employees 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.

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).
Primary Key

PURCHASE

Purchase_ID

Purchase_DATE

ITEM_CODE

Foreign Key

ITEM

ITEM_CODE

ITEM_COST

ITEM_QUANTITY

Primary Key

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.

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.

Name Code Address


Goods Bought

Code

Price

CUSTOMER

GOODS

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

Transaction Manager

User request

Request for specific record

Request for specific block

Input/Output

DBMS User Interface

Data Manager

File Manager

Disk Manager

Physical Database

Recovery Manager

DBMS Components

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 technological innovations. Identifying and resolving users problems. Communicating regularly with internal technical applications and operational staff to ensure the database integrity and security.

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.

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

First Normal Form (1NF)


STUDENTS TableSTUDENT_ID STUDENT_NAME SUBJECT_1 SUBJECT_2

STUDENTS Table-

STUDENT_ID
SUBJECTS TableSTUDENT_ID

STUDENT_NAME

SUBJECT_NAME

GRADE

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.

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.

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.
Projects Table Projects Table
PROJECT_ID MANAGER P1 P2 P3 P4 Vivek Vikas Vivek Vivek ADDRESS Gamma Delta Gamma Gamma PROJECT_ID P1 P2 P3 MANAGER Vivek Vikas Vivek

P4

Vivek

MANAGERS Table
MANAGER Vivek ADDRESS Gamma

Vikas

Delta