Dbms Practical File

Download as docx, pdf, or txt
Download as docx, pdf, or txt
You are on page 1of 20

PRACTICAL FILE OF

DATABASE MANAGEMENT SYSTEM

BACHELOR OF BUSINESS ADMINISTRATION


(2019-2022)

MERI COLLEGE OF ENGINEERING AND


TECHNOLOGY, (SAMPLA)

MERI
COLLEGE

SUBMITTED TO -
SUBMITTED BY –

Ms. SHEETAL ARJUN


(ASSISTANT PROFESSOR) BBA 4th
Semester

ROLL
NO: - BBA/19/88

SECTION - B

INDEX

Serial Date Practical Topic Sign.


No.
1. 21-05-21 To Study Advantages and
Disadvantages of DBMS

2. 22-05-21 Introduction to MS Access

3. 23-05-21 Introduction to SQL


PRACTICAL-1

AIM: - To study advantages and disadvantages of


“DBMS”.

DATABASE MANAGEMENT SYSTEM (DBMS):


A database management system is a software that enables
users to interact with the database. It enables users to store,
modify and extract information from a database as per the
requirements.

It is an intermediate layer between user programs and the


data. User programs access the DBMS which then accesses
the data. It controls the creation, maintenance and utilization
of the databases of an organisation.

Thus, a DBMS is a collection of a database which acts as a


single centralized databank for the various data processing
applications and programs for management of the database.
A DBMS has many uses:
1. It enables users to access and manipulates the
database.
2. It provides a building block in constructing data
processing systems for applications requiring database
access- MIS or systems for accounting, production and
inventory control or customer support.
3. It helps the DBA to perform certain managerial duties.

Advantage of DBMS:
1. Improved data sharing:

 The DBMS helps create an environment in which end


users have better access to more and better-managed
data.
 Such access makes it possible for end users to respond
quickly to changes in their environment.

2. Improved data security:

 The more users access the data, the greater the risks of
data security breaches. Corporations invest considerable
amounts of time, effort, and money to ensure that
corporate data are used properly.
 A DBMS provides a framework for better enforcement of
data privacy and security policies.

3. Better data integration:

 Wider access to well-managed data promotes an


integrated view of the organization’s operations and a
clearer view of the big picture.
 It becomes much easier to see how actions in one
segment of the company affect other segments.
4. Minimized data inconsistency:

 Data inconsistency exists when different versions of the


same data appear in different places.
 For example, data inconsistency exists when a
company’s sales department stores a sales
representative’s name as “Bill Brown” and the
company’s personnel department stores that same
person’s name as “William G. Brown,” or when the
company’s regional sales office shows the price of a
product as $45.95 and its national sales office shows the
same product’s price as $43.95.
 The probability of data inconsistency is greatly reduced
in a properly designed database.

5. Improved data access:

 The DBMS makes it possible to produce quick answers


to ad hoc queries.
 From a database perspective, a query is a specific
request issued to the DBMS for data manipulation—for
example, to read or update the data. Simply put, a
query is a question, and an ad hoc query is a spur-of-
the-moment question.
 The DBMS sends back an answer (called the query result
set) to the application.
 For example, end users

6. Improved decision making:

 Better-managed data and improved data access make it


possible to generate better-quality information, on
which better decisions are based.
 The quality of the information generated depends on the
quality of the underlying data.
 Data quality is a comprehensive approach to promoting
the accuracy, validity, and timeliness of the data. While
the DBMS does not guarantee data quality, it provides a
framework to facilitate data quality initiatives.
 Increased end-user productivity
 The availability of data, combined with the tools that
transform data into usable information, empowers end
users to make quick, informed decisions that can make
the difference between success and failure in the global
economy.

Disadvantage of DBMS:
1. Increased costs:

 Database systems require sophisticated hardware and


software and highly skilled personnel.
 The cost of maintaining the hardware, software, and
personnel required to operate and manage a database
system can be substantial. Training, licensing, and
regulation compliance costs are often overlooked when
database systems are implemented.

2. Management complexity:

 Database systems interface with many different


technologies and have a significant impact on a
company’s resources and culture.
 The changes introduced by the adoption of a database
system must be properly managed to ensure that they
help advance the company’s objectives. Given the fact
that database systems hold crucial company data that
are accessed from multiple sources, security issues must
be assessed constantly.

3. Maintaining currency:

 To maximize the efficiency of the database system, you


must keep your system current.
 Therefore, you must perform frequent updates and
apply the latest patches and security measures to all
components.
 Because database technology advances rapidly,
personnel training costs tend to be significant. Vendor
dependence.
 Given the heavy investment in technology and personnel
training, companies might be reluctant to change
database vendors.

4. Frequent upgrade/replacement cycles:

 DBMS vendors frequently upgrade their products by


adding new functionality. Such new features often come
bundled in new upgrade versions of the software.
 Some of these versions require hardware upgrades. Not
only do the upgrades themselves cost money, but it also
costs money to train database users and administrators
to properly use and manage the new features.

PRACTICAL-2

AIM: - Introduction to MS Access.

What is MS Access?
Microsoft Access is a database management system
(DBMS) that combines the relational Microsoft Jet
Database Engine with a graphical user interface and
software-development tools.

Home Page of MS Access:

What are the uses of MS Access?


MS Access can be used to develop application software
and is generally used by data architects,
software developers and power users. Following are the
major uses of MS Access:

 Manage accounts and bills


 Store data in the form of tables and edit or customise
them later as per the requirement of the user
 It can be used to make our websites
 Comparing data or finding a relationship between the
existing data can be done using Access
Datasheet of Ms Access:-

What are the major components of MS


Access?
The major components of MS Access are as follows:

 Tables
 Queries
 Relationships
 Macros
 Forms
 Reports

How many types of databases are there in


MS Access?
There are two types of database in MS Access:

 Flat File Database: When the data is stored in


the form of a plain text file and cannot incorporate
multiple tables. 
 Relational Database: When the data is stored in
a form that the data items are related to one another.
It supports multiple tables which organise the text in
rows and columns.

Components of MS Access:
The main usage of MS Access is for accounting. Since it
is Microsoft’s primary accounting database, it can be
used to manage invoice/bills, manage accounts, keep an
eye on credit and debit, etc. 

When we create a document of Access, data can be


stored and accessed easily through multiple
components. There are seven major components of MS
Access database. Discuss below are the same in brief:

 Tables: A table in Access is similar to any other


tabulated data in the form of rows and columns.
However, when adding data to a program to create
a table, all the information entered must be correct
as if any incorrect data is entered the processing
may become slow or may not give the correct
answer. The appearance of the table may look
similar to the one formed in Excel with column
heading and titles.
 Queries: Once a table is created and the user or
programmer is looking for a calculated output, then
it is called queries. This may include filtering,
calculating, sorting, updating, etc.
 Relationships: As the name suggests, when
more than one table is added, the relation or
connection between them can be achieved. There
three ways in which the connection between the
tables can be determined:

1. One to one
2. One to Many
3. Many to Many

 Macros: The tool using which predefined actions


which can automate tasks on an Access report is
called macros. Multiple tasks can be assigned and
they will function whenever the macros option is
selected on a report
 Forms: A user interface for a database application
can be created using forms. Forms can further be
divided into two: bound and unbound forms
 Report: Once all the information is entered into
the database, it can be reviewed or analysed using
a report. A report can then be customised or
modified as per the user’s requirement
 Module: This allows a set of pre-defined
instructions to be created by a programmer in the
database. They can be used throughout the
databas

Benefits and Limitations of using MS Access:


It was Microsoft’s first database software, and came
along with a lot of advantages and convenience for its
users. At the same time, there were limitations to it.
Discussed below are the benefits and limitations which
came along with MS Access usage.
Benefits:
 Easy to create database within lesser time duration
 Used a very comprehensive programming language
which made it user friendly
 With each revised version, new options and
features were made available to the users for their
convenience
 It is easy to install and then easy to understand its
working
 Importing data was easy
 Graphical user interface made it easy to use

Limitations:
 Not too many people can use the same database at
a single time. This may affect its speed and
efficiency
 The same database was tough to use with different
Operating systems
 Better database systems can be used for
confidential data

PRACTICAL –3
AIM:- To study about SQL

STRUCTURED QUERY LANGUAGE (SQL):

SQL stands for Structured Query Language and it is an ANSI


standard computer language for accessing and manipulating
database systems. It is used for managing data in relational
database management system which stores data in the form
of tables and relationship between data is also stored in the
form of tables. SQL statements are used to retrieve and
update data in a database.

TYPES OF STRUCTURED QUERY LANGUAGE:

1. Data Definition Language (DDL)


DDL changes the structure of the table like creating a table,
deleting a table, altering a table, etc.All the command of DDL
are auto-committed that means it permanently save all the
changes in the database.

Here are some commands that come under DDL:


 CREATE

 ALTER

 DROP

 TRUNCATE

(a) CREATE:- It is used to create a new table in the


database.

Syntax:- CREATE TABLE TABLE_NAME (COLUMN_NAME


DATATYPES[,....]);

Example:- CREATE TABLE EMPLOYEE(Name


VARCHAR2(20), Email VARCHAR2(100), DOB DATE);

(b) DROP:- It is used to delete both the structure and


record stored in the table.

Syntax:- DROP TABLE ;

Example:- DROP TABLE EMPLOYEE;

(c) ALTER:- It is used to alter the structure of the


database. This change could be either to modify the
characteristics of an existing attribute or probably to add a
new attribute.

Syntax:- To add a new column in the table ALTER TABLE


table_name ADD column_name COLUMN-definition; To
modify existing column in the table: ALTER TABLE
MODIFY(COLUMN DEFINITION....);
EXAMPLE:- ALTER TABLE STU_DETAILS ADD(ADDRESS
VARCHAR2(20)); ALTER TABLE STU_DETAILS MODIFY
(NAME VARCHAR2(20));

(d) TRUNCATE:- It is used to delete all the rows from the


table and free the space containing the table.

Syntax:- TRUNCATE TABLE table_name;

Example:- TRUNCATE TABLE EMPLOYEE;

2. Data Manipulation Language


DML commands are used to modify the database. It is
responsible for all form of changes in the database. The
command of DML is not auto-committed that means it can't
permanently save all the changes in the database. They can
be rollback.

Here are some commands that come under DML:

 INSERT
 UPDATE
 DELETE

(a) INSERT:- The INSERT statement is a SQL query. It is


used to insert data into the row of a table.

Syntax:- INSERT INTO TABLE_NAME (col1, col2, col3,.... col


N) VALUES (value1, value2, value3, .... valueN); Or INSERT
INTO TABLE_NAME VALUES (value1, value2, value3, ....
valueN);

example:- INSERT INTO javatpoint (Author, Subject)


VALUES ("Sonoo", "DBMS");

(b) UPDATE:- This command is used to update or modify


the value of a column in the table.
Syntax:- UPDATE table_name SET [column_name1=
value1,...column_nameN = valueN] [WHERE CONDITION]

example:- UPDATE students SET User_Name = 'Sonoo'


WHERE Student_Id = '3'

(c) DELETE:- It is used to remove one or more row from a


table.

Syntax:- DELETE FROM table_name [WHERE condition];

example:- DELETE FROM javatpoint WHERE


Author="Sonoo";

3. Data Control Language


DCL commands are used to grant and take back authority
from any database user.

Here are some commands that come under DCL:

 Grant
 Revoke

(a) Grant:- It is used to give user access privileges to a


database.

Example:- GRANT SELECT, UPDATE ON MY_TABLE TO


SOME_USER, ANOTHER_USER;

(b) Revoke: - It is used to take back permissions from the


user.

Example:- REVOKE SELECT, UPDATE ON MY_TABLE FROM


USER1, USER2;

4. Data Query Language


DQL is used to fetch the data from the database. It uses only
one command:
(a) SELECT:- This is the same as the projection operation
of relational algebra. It is used to select the attribute based
on the condition described by WHERE clause.

Syntax:- SELECT expressions FROM TABLES WHERE


conditions;

example:- SELECT emp_name FROM employee


WHERE age > 20;

5. Transaction Control Language


TCL commands can only use with DML commands like
INSERT, DELETE and UPDATE only. These operations are
automatically committed in the database that's why they
cannot be used while creating tables or dropping them.

Here are some commands that come under TCL:

 COMMIT
 ROLLBACK
 SAVEPOINT

(a) Commit:- Commit command is used to save all the


transactions to the database.

Syntax:- COMMIT;

Example:- DELETE FROM CUSTOMERS WHERE AGE = 25;


COMMIT;

(b) Rollback:- Rollback command is used to undo


transactions that have not already been saved to the
database.

Syntax:- ROLLBACK;

Example:- DELETE FROM CUSTOMERS WHERE AGE = 25;


ROLLBACK;
(c) SAVEPOINT:- It is used to roll the transaction back to
a certain point without rolling back the entire transaction.

Syntax:-SAVEPOINT SAVEPOINT_NAME;

FEATURES OF SQL:

 Data Definition language (DDL): It contains of


commands which defines the data
 Data Manipulation Language (DML): Data
Manipulation Language contains commands used to
manipulate the data.
 Triggers: Triggers are actions performed when certain
conditions are met on the data. A trigger contains of
three parts:
 Event – The change in the database that activates
the trigger is event.
 Condition – A query or test that is run when the
trigger is activated.
 Action – A procedure that is executed when trigger
is activated and the condition met is true.

 Client server execution and remote


database access: Client server technology
maintains a many to one relationship of clients (many)
and server (one). We have commands in SQL that
control how a client application can access the database
over a network.

 Security and authentication : SQL provides a


mechanism to control the database meaning it makes
sure that only the particular details of the database is
to be shown the user and the original database is
secured by DBMS.
 Embedded SQL: SQL provides the feature of
embedding host languages such as C, COBOL, and Java
for query from their language at runtime.

 Transaction Control Language:


Transactions are an important element of DBMS and to
control the transactions, TCL is used which has
commands like commit, rollback and save point.

Advantages of SQL :

SQL has many advantages which makes it popular and


highly demanded. It is a reliable and efficient language
used for communicating with the database. Some
advantages of SQL are as follows:

 Faster Query Processing – Large amount of data


is retrieved quickly and efficiently. Operations like
Insertion, deletion, manipulation of data is also done in
almost no time.

 No Coding Skills –For data retrieval, large number


of lines of code is not required. All basic keywords such
as SELECT, INSERT INTO, UPDATE, etc are used and
also the syntactical rules are not complex in SQL, which
makes it a user-friendly language.language

 Standardized Language – Due to documentation


and long establishment over years, it provides a uniform
platform worldwide to all its users.

 Portable – It can be used in programs in PCs, server,


laptops independent of any platform (Operating System,
etc). Also, it can be embedded with other applications as
per need/requirement/use.
 Interactive Language – Easy to learn and
understand, answers to complex queries can be received
in seconds.

Disadvantages of SQL :

Although SQL has many advantages, still there are a few


disadvantages. Various Disadvantages of SQL are as follows:

 Complex Interface – SQL has a difficult interface that


makes few users uncomfortable while dealing with the
database.
 Cost – Some versions are costly and hence,
programmers cannot access it.
 Partial Control – Due to hidden business rules, complete
control is not given to the database.

SQL Commands:

 SQL commands are instructions. It is used to


communicate with the database. It is also used to
perform specific tasks, and specific data.
 SQL can perform various tasks like create a table, add
data to tables, drop the table , modify the table , set
permission for users.

You might also like