Computer Chapter 11
Computer Chapter 11
Components of Database
A database consists of several different components. Each component listed, is called
an object.
Database components are described below
1. Tables These are the building blocks or relation (of any relational database model
where all the actual data is defined and entered.
Different types of operation are done on the tables such as storing, filtering, retrieving
and editing of data. Tables consist of cells at the intersection of records (rows) and
fields (columns), which are described below
(i) Field It is an area (within the record) reserved for a specific piece of data.
e.g. Customer number, Customer name, Street address, City, State, Phone number,
Current address, etc. Field of a table is also known as column or attribute.
(ii) Record It is the collection of data items of all the fields pertaining to one entity,
i.e. a person, company, transition, etc. Record of a table is also known as row or a
tuple and the number of records in a relation is called the cardinality of that relation.
2. Queries These are basically questions based on the data available in a database.
A query consists of specifications indicating which fields, records and summaries a
user wants to fetch from the database.
Queries allow you to extract data based on the criteria that you define.
3. Forms Although you can enter and modify data in datasheet view of tables but
you neither control the user’s action very well nor you can do much to facilitate the
data-entry process. To overcome this problem, forms are introduced. Like tables,
forms can be used to view and edit your data. However, forms are typically used to
view the data in an underlying table, one record at a time.
e.g. A user can create a data entry form that looks exactly like a paper form. People
generally prefer to enter data into a well-designed form, rather than a table.
4. Reports When you want to print those records which are fetched from your
database, design a report. Access even has a wizard to help produce mailing labels.
Database Management System (DBMS)
A DBMS is a collection of inter-related data and a set of programs to retrieve data
from the database.
It is an organised collection of data viewed as a whole, instead of a group of separate
unrelated files.
The primary goal of DBMS is to provide an environment that is both convenient and
efficient for user to store and retrieve database information.
e.g. MySQL, Oracle, FoxPro, dBASE, SyBase, MS-Access. The purpose of database
management system is to bridge the gap between information and data.
The basic processes that are supported by DBMS are as follows
(i) Specification of data types, structures and constraints to be considered in an
application.
(ii) Storing the data.
(iii) Manipulation of the database.
(iv) Querying the database to retrieve desired information.
(v) Updating the content of the database.
Architecture of DBMS
The architecture of DBMS is divided into three levels are as follows
1. Internal or Physical Level It is the lowest level of data abstraction that deals with
the physical representation of the database on the computer. It is also known as
physical level.
It defines how the data is actually stored and organised in the storage medium.
2. Conceptual or logical Level It is the overall view of the database and includes all
the information that is going to be represented in the database.
It describes what type of data is stored in the database, the relationship among the
data without effecting to the physical level. It is also known as logical level.
3. External or User Interface Level This is the highest level of data abstraction
which describes the interaction between the user and the system.
It permits the users to access data in a way that is customised according to their
needs, so that the same data can be seen by different users in different ways, at the
same time. It is also known as view level.
Advantages of DBMS
1. Reduction in Data Redundancy The duplication of data refers to data
redundancy. DBMS cannot make separate copies of the same data. All the data is
kept at a place and different applications refer to data from centrally controlled
system.
2. Better Interaction with Users In DBMS, the availability of uptodate information
improves the data to be access or respond as per user requests.
3. Improvement in Data Security DBMS can allow the means of access to the
database through the authorised channels.
To ensure security, DBMS provides security tools, i.e. username and password.
4. Maintenance of Data Integrity Data integrity ensures that the data of database
is accurate. In DBMS, data is centralised and used by many users at a time, it is
essential to enforce integrity controls.
5. Backup and Recovery The DBMS provides backup and recovery sub-system that
is responsible to recover data from hardware and software failures.
Disadvantages of DBMS
1. Cost of Hardware and Software A processor with high speed of data processing
and memory of large size is required to run the DBMS software. It means that you
have to upgrade the hardware used for file based system. Similarly, database
software is also very costly.
2. Complexity The provision of the functionality that is expected from a good DBMS
makes the DBMS an extremely complex piece of software. Failure to understand the
system can lead to bad design decisions, which can have serious consequences for
an organisation.
3. Cost of Staff Training Mostly DBMSs are often complex systems, so the training
for user to use the database is required. The organisation has to pay a lot of amount
for the training of staff to run the DBMS
4. Appointing Technical Staff The trained technical persons such as database
administrator, application programmers, etc., are required to handle the database.
You have to pay a lot of amount to these persons. Therefore, the system cost
increases.
5. Database Failure In most of the organisations, all data is integrated into a single
database. If database is corrupted due to power failure or it is corrupted on the
storage media, then our valuable data may be lost or whole system stop.
Applications of DBMS
1. Banking For customer information, accounts, loans and other banking
transactions.
2. Reservation For reservation and schedule information.
3. Universities For student information, course registration, grades, etc.
4. Credit Card Transaction For purchase of credit cards and generation of monthly
statements.
5. Tele-communication For keeping records of calls made, generating monthly bill,
etc.
6. Finance For storing information about holdings, sales and purchase of financial
statements.
7. Sales For customer, product and purchase information.
Relational Database
In relational database, data is stored in different tables with relationships to each
other. In the case of relational database, a Relational Database Management System
(RDBMS) performs this task.
An important feature of this database system is that a single database can be spread
across several tables, e.g. Base, Oracle, DB2, SyBase, Informix, etc.
Key
A key is defined as the column or set of columns in a table that is used to identify
either row of data in a table or establish relationship with another table.
If a table has Id, name and address as the column names, then each one is known
as the key for that table. The keys are also used to uniquely identify each record in
the database table.
Types of Key
1. Primary Key It is a set of one or more attributes that can uniquely identify tuples
(rows) within the relation. The primary key should be chosen in such a way, i.e. its
value must not be changed.
There should not be duplicacy in the record of primary key. Primary key can be
atomic or composite. The field chosen as primary key, cannot accept null value.
2. Candidate Key The set of all attributes which can uniquely identify each tuple
(row) of a relation, is known as candidate key. Each table may have one or more
candidate keys and one of them will become the primary key. The candidate key of a
relation is always a minimal key.
3. Alternate Key From the set of candidate keys after selecting one of the keys as
primary key, all other remaining keys are known as alternate keys.
4. Foreign Key It is a non-key attribute whose value is derived from the primary key
of the same or some another table. The relationship between two tables is established
with the help of foreign key.
A table may have multiple foreign keys and each foreign key can have a different
referenced table.
5. Unique Key Same as primary key it can be blank
6. Super key More than ode dependency
Database Languages
1. Data Definition Language (DDL) It is used to define structure of your tables and
other objects in database. In DBMS, it is used to specify a database schema as a set
of definitions.
2. Data Manipulation Language (DML) It provides various commands used to access
and manipulate data in existing database. This manipulation involves inserting data
into database tables, retrieving existing data, deleting data from existing tables and
modifying existing data.
3. Data Control Language (DCL) These commands are used to assign security levels
in database which involves multiple user setups. They are used to grant defined role
and access privileges to the users.
Entity
It is an object that has its existence in the real world. It includes all those things
about which the data are collected. “Entities are represented in rectangles”, e.g.
Customer buys items, it means Customer and Items are entities.
Attributes
It describes the characteristics or properties of entity. In tables, attributes are
represented by columns. Attributes are drawn in elliptical shapes, e.g. Items entity
may contain Itemld and Price.
Entity Set
It is a set of entities of the same type that shares same properties or attributes, e.g.
Students are an entity set of all student entities in the database.
Entity set is of two types which are as follows
1. Strong Entity Set It has a primary key or can be easily distinguishable each
attribute.
2. Weak Entity Set It does not posses sufficient attributes to form a primary key.
Relationship
It is an association among several entities. A relationship describes how two or more
entities are related to each other. It is represented by diamond shape.
Relationship can be divided into three parts
(i) One-to-One This relationship tells us that a single record in Table A is related to
a single record in Table B and vice-versa.
(ii) One-to-Many This entails one data in Table A to have links to multiple data in
Table B. However, a single data in Table B, will have link to a single data in Table A.
(iii) Many-to-Many Each data in Table A is linked to all the data in Table B and vice-
versa.
(iv) many to one → many data link to one data
Tit-Bits
• Dr. EF Codd represented 12 rules for Relational Database Management System
(RDBMS) in 1970.
• Schema is a logical structure of the database.
• Instances are the actual data contained in the database at a particular point of
time.
• Data Duplication wastes the space, but also promotes a more serious problem
called data inconsistency.
• Data Mining is the process of sorting through large data sets to identify patterns
and establish relationships to solve problems through data analysis.
Questions Bank
1. A ……….. is a collection of data that is stored electronically as a series of records
in a table.
(1) Spreadsheet (2) Presentation
(3) Database (4) Web page
2. A collection of interrelated records is called a
(1) utility file (2) management information system
(3) database (4) spreadsheet
(5) datasheet
3. Which of the following is the organised collection of large amount of interrelated
data stored in a meaningful way used for manipulation and updation?
(1) Database (2) File
(3) Folder (4) Data-mining
(5) None of these
4. Items such as names and addresses are considered as
(1) input (2) data
(3) output (4) records
5. Which type of database, organised the data in the form of tree with nodes?
(1) Network Database
(2) Hierarchical Database
(3) Relational Database
(4) Multiple Database
6. The database stores information in
(1) rows and columns (2) blocks
(3) tracks and sectors (4) All of the above
7. To locate a data item for storage is
(1) field (2) feed
(3) database (4) fetch
8. Devices that could be used to input data into a database are
(1) keyboard, fax roller ball
(2) mouse, keyboard, monitor
(3) mouse, keyboard, touch screen
(4) All of the above
9. In a relational database, a data structure that organises the information about
a single topic into rows and columns, is
(1) block (2) record
(3) tuple (4) table
10. The smallest unit of information about a record in a database is called a
(1) cell (2) field
(3) record (4) query
11 ……….. are distinct items that do not have much meaning to you in a given
context.
(1) Fields (2) Data
(3) Queries (4) Properties
(5) None of these
12. A collection of related files is called a
(1) character (2) field
(3) database (4) record
(5) None of these
13. Which of the following contains information . about a single ‘entity’ in the
database like a person, place, event or thing?
(1) Query (2) Form
(3) Record (4) Table
14. DBMS is comprised of tables that made up of rows called and columns called