Chitransh File BDPS
Chitransh File BDPS
SUBJECT:- IT-402
SESSION 2022-23
Teacher’s sign
DATABASE
MANAGEMENT SYSTEM
(DBMS)
Introduction to Database Management System
A database is basically a computer based record/data/information keeping system. Data is raw, unorganized facts and entities
relevant to the user need to be processed such as a digital representation of text, numbers, graphical images or sound. The data
are stored in such a way that they are independent of the programs used by the people for accessing the data.
e.g. consider the names, telephone numbers and addresses of the relatives etc. You may have recorded this data in an indexed
address book or you may have stored it on a hard drive, using application software such as Microsoft Access or OpenOffice.org
BASE. Database can be created with the help of given structure:
Information – When data is processed, organised, structured or presented in a given context so as to make it useful is called
information.
Character – The value or data are in the form of letter, number or special character.
File – A file is a collection of related record.
The need for a database arose in the early 1960s in response to the traditional file processing system. In the file processing
system, the data is stored in the form of files and a number of application programs are written by programmers to add, modify,
delete and retrieve data to and from appropriate files.
However, the file processing system has a number of problems, which are as follows:
•The file processing system lacks the insulation between program and data.
•Handling new queries is difficult, since it requires change in the existing application programs or requires a new application
program.
•Unable to maintain data standards and does not provide data sharing.
•In this system, all the integrity rules need to be explicitly programmed in all application programs, which are using that
particular data item.
A database consists of several components. Each component plays an important role in the database system environment.
The major components of database are as follows:
Data
It is raw numbers, characters or facts represented by value. Most of the organisations generate, store and process large amount
of data. The data acts as a bridge between the hardware and the software. Data may be of different types such as User data,
Metadata and Application Metadata.
Software
It is a set of programs that lies between the stored data and the users of database. It is used to control and manage the overall
computerized database. It uses different types of software such as MySQL, Oracle etc.
Hardware
It is the physical aspect of computer, telecommunication and database, which consists of the secondary storage devices such as
magnetic disks, optical discs etc., on which data is stored.
Users
It is the person, who needs information from the database to carry out its primary business responsibilities.
The various types of users which can access the database system are as follows:
Application Programmers
The people, who write application programs in programming languages to interact and manipulate the database are called
application programmers.
End-user
A person, who interacts with the database system to perform different operations on the database like inserting, deleting etc.,
through menus or forms.
FEATURES OF A DATABASE
Tables
It is the building block of any relational database model, where all the actual data is defined and entered. A database consists of
many tables. Tables (relations) consist of cells at the intersection of records (rows) and fields (columns). Different types of
operations are done on the tables such as storing, filtering, retrieving and editing of data. It is also known as file.
Record
It is the collection of data items of all the fields (information) pertaining to one entity or a complete unit of information, i.e. a person,
company transition etc. Record of a table is also known as row, entity or tuple.
Queries
It is an inquiry into the database using the SELECT statement. These statements give you filtered data according to your
conditions and specifications indicating the fields, records and summaries which a user wants to fetch from a database. It allows
you to extract information from the database based on the conditions that you define in query.
Forms
In a database, a form is a window or a screen that contains numerous fields or spaces to enter data. Forms can be used to view
and edit your data. It is an interface in user specified layout.
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.
Reports
When you want to print those records which are fetched from your database, design a report. It is an effective way to present data
in a printed format. It allows you to represent data retrieved from one or more tables, so that it can be analysed.
It is a collection of programs that enables users to create, maintain database and control all the access to the database. It is a
computer based record keeping system.
The primary goal of the DBMS is to provide an environment that is both convenient and efficient for user to retrieve and store
information. It acts as an interface between the application program and the data stored in the database.
DBMS is a software package that manages database, e.g. MySQL, INGRES, MS-ACCESS etc.
DBMS is actually a tool that is used to perform any kind of operation on data in database. It also maintains data consistency in
case of multiple users. The purpose of a DBMS is to bridge the gap between information and data. Some basic processes that are
supported by a DBMS are as follows:
Database is created to operate large quantities of information by input, store, retrieve and manage the information. It is a
centralised location which provides an easy way to access the data by several users.
It does not keep the separate copies of a particular data file still a number of users can access the same data at the same time.
As the given diagram shows, DBMS works as an interface between the user and the centralized database. First, a request or a
query is forwarded to a DBMS which works (i.e. a searching process is started on the centralized database) on the received query
with the available data and if the result is obtained, it is forwarded to the user.
If the output does not completely fulfill the requirements of the user then a rollback (again search) is done and again search
process is performed until the desired output is obtained.
Advantages of a Database/DBMS
The centralized nature of database system provides several advantages, which overcome the limitations of the conventional file
processing system.
These advantages are as follows:
1.Reduce data redundancy Redundancy means ‘duplication of data’. This eliminates the replication of data item in different
files, extra processing required to face the data item from a large database. This also ensures data consistency and saves
the storage space.
2.Enforcing data integrity It means that the data contained in the database is accurate and consistent. Integrity constraints or
consistency rules can be applied to database, so that the correct data can be entered into the database.
3.Data sharing The data stored in the database can be shared among multiple users or application programs.
4.Data security The DBMS ensures that the access of database is done only through an authorized user.
5.Ease of application development The application programmer needs to develop the application programs according to the
user’s needs.
6.Backup and recovery The DBMS provides backup and recovery sub-system that is responsible to recover data from
hardware and software failures.
7.Multiple views of data A view may be the subset of database. Various users may have different views of the database
itself.
8.Enforced standards It can ensure that all the data follow the applicable standards.
9.Data independence System data descriptions are independent from the application programs.
Disadvantages of a Database/DBMS
There are many advantages of database, but database also have some minor disadvantages.
These disadvantages are as follows:
1.Cost of hardware and software Through the use of a database system, new costs are generated due to additional
hardware and software requirements.
3.Database failures If database is corrupted due to power failure or it is corrupted on the storage media, then our valuable
data may be lost or the system will stop working.
The key is defined as the column or the set of columns of the database table which is used to identify each record uniquely in a
relation, e.g. if a table has id, name and address as the column names then each one is known as the key for that table. The key
field is a unique identifier for each record, e.g. In Student table, you could use a combination of the lastname and firstname (or
perhaps lastname, firstname to ensure you to identify each student uniquely) as a key field.
Primary Key
A field or a set of fields that uniquely identify each record in a table is known as a primary key. Each relation has at least one
column for which each row that must have a unique value. Only one column attributes can be defined as a primary key for each
table.
A primary key must possess the following properties:
e.g. In the Student table, student works as a primary key because it contains Ids which are unique for each student.
Candidate Key
The set of all attributes which can uniquely identify each tuple of a relation are known as candidate keys. 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.
e.g. Column student and the combination of firstname and lastname work as the candidate keys for the Student table.
A candidate key must possess the following properties:
•For each row, the value of the key must uniquely identify that row.
•No attribute in the key can be discarded without destroying the property of unique identification.
Alternate Key
From the set of candidate keys after selecting one of the key as a primary key, all other remaining keys are known as alternate
keys.
e.g. From the candidate keys (student, firstname and lastname), if student is chosen as a primary key, then the firstname and
lastname columns work as alternate keys.
Foreign key
A field of a table (relation) that references the primary key of another table is referred to as foreign key. 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. Foreign keys play an essential role in database design, when tables are broken apart, then foreign keys
make it possible for them to be reconstructed.
e.g. column of Student table (reference table) works as a foreign key as well as a primary key for Course table (referenced table).
There are several popular RDBMS applications like microsoft access,open office base.Here we shall use libre office base open
source database applications.
1. Open libre office and select base database from the sidebar
3. In the database wizard dialogue box select create a new database option
4. Click next
2. As you choose to create a table using Design view, the design view window opens.
3. Under field name specify the names of the fields that make the Table
1. Click on Table object > Select Use Wizard to create table in Tasks pans.
2. In the Table wizard select a sample table and add desired fields. Click next button.
1. One to many : This means one record in one table has many matching records in the other
related table.
2. One to One : This means one record in one table has one matching records in the other related
table.
3. Many to Many : This means many record in one table has many matching records in the other
related table.
1. Select Query object an click on Use Wizard to create Query option in Tasks pane.
2. select the desired table in the forst step of Query wizard and add desired fields in the Query.
1. Click on Queries object and Select Create Query in Design view option in tasks pane and desired table.
2. Fill all the required data and click on finish.
Select Create Query in Sql View option in the tasks of Query object. In SQL View, type:
Top of page
Top of page
Top of page
1.Select Date from the First joined subform field dropdown list. This is the Date field in the Fuel table. This is not the
Primary key for the Fuel table, but it is known as a Foreign key.
2.Select Date from the First joined main form field dropdown list. This is the Date field in the Vacations table. This is the
Primary key for the Vacations table. Click Next .
It is possible to create a relationship between two tables that is based upon more than one pair of
fields. How to do that and why is discussed in the Base Guide (not yet written).
When selecting a pair of fields from two tables to use as a relationship, they have to have the same
field type. That is why we used the Date field from both tables: both their field types are
Date[DATE].
Whether a single pair of fields from two tables are chosen as the relationship or two or more pairs
are chosen, certain requirements must be met for the form to work.
• No field from the subform can be the Primary key for its table. (FuelID cannot be used.)
• Each pair of joined fields must have the same file type.
• One of the fields from the main form must be the Primary key for its table. (Date would have to
be used.)
Top of page
Step 5: Arrange controls.
Each control in a form consists of two parts: label and field. This step in creating the form determine
where a control's label and field are placed in relationship with each other. The four choices from
left to right are Columnar left, Columnar - Labels on top, As Data Sheet, and In Blocks - Labels
Above (Figure 25).
1.Arrangement of the main form: Click Columnar - Labels on top. (The labels will be placed above their field.
2.Arrangement of the subform: Click As Data Sheet. (The labels are column headings and the field entries are in
spreadsheet format.) Click Next .
Top of page
Top of page
Creating report
Step 1
In this step you select the Table Fields that you want the report to contain. In
this example we select the Title, Author and PublishingDate fields.
Step 2
The report generates a label for each field. By default Base chooses the field
name for the label name. In our example we change the "PublishingDate" field
to "Publishing Date".
Step 3
As with queries, the results in reports can be sorted. By default results are
sorted by the group field (Author). You can specify more levels of sorting.
Leave the default values.
Step 5
In this step we choose the Layout for the data and the headers and footers of
the report. Click on the available options to preview each layout.
Step 6