Chapter 1 Introduction To Databases
Chapter 1 Introduction To Databases
DATABASES
What is Database?
Difficulty in accessing data. Suppose that one of the university clerks needs
to find out the names of all students who live within a particular postal-code
area. The clerk asks the data-processing department to generate such a list.
Because the designers of the original system did not anticipate this request,
there is no application program on hand to meet it. There is, however, an
application program to generate the list of all students.
Limitations of File-Based Approach
Security problems. Not every user of the database system should be able to
access all the data. For example, in a university, payroll personnel need to
see only that part of the database that has financial information. They do not
need access to information about academic records. But, since application
programs are added to the file-processing system in an ad hoc manner,
enforcing such security constraints is difficult.
The columns of this relation are called Fields, Attributes or Domains. The rows are
called Tuples or Records.
Advantages of DBMS
Controlling of Redundancy: Data redundancy refers to the duplication of data (i.e. storing
same data multiple times). In a database system, by having a centralized database and
centralized control of data by the DBA the unnecessary duplication of data is avoided. It also
eliminates the extra time for processing the large volume of data. It results in saving the
storage space.
Improved Data Sharing: DBMS allows a user to share the data in any number of application
programs.
Data Integrity: Integrity means that the data in the database is accurate. Centralized control
of the data helps in permitting the administrator to define integrity constraints to the data in
the database. For example: in customer database we can enforce an integrity that it must
accept the customer only from Noida and Meerut city.
Advantages of DBMS
Security: Having complete authority over the operational data, enables the
DBA in ensuring that the only mean of access to the database is through
proper channels. The DBA can define authorization checks to be carried out
whenever access to sensitive data is attempted.
Data Consistency: By eliminating data redundancy, we greatly reduce the
opportunities for inconsistency. For example: is a customer address is stored
only once, we cannot have disagreement on the stored values. Also updating
data values is greatly simplified when each value is stored in one place only.
Finally, we avoid the wasted storage that results from redundant data
storage.
Efficient Data Access: In a database system, the data is managed by the
DBMS and all access to the data is through the DBMS providing a key to
effective data processing
Advantages of DBMS
It is bit complex. Since it supports multiple functionality to give the user the
best, the underlying software has become complex. The designers and
developers should have thorough knowledge about the software to get the
most out of it.
Because of its complexity and functionality, it uses large amount of memory.
It also needs large memory to run efficiently.
DBMS system works on the centralized system, i.e.; all the users from all over
the world access this database. Hence any failure of the DBMS, will impact all
the users.
DBMS is generalized software, i.e.; it is written work on the entire systems
rather specific one. Hence some of the application will run slow.
Database Management System and its
Applications
A Database management system is a computerized record-keeping system. It
is a repository or a container for collection of computerized data files. The
overall purpose of DBMS is to allow he users to define, store, retrieve and
update the information contained in the database on demand. Information
can be anything that is of significance to an individual or organization.
DBMS
Databases touch all aspects of our lives. Some of the major areas of
application are as follows:
1. Banking
2. Airlines
3. Universities
4. Manufacturing and selling
5. Human resources
Enterprise Information
People: Users of the database system e.g. database designers, DBAs, application
programmers, and end-users.
Data: Data acts the bridge between the machine and human components. The database
contains both operational and meta data (data about data).
Roles/Users in the Database Environment
Data Administrator (DA): Responsible over the data policies in the organization.
Does not need to be a technical person.
Database Administrator (DBA) also known as DBA’s Responsible for the management
and control of the database. More technically oriented than the DA
Physical database designer: designs any security measures required on the data. Selecting
specific storage structures,(Swap-space management) and access methods for data to achieve
good.
Roles/Users in the Database Environment
Application Programmers: Write programs for accessing and interacting with the
database through DML calls such as data retrieval, data update, data insertion and data
deletion.
End Users (naive and sophisticated): participate in data entry of data and manipulation.
Naive Users: do not know any thing about the database e.g. checkout assistant at a local
supermarket.
In this architecture, the database is directly available to the user. It means the
user can directly sit on the DBMS and uses it.
Any changes done here will directly be done on the database itself. It doesn't
provide a handy tool for end users.
The 1-Tier architecture is used for development of the local application,
where programmers can directly communicate with the database for the
quick response.
2-Tier Architecture
The 3-Tier architecture contains another layer between the client and server. In
this architecture, client can't directly communicate with the server.
The application on the client-end interacts with an application server which
further communicates with the database system.
End user has no idea about the existence of the database beyond the
application server. The database also has no idea about any other user beyond
the application.
The 3-Tier architecture is used in case of large web application.
3-Tier Architecture
Guidelines for Designing Database
• Include a common field in related tables. You use the common field to
connect one table logically with another table. When you include the primary
key from one table as a field in a second table to form a relationship, the
field is called a foreign key in the second table.
• Avoid data redundancy. Data redundancy occurs when you store the same data
in more than one place. With the exception of common fields to connect
tables, you should avoid redundancy because it wastes storage space and can
cause inconsistencies.
• Determine the properties of each field. You need to identify the properties of
each field so that the DBMS knows how to store, display, and process the
field. These properties include the field's name, maximum number of
characters or digits, data type, description, valid values, and other field
characteristics.
Data types of field and field size
Before creating a database, you must know the data type of field and the field
size. The field size specifies the max number of characters or amount of data
that can be stored into the field.
What is a data type?
It is a feature in database which specifies that type of data to be held in a
given field(stored).
Common data types fields
Text-Text or combinations of text and numbers, as well as numbers that don't require calculations,
such as phone numbers. –Up to 255 characters
Memo-Lengthy text or combinations of text and numbers -Up to 65,535 characters.
AutoNumber-A unique sequential (incremented by 1) number or random number assigned by
Microsoft Access whenever a new record is added to a table. AutoNumber fields can't be updated.
Yes/No-Yes and No values are fields that contain only one of two values (Yes/No, True/False, or
On/Off).
OLE Object-An object (such as a Microsoft Excel spreadsheet, a Microsoft Word document, graphics,
sounds, or other binary data) linked to or embedded in a Microsoft Access table. OLE-Object Linking
and Embedding
Date/Time-Date and time values for the years 100 through 9999.
Number-Numeric data used in mathematical calculations.
Common data types
• Integer-It refers to a data type which represents some finite subset of the
mathematical integers. An integer is specified in the program as a sequence
of digits without spaces or thousands separators, optionally prefixed with + or
–
• Boolean-It is a data type having two values usually denoted TRUE or FALSE /
Yes or No.
• Character-It is a unit of data that corresponds to a unit, or symbol, such as in
an alphabet written in form of a natural language.
• Floating-point number-It describes a system for representing real numbers
which supports a wide range of values.
Summary of common Data Types
Basic Database Concepts
• File /Table/Entity
A set of related records .
A database table is similar in appearance to a spreadsheet, in that data is stored in
rows and columns in a spreadsheet while data is stored in fields and records in a
database.
• Field
A single item of data common to all records
• Record
A collection of data about an individual item
• An attribute
It is part of the description of the entity. Some of the attributes of a student include
name, subject, class, age, sex e.t.c.
Basic Database Concepts
• Tables-In Access, data is stored in tables. A table is a set of columns and rows,
with each column referred to as a field. Each value in a field represents a
single type of data. Each row of a table is referred to as a record.
• Queries-You use queries to retrieve specific data from your database and to
answer questions about your data. For example, you can use a query to find
the names of the employees in your database who live in a particular stat
• Forms-Forms give you the ability to choose the format and arrangement of
fields. You can use a form to enter, edit, and display data.
Basic Database Concepts
Reports-Reports organize or summarize your data so you can print it or view it onscreen. You often
use reports when you want to analyze your data or present your data to others.
Macros-Macros give you the ability to automate tasks. You can use a macro to add functionality to a
form, report, or control.
Modules-Like macros, modules give you the ability to automate tasks and add functionality to a form,
report, or control. Macros are created by choosing from a list of macro actions, whereas modules are
written in Visual Basic for Applications.
Database window: the window that appears when you open a database and that is the main control
center for working with an open Access database.
Objects Bar: contains a set of controls each of which controls one of the six major object groups in
an Access database: tables, queries, forms, reports, macros and modules.
Groups Bar : provides a way to organize database objects into groups and provides shortcuts to those
objects to make them easily accessible.
Basic Database Concepts
Data Structuring:
Every piece of information that you can add to your database will be
organized in a kind of catalogue, so it will be easier for you to search and
update your records later on.
Database Customization
Along with default and necessary elements (records, tables, or objects) that
compose a database's structure, there can be created custom elements that
meet specific needs of users.
Features of a (DBMS)
Data Retrieval
Database management system accepts data input from users and stores it. Users can access the database later on
to retrieve their records as a file, printed, or viewed on the screen.
Query Languages: A typical DBMS makes it possible to use query languages for collecting, searching, sorting,
modifying and other activities that help users manipulate their records in the database.
Multi-user Access
DBMS provides multiple users access to all types of information stored in one and the same data store. There is
also a security feature that prevents some users from viewing and/or modifying certain data types.
Data Integrity
All information in a database is accessible by several or more users but only one user can change the same piece
of data at a time. This capability lets prevent database corruptions and failure.
Metadata
DBMS database management software provides a metadata library (or a data dictionary) that describes how the
database is organized and what elements (objects, related files, records, etc.) compose its structure.
Examples of Database management software include
Lotus Approach
Microsoft Access
OpenOffice.org Base
Corel Paradox
Oracle
Structured Query Language(SQL)
MySQL
Examples of Databases