Database (Lecture)
Database (Lecture)
DataBase Lecture
Data and Information
• Data: Data is refers to the facts and figures in raw form. i.e not in
organized form.
For example item code, quantity and price of items purchased in a store
are data. When this data is entered into the computer and processed, it
prints the bill which is the output of the computer, also called the
information.
• Information: information is the processed or organized form of data.
Meaningful data is information.
File System Approach
File based systems were an early attempt to computerize the manual system. It is also
called a traditional based approach in which a decentralized approach was taken
where each department stored and controlled its own data with the help of a data
processing specialist.
Traditional File Processing
-Data stored in independent files
Problems:
• Data redundancy • Data inconsistency • Lack of data integrity • or standardization.
Database approach
A database approach is a well-organized collection of data that are
related in a meaningful way which can be accessed by different users
but stored only once in a system.
Oracle, SQL Server, Sybase etc.
Problems in File Management System
• In File Management System, records in one file system are not related
to the records in any other file. This approach leads to many problems,
which include data duplication in different files, data inconsistency, non-
sharing of data and lack of flexibility in organizing and querying the
data.
Example: A company may store a salesman’s name ,address telephone
number and commission rate in a file in Accounts Department and the
same information may be stored in another file in sales department . The
Account’s department for example may change the commission rate of
salesman but the sales department may fail to update its file. This will
produce reports calculated with out of data figures(Wrong data). The
inconsistency in files occurred due to duplication of same data in files.
This is the main problem faced in file Management systems.
Solution of the problem occur in File
Management:
• To solve the problem occur in traditional file the concept of a
Database was introduced.
Data base approach to Manage Files
• A database is a collection of related files.
• A database Management System is a set of programs that allow users
to create, maintain and manipulate and store database .
Functions of DBMS
– Retrieving Data, Editing. Adding, deleting
– Storing, Distributing Data and Organizing Data
DBMS
26
Maintaining Database
• Transaction: A sequence of operations that must all happen together
• Example: transferring money between bank accounts
• Simultaneous access problems
• Incorrect summary problem
• Lost update problem
• Locking = preventing others from accessing data being used by a
transaction
• Shared lock: used when reading data
• Exclusive lock: used when altering data.(Read and Write both)
Maintaining Database
• Commit :Commit in SQL is a transaction control language that is used
to permanently save the changes done in the transaction in
tables/databases. The database cannot regain its previous state after its
execution of commit.
• ROLLBACK in SQL is a transactional control language that is used to
undo the transactions that have not been saved in the database.
• The process of undoing a transaction (when it is not save in database).
What is ER Model?
The relationship between Student and College is many to one as a college can have many
students however a student cannot study in multiple colleges at the same time.