BPA DBMS Chapter1 - DBMS Overview
BPA DBMS Chapter1 - DBMS Overview
Database Concepts
दत्तांशसांग्रह अवधतरणत
Prabin Babu Dhakal, CDPA, TU
IceCube Neutrino
Observatory
5
Prabin Babu Dhakal, CDPA, TU
The relational data model is one of the most important concepts in computing! 6
Prabin Babu Dhakal, CDPA, TU
9
Prabin Babu Dhakal, CDPA, TU
Introduction to DBMS
• Characteristics and definition of database and
database management system
• Database history
• Organization of records
• File organizations
• Read: https://en.wikipedia.org/wiki/Database
Prabin Babu Dhakal, CDPA, TU
Definitions
• Database: organized collection of logically related
data
• Data: stored representations of meaningful objects
and events
– Structured: numbers, text, dates
– Unstructured: images, video, documents
• Information: processed data that increase
knowledge in the person using the data
• Metadata: data that describes the properties and
context of user data
Prabin Babu Dhakal, CDPA, TU
Database (दत्तांशनिधध)
• A Database is a collection of related data
• Organized in a way that data can be easily accessed,
managed and updated
• DB is large and integrated collection of data
• Any piece of information can be a data, for example
name of your University – TU
• Database is actually a place where related piece of
information is stored and various operations can be
performed on it
• Models a real-world enterprise
– Entities (generally name e.g., Students study Courses)
– Relationships (generally verb e.g., Teacher teach student)
Prabin Babu Dhakal, CDPA, TU
Functions of DBMS
• Data Independence
• Concurrency Control
• Recovery services
• Utility services
• Provides a clear and logical view of the
process that manipulates data
Prabin Babu Dhakal, CDPA, TU
Advantages of DBMS
• Segregation of application and data
• Minimal and planned data redundancy
(duplication)
• Improved data consistency
• Easier data retrieval, sharing, accessibility and
responsiveness
• Increased productivity
• Enforcement of security and standards
• Reduced development time and maintenance
need
Prabin Babu Dhakal, CDPA, TU
Disadvantages of DBMS
• New specialized manpower needed
• Installation and management cost and
complexity increased
• Complexity
• Large in size
• Overkill for small processes
Prabin Babu Dhakal, CDPA, TU
Applications of DBMS
• Support internal operations of organizations,
online interactions with customers and suppliers
etc.
• Hold administrative information and more
specialized data, such as engineering data or
economic models
• Examples: computerized library systems, flight
reservation systems, computerized parts
inventory systems, content management systems
that store websites as collections of webpages in
a database
Prabin Babu Dhakal, CDPA, TU
History
• Navigational Databases developed in 1960s
hierarchical and network models
• RDBMS developed in 1970s to manage tabular
data and later SQL developed
• Widespread deployment of RDBMS in 1980s
• Object-relational databases developed in 1980s
• RDBMS dominated database world since 1990s
• New generation NoSQL database developed in
later 2000s
Prabin Babu Dhakal, CDPA, TU
Record organization
• Flat file
– Plain text file or Binary file; usually one record per line
– Delimited, fixed length or indexed
– Used in smaller system and simple data
• Inverted Index
– index data structure
– Stores mapping from words or numbers, to its locations
in database file, or document
– Allow fast full text searches
– Used on a large scale e.g. in search engines
Prabin Babu Dhakal, CDPA, TU
File organization
• Method of arranging the records in a file when
the file is stored on disk. A relation is typically
stored as a file of records
Think
• Do you think it is a good idea to sort the
records stored in a file? Why?
Prabin Babu Dhakal, CDPA, TU
Data dictionary
• Dictionary about the data that we store in the database
• Contains all the information about the data objects
• It is like storing all up-to-date information about the objects
like tables, columns, index, constraints, functions etc.
• Makes us easily identify access and understand the factors
about the object.
• In the case of a table, data dictionary provides information
about
– Its name
– Security information like who is the owner of the table, when
was it created, and when it was last accessed.
– Physical information like where is the data stored for this table
– Structural information like its attribute names and its data types,
constraints and indexes.
Prabin Babu Dhakal, CDPA, TU
What is an index
Method of Stored as they Stored at the end Stored at the hash Address index is Stored in a tree like Frequently joined
storing come of the file. address generated appended to the structure tables are clubbed
record into one file based
on cluster key
Types Simple file and Static and dynamic Dense, Sparse, Indexed and Hash
sorted file hashing multilevel indexing
Design Simple Simplest Medium Complex Complex Simple
Advantage Fast and Best suited for Faster Access Searching records is Searching range of data Best suited for
efficient when bulk insertion, No Need to Sort faster. Suitable for efficient. No frequently joined
there is large and small Handles multiple large database. Any performance degrades tables.
volumes of files/tables transactions of the columns can when there is insert / Suitable for 1:M
data, Report Suitable for Online be used as key delete / update. mappings
generation, transactions column. Searching Grows and shrinks with
statistical range of data & data. Works well in
calculations etc partial data are secondary storage.
efficient. Searching is easy.
All data sorted
Dis- Sorting of data Records are Use of Memory is Extra cost to Not suitable for static Not suitable for
advantage each time for scattered and inefficient maintain index. tables large database.
insert/delete/ memory Searching range of File reconstruction Suitable only for
update takes inefficiently used. data, partial data, is needed as the joins on which
time and makes Proper memory non-hash key insert/update/delet clustering is done.
system slow. management is column, or e. Less frequently
needed. Not frequently updated Does not grow with used joins and 1: 1
suitable for large column as hash key data. Mapping are
tables. are inefficient. inefficient.
Prabin Babu Dhakal, CDPA, TU
English to Nepali
• Data: दत्, दत्तांश
• Information: सच ू ित, सचू ्तांश (computer)
• Database: दत्तांशनिधध
• Entity: सत्व
• Relation: सांवन्ध
• Entity relationship diagram: व््भिलेख (computer)
• Schema: प्रबन्न्धकत (computer)
• Syntax: शब्दतिश ु तसि
• SQL: सां्ोगितषत, सांववपष ृ त
Prabin Babu Dhakal, CDPA, TU
Viva questions
• Ques 3. Which have more quick response DBMS or file management system ? how ?
Ans- Fast response to information requests: Because data are integrated into a single database,
complex requests can be handled much more rapidly if the data were located in separate, non-
integrated files. In many businesses, faster response means better customer service.
• Ques 4. How DBMS provide program data insulation and data abstraction?
Ans- DBMS provide following levels of data abstraction
a) Physical level
b) logical level
c) view level
• Ques 5. Is there any difference between DBMS and file management system in terms of ACID
properties?
Ans- DBMS ensures data integrity by managing transactions through ACID test = atomicity,
consistency, isolation, durability. While such integrity is absent in file management system.
• Ques 6. What are the advantages of DBMS over file management system ?
Ans- The advantages of DBMS over file management system are:
a) Control redundancy
b) Restrict unauthorized access
c) Provide multiple user interfaces
d) Enforce integrity constraints.
e) Provide backup and recover
Prabin Babu Dhakal, CDPA, TU
Viva questions
• Ques 7. What are basic differences between DBMS and file management system ?
Ans- These are basic differences between DBMS and file management
1) Flexibility
2) Fast response to information requests
3) Multiple access
4) Lower user training costs
5) Less storage
• Ques 8. Is there any goal differences in file management system and DBMS ?
Ans- Following are the goal differences between File Management System and DBMS-
1) Data Management- An FMS should provide data management services to the application.
Generality with respect to storage devices. The FMS data abstractions and access methods should
remain unchanged irrespective of the devices involved in data storage.
2) Validity- An FMS should guarantee that at any given moment the stored data reflect the
operations performed on them.
3) Protection- Illegal or potentially dangerous operations on the data should be controlled by the
FMS.
4) Concurrency- In multiprogramming systems, concurrent access to the data should be allowed
with minimal differences.
5) Performance- Compromise data access speed and data transfer rate with functionality.
• Ques 9. Which one take utilization of resources DBMS or file management system and how ?
Ans- Database is multi user and provides utilization of resources whereas in file management there
is no utilization of resources.
• Ques 10. How data redundancy is controlled in DBMS while not in file management system ?
Ans- It reduces data redundancy (duplication of data) and maximizes database integrity (data
without errors). So DBMS is less redundant than file management system.