Documenti di Didattica
Documenti di Professioni
Documenti di Cultura
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.
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
Input/Output
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
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.
P4
Vivek
MANAGERS Table
MANAGER Vivek ADDRESS Gamma
Vikas
Delta