KEMBAR78
Chapter 1 - Database2 | PDF | Databases | Table (Database)
0% found this document useful (0 votes)
44 views13 pages

Chapter 1 - Database2

Uploaded by

anuz.khtry.00
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
44 views13 pages

Chapter 1 - Database2

Uploaded by

anuz.khtry.00
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 13

Chapter 1: Database Management System

Data
● Data is a collection of raw or known facts about an entity that can be
recorded or stored.
● Data may or may not give any information.
● Data can be in any form such as text, image, sound, video, symbols,
figures, etc.
● e.g.: 25, Ram, computer, Nepal

25 can be age of ram or marks obtained in the computer or the


amount of money that he has.

● There are two main types of data:

Ø Quantitative data: Data which are in numerical form, like the


weight, size, or cost of an item is known as quantitative data.

Ø Qualitative data: Data that are descriptive, but non-numerical,


like the name, address, or gender of a person is known as
qualitative data.

Information
● Information is the processed data that is meaningful and usable.
● Information of one thing may be the data of another.
● It helps in drawing conclusions and making decisions. Decision
making without proper information does not have significant impact.

Hence, better the information we have, we can make accurate and effective
decisions.

e.g.: Ram obtained 25 marks in computer.


Student Marks Record
S.N Name Subject Marks
1 Ram Computer 25

Difference between Data and Information

Data Information

1. Data is a raw or known 1. Information is a processed


facts about an entity which data which is meaningful
can be recorded or stored. and usable.

2. It stores facts. 2. It presents facts.

3. Data is collected from 3. It is obtained after


various sources. processing the data.

4. Data isn’t sufficient for 4. We can make decisions


decision-making. based on information.

5. It is inactive in nature (they 5. It is active in nature (it


exist). enables doing).

6. Data can be in any form 6. Information is typically


such as text, image, sound, presented through words,
video, symbols, figures, language, thoughts, and
etc. ideas.

7. e.g.: 25, Ram, Computer 7. e.g.: Ram obtained 25 marks


in computer.
Database
● A database is a systematic collection of logically interrelated data.
● Data in the database is stored in a formatted way so, that they can be
accessed, retrieved, and manipulated whenever necessary.
● Data can be shared by multiple users simultaneously in the database.

e.g.: College database to store information about students.

Characteristics of data in a database


Characteristics of database

· Shared:

Data can be accessed by multiple users simultaneously.

· Secured:

Data is protected from unauthorized access.

· Integrated:

Data are correct and accurate.

· Persistent:

Data exist permanently in database until removed by user.

· Non- redundant:

Data repetition or duplication is reduced.

· Independence:

Three level of schema is independent of each other so that change in one


level does not affect the other level.
Database Management System
● It is a software system that allows to define, create, maintain, and
control access to the database.
● DBMS provides convenient and effective methods of defining, storing,
retrieving, and manipulating databases for various applications.
● The DBMS acts as an interference between the application program
and the data in the database.

e.g.: MS Access, Oracle, MySQL, SQL server, Clipper, dBase, FoxPro, etc.

Objectives of DBMS

Ø To provide very easy access to data for users.

Ø To provide large space for the storage of relevant data.

Ø To remove duplicate or repeated data.

Ø To allow multiple users to use same data at a same time.

Ø To provide protection to data from unauthorized access.

Ø To preserve the data and store it permanently.

Ø To provide the user with the latest modification of the database.

Ø To provide quick responses to user requests for any data.

Function of DBMS

1. Storing, manipulating and managing information.

2. Reduction of repeated data.

3. Providing data security.

4. Keeping latest and correct information.

5. Fast access to data.


6. Backup and Recovery management.

7. Data integrity management.

Application

1. Universities and Colleges: To store the academic, personal and


financial records of students, teachers, departments, etc.

2. Banking: To store information like personal data, and account


numbers about customers and staff as well as to manage the log
and balance sheet.

3. Manufacturing: Database is used in manufacturing to store


information about raw materials, production, and warehouse.

4. Telecommunications: The records of call logs, balance and


phone numbers of all customers are stored in the database.

5. Airlines: Database can be used in airlines to keep all the details of


flight schedules, reservations, and details of planes.

6. Sales: To keep the records of buy and sell, price of products etc.

Advantages of DBMS

1. Reduced Data Redundancy.

Database management system reduces the repetition of the data in


database. There are numbers of techniques like normalization, primary key
allocation to ensure there is a less amount of duplicate data. This helps to
save the memory space required to store the data and time which is
required to enter those data.

2. Sharing of data.

A data can be accessed by multiple users at the same time. If same data is
required to two different users, they both can access the same data
simultaneously. This increase productivity as both users can work
parallelly.

3. High Data Security.

Security measures like user authentication, passwords, and firewalls can


be implemented. Data can be accessed only by authorized users. Hence,
sensitive data can be prevented from unauthorized access.

4. Data Consistency:

DBMS ensures there is consistency in the data. If some changes are made
in one file, then all the other related files will also be updated automatically.
Since data

5. Better data integrity.

Integrity constraints in database management systems help to store


accurate and updated data in the database. DBMS avoids data
inconsistency, so it improves data integrity.

6. Access to the latest data.

Users can get the latest modified data. In DBMS there is a chance of a file
being used by several users. If there is some change in those files then
those changes will be shown immediately to all the users.

7. Backup and Recovery facilities.

DBMS has a mechanism for recovering the data from hardware or software
failures. We can recover the data of certain instances easily

Dis-advantages of DBMS

1. DBMS sometimes can be too complex to understand and


implement.

2. DBMS has too many rules.


3. Trained manpower such as DBA(Database Administrator) is
required to maintain and run the system.

4. There are always chances of losing or hacking of data.

5. In countries like Nepal, using computerized database system is too


expensive.

Database System
● It is a combination of both database and database management
system.
● Simply, it is a computerized record keeping system.
● Users of database system can add a new empty file in database and
also can remove any existing file.
● Furthermore, user can insert, retrieve, modify and delete data too.

Basic terms used in DBMS


Record
● aka row, tuple.
● Each row in a database is called a record.
● A record is a collection of fields about the same item.

Field
● aka column, attributes.
● A field is an individual element of a record.
● It defines a data type for a set of values in a table.

Table
● aka relations
● It is a collection of data about specific topic.

Object
● It is a data structure to either store or reference data.
● The most common object that people interact with is the table.
Data Type
● Data types are properties in each field.
● e.g.: int, char(size), varchar(size), date, numeric(a, b).

Keys in DBMS
● A key refers to an attribute or set of attributes that helps us to identify a row
(or tuple) uniquely in a table (relation).
● A key is also used to establish and identify relationships between different
tables.

Super Key
● A super key refers to the set of all those keys that help us to uniquely
identify all the rows present in a table.
● It means that all of these columns present in a table that can identify the
columns of that table uniquely act as the super keys.

Candidate Key
● Candidate key is a set of minimal super key that uniquely identifies each
record in the table.
● The candidate keys refer to those attributes that identify rows uniquely in a
table
● There can be more than one candidate key.
Primary Key
● A primary key is a candidate key that is chosen by database designer.
● The primary key refers to a column or a set of columns of a table that helps
us identify all the records uniquely present in that table.
● A table can consist of just one primary key.
● The values of primary key cannot be null and cannot be repeated.

Alternate Key /Secondary Key


● Out of all the candidate keys, only one is selected as primary key. Remaining
keys are known as alternate or secondary keys.
● Simply, all those keys that did not become a primary key are known as
alternate keys.

Foreign Key
● The primary key of one table is used in another table, then it is called foreign
key.

Data Model
● Data Model is a logical structure of database.
● It is a collection of conceptual tools for describing data, relationships,
semantics and consistency constraints.
● It defines how data are stored and accessed.

Types of Database Model


1. Hierarchical Database Model
2. Network Database Model
3. Relational Database Model
1. Hierarchical Database Model
● Oldest data model.
● In this model, data elements are linked in the form of an inverted tree
structure, with the root at top and the branches formed below.
● Data are viewed as collections of relations that form hierarchical relation.
● There is parent child relationship among the data elements of hierarchical
database.
● Child data element cannot have more than one parent element but one parent
element can have more than one child element.
Advantages
● Hierarchical database model is very efficient in handling one to many
relationships.
● It is secure model. Nobody can modify a child without permissions of its
parent.
● Searching of data is fast and easy if parent is known.
● It is the easiest model of the database.

Disadvantages
● Higher data redundancy.
● Difficult to add or modify child as it required permission from parent.
Hence, inflexible.
● Cannot handle many to many relationships.
● It is old fashioned, outdated database model.
● When parent node is deleted, all the children nodes are also deleted.

2. Network / Graph Database Model


● It is an extension of hierarchical model.
● Data is organized like a graph structure. Hence, this model is also known as
graph data model.
● In this model, there is also parent child relationship among the data
elements. Child data can have more than one parent element.
● Data is more related as more relationships are established.
● Used to map many to many data relationships.
Advantages
● It is more flexible than hierarchical database model.
● It is used to map many to many relationships.
● Searching is faster because of multidirectional pointer.
● Data repetition is reduced.

Disadvantages
● Less secure than hierarchical.
● It is too complex as there are many relationships.
● Requires long program to handle the relationship.
● Pointer used in this model increase the overhead of storage.

3. Relational Database Model


● In relational database, the data elements are organized in the form of the
tables with rows and columns.
● Each table in database is stored as a separate file.
● Each column represents data field and each row represents a data record.
● The data in one table is related to a data in another table with a common
field.
Advantages
● Very less redundancy of data in this model.
● Normalization of database is possible.
● Quick database processing.

Disadvantages
● Most complex database models.
● Too many rules which makes this database model non user friendly.
● Required Skilled manpower.

You might also like