You are on page 1of 51

PRACTICAL FILE

In partial fulfilments for the award of the degree of Bachelor of Business


Administration (BBA Batch 2016-2019) of

Guru Gobind Singh Indraprastha University

Under the Guidance of: Submitted By:

Mr. Shailendra Kumar Aashish gupta


(Assistant Professor
Of IT)
(Faculty Guide)
ACKNOWLEDGEMENT

I would like to express my deepest gratitude to many people who


contributed in the making of this practical file and to Mr.
SHAILENDRA KUMAR (Faculty Guide) for the special mention who
holds the attitude of substance and Genius: who continually and
convincingly conveyed the spirit of adventure in the making of the
practical file. I would like to extend my gratitude to the entire Faculty
of the BBA Department of the New Delhi Institute of Management
for their Continuous support and Cooperation and acting as a guide
at each stage of the making of the Practical file.

The Experience that I gained through this project is of immense


importance not only academically but also professionally. Indeed I
will remain Grateful to all of them.

Signature of student:-
This is to certify that AASHISH GUPTA of BBA (2nd Semester) has
successfully completed the practical file in the specified period of
time.
They have given full justice to the work that was assigned to him.
We wish him all the best for the future endeavours.

Mr. Shailendra Yadav


(Faculty Guide)
Index

S.N Practical Name Sig


o. n

1 Intoduction to DBMS

2 Functions performed by DBMS

3 Advantages and Disadvantages of DBMS

4 Steps to create a Database

5 Steps to create a table in MS-ACCESS

6 Create a Database for an Organisation

7 Create following 4 tables in a database(name your database as a


company)

EMPLOYEE

Fields – name, Id(primary key), age, destination, date of birth,


department, salary, dependents, date of joining

DEPARTMENTS

Fields - department number (primary key), name, number of


managers, number of employees
PROJECT

Fields – project number (primary key), project_Name ,


project_location , Department_number.

DEPARTMENT LOCATION TABLE

Fields – Department number (primary key), Department


location

 create two relationships b/w tables . present them in


database
Create the following queries:-

 show one query using design view and other making use
of wizard

Find name and EMP id of that Employee who works for


Department number.

Create a query to find name and address of those employees


whose salaries are:-

1) Greater than $ 60,000


2) Less than $ 60,000
Create a query to find name and salary of all employees whose
name begins with letter R

Query to list name, designation and salary of all Employees who


work for finance Department.

Find information (project number, dept_no) for every project


located in delhi.

Select employees working in HR Department and sort the result


by employee name.

Count the number of employees in sales department and there


average salary.

Change the name of HR to “HUMAN RESOURCE” department.

Give introduction of form for PRODUCT table using the Form


wizard with the help of snapshots.

Make a form for entering employee detail with form design


view using these tools (label, textbox, check list, list box,
image).

Explain the use of Report in a DBMS and give steps for creating a
“REPORT” from the employee table through report wizard ?

Define different types of queries with example of each ?


<Simple query> , <Action query> , <crosstab query> etc.

List differences b/w design view , database view , form view ,


lay out view and wizard ?
1. INTRODUCTION TO DBMS

What is database?
A database is an integrated and logically coherent collection of
related records and files. Where each data element is with
some inherent meaning to facilitate rapid updating of individual
records,concurrent updating of related records, easy access to
all records by all application programs, generating routine or
special purpose reports.
What is database management system?
A database management system is a collection of programs that
enables users to create and maintain a database. Defining a
database involves specifying the data types, structures, and
constraints for the data to be stored in a database. It is a set of
programs that enables storing, modifying, and extracting
information from a database, it also provides users to add,
delete, access, modify, and analyse data stored in Database.
Examples : Access and FoxPro from Microsoft, Oracle,
Informix, Lotus Approach, etc.
2. FUNCTIONS PERFORMED BY DBMS :
1. Data Definition :
The DBMS provides functions to define the structure of the data
in the application. These include defining and modifying the
record structure, the type and size of fields and the various
constraints to be satisfied by the data in each field.

2. Data Manipulation :
Once the data structure is defined, data needs to be inserted,
modified or deleted. The functions which perform these
operations are also part of the DBMS.

3. Data Security and Integrity :


The DBMS contains functions which handle the security and
integrity of data in the application.

4. Data Recovery and Concurrency :


Recovery of data after a system failure and concurrent access of
records by multiple users are also handled by the DBMS.

5. Data Dictionary Maintenance :


Maintaining the Data Dictionary which contains the Data
Dictionary which contains the data definition of the application is
also one of the functions of a DBMS.

3. ADVANTAGES OF DBMS :

1. Minimal Data Redundancy :


Since the whole data resides in one central database, the
various programs in the application can access data in different
data files. Hence data present in one file need not be
duplicated in another. This reduces data redundancy.

2. Data Consistency :
Reduces data redundancy leads to better data consistency
because data duplication is not there while using database
approach.

3. Data Integrity :
Integrity means prevention of unauthorised modification of
information. Since related data is stored in one single database,
enforcing data integrity is much easier.

4. Improved Backup and Recovery Services :


DBMS provides facilities for recovering from hardware or
software failures through through its back up and recovery
subsystem.

5. Reduced Maintenance :
Due to the centralizes nature of the system, maintenance cost
of DBMS is less and easy.

6. Improved Data Quality :


The database system provides a number of tools and processes
to improve data quality.

7. Application Development Ease :


The application programmer need not build the functions for
handling issues like concurrent access, security, data integrity,
etc.

8. Improved Data Sharing :


Existing application programs can share the data in the
database. Furthermore , new application programs can share
be developed on the existing data in the database to share the
same data and add only that data that is not currently stored,
rather having to define all data requirements again.

9. Improved Security :
Database security is the protection of database from
unauthorized users. The database administrator (DBA)
ensures that proper access procedure is followed, including
proper authentication schemes for access to the DBMS and
additional checks before permitting access to sensitive data.

DISADVANTAGES OF DBMS :
1. Increased Complexity :
A multi-user DBMS becomes an extremely complex piece
of software due to expected functionality from it.

2. Requirement of New and Specialized Manpower :


Because of rapid changes in database technology and
organization’s business needs, the organisation’s need to
hire, train or retrain its manpower on regular basis to design
and implement databases, provide database administration
services and manage a staff of new people.

3. Large Size of DBMS :


The large complexity and wide functionality makes the
DBMS an extremely large piece of software. It occupies
many gigabytes of storage disk space and requires
substantial amounts of main memory to run efficiently.

4. Increased Installation and Management Cost :


The large and complex DBMS software has a high initial-
cost. It requires trained manpower to install and operate
and also has substantial annual maintenance and support
costs.

5. Additional Hardware Cost :


The cost of DBMS installation varies significantly,
depending on the environment and functionality, size of the
hardware( eg: micro-computer, mini-computer) and the
recurring annual maintenance cost of hardware and
software.

6. Need for Explicit Backup and Recovery :


For a centralized shared database to be accurate and
available all times, a comprehensive procedure is required
to be developed and used for providing backup copies of
data and for restoring a database when damage occurs.

7. Organizational Conflict :
A centralized and shared database requires a consensus on
data definitions and ownership as well as responsibilities for
accurate data maintenance. As per past history and
experience, sometimes there are conflicts on data
definitions, data formats and coding, rights to update shared
data, and associated issues, which are frequent and often
difficult to resolve.

4. Steps to create a Database :

STEP 1 : Firstly click on Microsoft Access and open it


STEP 2 : Now the "New File" side bar will be displayed on the right-
hand side of the screen
STEP 3: Then click on the option "Blank database...", which will
then ask you to name your database.
STEP 4 : Name your file (we chose DBMS Project) and press
Create. This will automatically save your blank database.

STEP 5 : After clicking on create, the Access Database interface will


be displayed.
5. Steps to create table in MS-ACCESS .

STEP 1 : Click on the table tab , given in the create column.


STEP 2 : Then create the table using “DESIGN VIEW”
STEP 3 : Once the details are filled in the table , then save the
table by clicking on the close button on top right side corner.

STEP 4 : Now create PRIMARY KEY and save the table by


giving it a name.
STEP 5 : After the table has been saved, now you can start
entering the data.
6. CREATE DATABASE FOR AN
ORGANISTAION :
7. DATABASE OF A COMPANY :

 EMPLOYEE TABLE :
 DEPARTMENT TABLE :

 PROJECT TABLE :
 DEPARTMENT LOCATION TABLE :

QUERIES :
 RELATIONSHIP BETWEEN 2 TABLES :
 TABLE THROUGH DESIGN VIEW :

SQL VIEW :
 TABLE THROUGH QUERY WIZARD :

SQL VIEW :
 QUERY OF EMPLOYEES HAVING SALARY “GREAtER
than 60,000 :

Sql view
 QUERY OF EMPLOYEES HAVING SALARY “LESS tHAN
60,000 :

Sql view :
 QUERY TO FIND NAME & SALARY OF EMPLOYEES
STARTING WITH LETTER r :

SQL VIEW :

 Query to list name, designation and salary of


employees working in finance department :
SQL VIEW :

 INFORMATION FOR EVERY PROJECT LOCATED IN


DELHI :
SQL VIEW :
 QUERY FOR EMPLOYEES IN HR DEPARTMENT :

SQL VIEW :
 NO. OF EMPLOYEES IN SALES DEPARTMENT AND
THEIR AVERAGE SALARY :

Sql view :
 CHANGE NAME OF HR tO ‘HUMAN RESOURCE’ :
Introduction of form object :
A form is a database object that you can use to create a user interface for
a database application. A "bound" form is one that is directly connected to
a data source such as a table or query, and can be used to enter, edit, or
display data from that data source. Alternatively, you can create an
"unbound" form that does not link directly to a data source, but which still
contains command buttons, labels, or other controls that you need to
operate your application.

 PRODUCT TABLEE USING WIZARD :

STEP 1 : After entering data in the PRODUCT table, click on


create on the top and then select more forms. Select wizard form.
STEP 2 : After the first step, a small window will be displayed. Here we
can add fields of the PRODUCT table to have that particular field in
our form.

STEP 3 : After the second step, a no. of option will come in the
form of process. After the selection of one of the options, then click
on next.
STEP 4 : After third step we will finalise from the options and
then click on finish. The form page will occur.
INTRODUCTION OF REPORT :

A REPORT IS A WAY TO DISPLAY DATA FROM A QUERY


OR TABLE IN AN APPEALING WAY. THE REPORT YOU
PRODUCED PRESENTS THE DATA IN AN ORGANISED
MANNER; THE FORMAT IS VERY RIGID. YOU CANNOT
SELECT THE FIELDS TO DISPLAY , FOR EXAMPLE; THE
REPORT AUTOMATICALLY INCLUDES ALL THE FIELDS
AND THEY DISPLAY IN PRECISELY THE SAME ORDER AS
IN THE TABLE. THERE IS NO WAY TO CHANGE THE
TITLE, WHICH WILL AUTOMATICALLY BE THE SAME AS
THE NAME OF THE TABLE.
THE PORTION AT THE TOP OF THE REPORT CALLED
PAGE HEADER, CONTAINS A CUSTOM TITLE. THE
CONTENTS OF THIS PAGE HEADER DISPLAY AT THE TOP
OF EACH PAGE. THE DETAIL LINES, WHICH ARE THE
LINES THAT ARE PRINTED FOR EACH RECORD, CONTAIN
ONLY THOSE FIELDS YOU SPECIFY AND IN THE ORDER
YOU SPECIFY.
A REPORT CONSISTS OF INFORMATION THAT IS PULLED
FROM TABLE OR QUERIES. THE TABLE OR QUERIES
THAT PROVIDE THE UNDERLYING DATA ARE ALSO
KNOWN AS THE REPORT’S RECORD SOURCE. A REPORT
REPRESENTS THE DATA IN AN ORGANISED MANNER.
AN ACCESS DATABASE OBJECTS THAT YOU CAN PRINT
CONTAINING INFORMATION THAT IS FORMATTED AND
ORGANISED ACCORDING TO YOUR SPECIFICATIONS.
EXAMPLES OF REPORTS ARE SALES SUMMARIES, PHONE
LISTS AND MAILING LABELS.
 STEPS TO CREATE A REPORT THROUGH WIZARD IN
MS- ACCESS:

Step 1 : After entering data in the table, click on create on the


top and then select report wizard, a small box will be displayed.
STEP 2 : On above window we can add fields of both the
table to have that particular fields only in our report . On
clicking next, other wizard option displayed.
STEP 3 : Now sort the records by setting in ascending or descending
order and after clicking on next selection layout will appear.
STEP 4 : Then after selecting certain options, then click on finish and
then form will appear.
 THEORY :
DEFINE DIFFERENT TYPES OF QUERIES WITH EXAMPLE OF
EACH :
A query is a way of asking questions about data stored in your tables.
Your query design tells Access exactly which data to retrieve. Queries
allow you to look at selected data from one or more tables without
viewing all of the fields in each table and without having to save all of your
data over again. Queries make it easy for you to combine two or more
table fields into a single field, to summarize data, to use criteria to select
and sort data, and to add, update or delete large groups of records. The
only parts of a query that Access stores are its design parameters. The
data displayed in a query are called a dyna set (dynamic dataset)
or record set. Unless you design the query to save the dyna set as a new
table or part of an existing table, Access will not store it.
 Select Query
The select query is the simplest type of query and because of that, it is also the
most commonly used one in Microsoft Access databases. It can be used to select
and display data from either one table or a series of them depending on what is
needed.
In the end, it is the user-determined criteria that tells the database what the
selection is to be based on. After the select query is called, it creates a "virtual"
table where the data can be changed, but at no more than one record at a time.
example : SELECT * From Customer
the above example will select all records from Customer table.
 Action Query
When the action query is called, the database undergoes a specific action
depending on what was specified in the query itself. This can include such things
as creating new tables, deleting rows from existing ones and updating records
or creating entirely new ones.
Action queries are very popular in data management because they allow for
many records to be changed at one time instead of only single records like in a
select query.
Four kinds of action queries are:
1.Append Query – takes the set results of a query and "appends" (or adds) them
to an existing table.
2.Delete Query – deletes all records in an underlying table from the set results
of a query.
3.Make Table Query – as the name suggests, it creates a table based on the set
results of a query.
4. Update Query – allows for one or more field in your table to be updated.

 Parameter Query
In Microsoft Access, a parameter query works with other types of queries to
get whatever results you are after. This is because, when using this type of
query, you are able to pass a parameter to a different query, such as an action
or a select query. It can either be a value or a condition and will essentially tell
the other query specifically what you want it to do.
It is often chosen because it allows for a dialog box where the end user can
enter whatever parameter value they wish each time the query is run. The
parameter query is just a modified select query.

 Aggregate Query
A special type of query is known as an aggregate query. It can work on other
queries (such as selection, action or parameter) just like the parameter query
does, but instead of passing a parameter to another query it totals up the items
by selected groups.
It essentially creates a summation of any selected attribute in your table. This
can be further generated into statistical amounts such as averages and
standard deviation, just to name a couple.

DIFFERENT TYPES OF VIEWS IN MS-ACCESS:

DESIGN VIEW: Design view gives you a more detailed


view of the structure of the form. You can see the
Header, Detail, and Footer sections for the form. You
cannot see the underlying data while you are making
design changes; however, there are certain tasks you
can perform more easily in Design view than in Layout
view .Design view allows you to create or change the
table, form, or other database object, and configure
the fields. You can also set keys and restrict the
values entered here. But you can't change the
database data in design view. Design view enables you
to design and set up your database (kind of a "behind
the scenes" view of your database). This is where you
set up and configure your tables, forms, reports, etc.

DATASHEET VIEW: Datasheet view shows the data in


the database. It also allows you to enter and edit the
data. It does not let you change the format of the
database, other than minor changes (such as displayed
column widths).
FORM VIEW: A form is a database object that you can
use to create a user interface for a database
application. A "bound" form is one that is directly
connected to a data source such as a table or query,
and can be used to enter, edit, or display data from
that data source. Alternatively, you can create an
"unbound" form that does not link directly to a data
source, but which still contains command buttons, labels,
or other controls that you need to operate your
application.

LAYOUT VIEW: Layout view is a more visually-oriented


view than Design view. While viewing a form in Layout
view, each control displays real data. As a result, this is
a very useful view for setting the size of controls, or
performing many other tasks that affect the visual
appearance and usability of the form.
Certain tasks cannot be performed in Layout view and
require switching to Design view. In certain situations,
Access displays a message telling you that you must
switch to Design view to make a particular change.

WIZARD VIEW: A wizard is a computer utility designed


to simplify the execution of lengthy or
complicated tasks. In a graphical user interface (GUI), a
wizard consists of a sequence of menus through which
the user navigates in order to achieve a specific
objective such as copying files and folders from a hard
disk to a CD-R or CD-RW. In computing and Internet
applications, the term wizard is sometimes used in
reference to a human hacker or expert user. Wizards
are often specialists. A person who is a wizard in a
single field such as UNIX programming may lack
knowledge in other fields such as hardware engineering.
In general usage, a wizard is a person who has such
exceptional knowledge or expertise in a certain field that
he or she appears to possess almost supernatural ability.
DATABASE LANGUAGE :

A DBMS must provide appropriate languages and interfaces for each


category of users to express database queries and updates. Database
Languages are used to create and maintain database on computer.
There are large numbers of database languages like Oracle, MySQL,
MS Access, dBase, FoxPro etc. SQL statements commonly used in
Oracle and MS Access can be categorized as data definition language
(DDL), data control language (DCL) and data manipulation language
(DML).

Data Definition Language (DDL)


It is a language that allows the users to define
data and their relationship to other types of data. It
is mainly used to create files, databases, data
dictionary and tables within databases.
It is also used to specify the structure of each
table, set of associated values with each attribute,
integrity constraints, security and
authorization information for each table and
physical storage structure of each table on disk.
The following table gives an overview about usage
of DDL statements in SQL

Data Manipulation Language (DML)


It is a language that provides a set of operations
to support the basic data manipulation operations
on the data held in the databases. It allows users
to insert, update, delete and retrieve data from the
database. The part of DML that involves data
retrieval is called a query language.
The following table gives an overview about the
usage of DML statements in SQL:

Data Control Language (DCL)

DCL statements control access to data and the


database using statements such as GRANT and
REVOKE. A privilege can either be granted to a
User with the help of GRANT statement. The
privileges assigned can be SELECT, ALTER,
DELETE, EXECUTE, INSERT, INDEX etc. In addition
to granting of privileges, you can also revoke
(taken back) it by using REVOKE command.
The following table gives an overview about the
usage of DCL statements in SQL:
In practice, the data definition and data
manipulation languages are not two separate
languages. Instead they simply form parts of a
single database language such as Structured
Query Language (SQL). SQL represents
combination of DDL and DML, as well as
statements for constraints specification and
schema evaluation.

You might also like