Professional Documents
Culture Documents
Database:-
A base where we can store data?
Database is an Organized Collection of Related Data stored in Compact
Manner for Efficient Retrieval.
1. Organized Collection (Arranged & Adjusted Data)
2. Related Data (Of a specific Organization/Field Specific)
3. Compact Manner (Lesser Storage Space)
4. Efficient Access/Retrieval (Quick & Fast Access)
Database Approaches:-
1. File Based Approach (Excel File?)
Each department of the organization has its own data
file separate from other department e.g. IT, Business,
Exam, Account, and Library. (Classic Approach)
2. Centralized Database Approach
Data is stored at a central place and accessible for all
department.
Which one is better approach?
Benefit of Centralized vs. Problem of File Based
Easy to Share & Use data Difficult to Share & Use data
Time Saving Time Wastage
Cost Effective More Costly
No Duplication More Redundant
Easy to Maintain Data Data Maintenance Problem
Data Accuracy Chances of Inaccurate Data
Data Security Insecure Data
Data/Result Consistency Data/Result Inconsistency
Fast Access Slower access to data
1-M: (Rule: PK of One table should become FK of Many Table, Not Vice versa
otherwise data duplication problem will rise)
1. Full backup
2. Incremental backup
1. Online
2. Offline
Full backup
A full database backup is used to create a copy of all data of entire database. It requires a large
amount of storage space. However, a database can restore relatively quickly using a full back up as it
requires to simply copying the backup files.
Incremental backup
An incremental backup creates a copy of only the data that have changed since the last backup.
Since an incremental backup only contains changes made to the database, the user must perform a full
back up before the incremental database to restore the database at a later time. Incremental backup
requires small amount of storage space. However, it may take more time to restore a database.
Offline backup
An offline backup is a backup that is performed after a database has been shut down. The
database administrator must schedule a time to shut down the database and notify all users so they can
disconnect for the database.
Offline backup can be inconvenient for users as they must remember to complete all active
transactions and disconnect from the database before shutting down. Offline backup is performed by
using the commands of operating system. DBMS does not provide this facility as offline back is
performed when DBMS has been shut down.
Online backup
An online backup is a backup that can be performed while the database is running. The database
administrator does not have to shut down the database. The users do not need to disconnect. Online
backup are more convenient foe users as they perform no action.
Online backup is performed by using the commands of DBMS. DBMS should provide the facility
for online backup as DBMS is running when online backup is performed.
Relationship:-
1. Book Table vs. Staff Table (M - M => Issue)
2. Staff Table vs. Student Table (M – M => Issue)
3. Book Table vs. Student Table (M – M => Issue)
Practical Task: (Use Video 2 for Assistance)
You have to create a database with a name of dbLibrary in SQL
Server. Database will contain 4 tables having 4 Primary Keys
(one in each). Issuance table apart from its PK will also have 3
foreign keys as well.
You also need to add 3 student’s records, 3 book records, 3
staff members’ records and 5 issuance record in their
respective table.
ER – Diagram
(Entity (tables) Relationship Diagram)
Subject (M) (1-M)Assign Subject (1-M) Teacher (M)