Vous êtes sur la page 1sur 14

[1] INTRODUCTION TO DBMS

1.1 What is DATA ?

In computing, data is information that has been translated into a form that is efficient for
movement or processing. Relative to today's computers and transmission media, data is
information converted into binary digital form. It is acceptable for data to be used as a singular
subject or a plural subject. Raw data is a term used to describe data in its most basic digital
format.

1.2 Why do we need Data ?


If you want to understand database then don’t start with the features of database first, rather
you should go with other way round. Database are used to solve few problems. Now question
in your mind is that what kind of problems? Consider a scenario where you have some data like
a data related to customer, employee, banking etc. and you have to save the data in any type of
formats like text, images, numbers, dates, amounts, documents, audio or video etc. You can
store the data in text or excel spreadsheet. You can also use the folder structure to organize
your file. So why do you need the database? Many of the small businesses continue to using
Text files or Excel spreadsheets since long time. This setup might works good for few small
businesses, because just having data to store does not require database. So only having data is
not a problem here.

 Size of Data
 Ease of Updating Data
 Accuracy
 Security
 Redundancy
 Incomplete Data

1|P a g e
ROSHAN LAL DBMS LAB
1505413051 NCS 552
1.3 Why data should be organized ?
Once you create, gather, or start manipulating data and files, they can quickly become
disorganised. To save time and prevent errors later on, you and your colleagues should decide
how you will name and structure files and folders. Including documentation (or 'metadata') will
allow you to add context to your data so that you and others can understand it in the short,
medium, and long-term.

Below you can find some guidance on:

 Naming and organized file


 Documentation and Metadata
 Managing References
 Organizing E-mail

1.4 What is database ?


A database is an organized collection of data. It is the collection of schemas, tables, queries,
reports, views, and other objects. The data are typically organized to model aspects of reality in
a way that supports processes requiring information, such as modelling the availability of rooms
in hotels in a way that supports finding a hotel with vacancies.

A database management system (DBMS) is a computer software application that interacts with
the user, other applications, and the database itself to capture and analyze data. A general-
purpose DBMS is designed to allow the definition, creation, querying, update, and
administration of databases.

1.5 What is the difference between database and file system ?


Database Management System (DMS) is a combination of computer software, hardware, and
information designed to electronically manipulate data via computer processing. Two types of
database management systems are DBMS’s and FMS’s. In simple terms, a File Management
System (FMS) is a Database Management System that allows access to single files or tables at a
time. FMS’s accommodate flat files that have no relation to other files. The FMS was the
predecessor for the Database A Management System (DBMS), which allows access to multiple
files or tables at a time

In computing, a file system is used to control how data is stored and retrieved. Without a file
system, information placed in a storage medium would be one large body of data with no way
to tell where one piece of information stops and the next begins. By separating the data into

2|P a g e
ROSHAN LAL DBMS LAB
1505413051 NCS 552
pieces and giving each piece a name, the information is easily isolated and identified. Taking its
name from the way paper-based information systems are named, each group of data is called a
"file". The structure and logic rules used to manage the groups of information and their names
is called a "file system".

1.6 What is DBMS ?


The DBMS manages three important things: the data, the database engine that allows data to
be accessed, locked and modified -- and the database schema, which defines the database’s
logical structure. These three foundational elements help provide concurrency, security, data
integrity and uniform administration procedures. Typical database administration tasks
supported by the DBMS include change management, performance monitoring/tuning
and backup and recovery. Many database management systems are also responsible for
automated rollbacks, restarts and recovery as well as the logging and auditing of activity.

A database management system (DBMS) is system software for creating and


managing databases. The DBMS provides users and programmers with a systematic way to
create, retrieve, update and manage data.

1.7 What are the properties of DBMS?


 Sharing of Data
 Multi user transaction processes
 Support of multiple use of data
 Insulation between program and data
 Storage management

1.8 Explain different types of Database?

Relational databases
The data in this is stored in a various data tables. Hence all the tables are related to each other
through several key fields.
Operational databases
An operational database is usually hugely important to organizations as they include the details
of all the data exercised in the company like customer’s data, etc.
Distributed database
Each of the different workoffices situated in distant locations have their own database which
when combined together forms a distributed database.
End-user database
There is a variety of data available at the workstation of all the end users of any organization
which is termed as enduser databases.

3|P a g e
ROSHAN LAL DBMS LAB
1505413051 NCS 552
[3] DATA DEFINITION LANGUAGE STATEMENTS
3.1 CREATE TABLE STATEMENT
CREATE table command is used to specify a new relation by giving it a name and specifying its
attributes and constraints.

SYNTAX:
CREATE TABLE table_name (column 1 data_type1,column2
data_type2,………..columnNdata_type N);

4|P a g e
ROSHAN LAL DBMS LAB
1505413051 NCS 552
3.2 DESCRIBE
This statement is used to see the structure of the table.

SYNTAX:
DESCRIBE table_name;

5|P a g e
ROSHAN LAL DBMS LAB
1505413051 NCS 552
3.3 ALTER
ALTER command is use to change the structure of the table.

It includes following actions:

 ADD:

SYNTAX:
ALTER TABLEtable_name ADD((column 1 data_type1,column2
data_type2,………..columnNdata_type N);

6|P a g e
ROSHAN LAL DBMS LAB
1505413051 NCS 552
 MODIFY:
SYNTAX:
ALTER TABLEtable_name MODIFY((column 1 data_type1,column2
data_type2,………..columnNdata_type N);

7|P a g e
ROSHAN LAL DBMS LAB
1505413051 NCS 552
 DROP

SYNTAX:
ALTER TABLEtable_name DROP column column _name

8|P a g e
ROSHAN LAL DBMS LAB
1505413051 NCS 552
3.4 DROP
DROP table statement removes the table from the database. Database loses all the data in the
table .You cannot roll back this statement , as it is DDL statement, which is auto committed.

SYNTAX:
DROP TABLE table_name;

9|P a g e
ROSHAN LAL DBMS LAB
1505413051 NCS 552
3.5 RENAME
SYNTAX:
RENAME old_table_name to new_table_name;

10 | P a g e
ROSHAN LAL DBMS LAB
1505413051 NCS 552
3.6 TRUNCATE
It removes all the rows from a table and releases the storage space used by table and you
cannot roll it back.

SYNTAX:
TRUNCATE TABLE table_name;

11 | P a g e
ROSHAN LAL DBMS LAB
1505413051 NCS 552
[4] DATA MANIPULATION LANGUAGE STATEMENTS
4.1INSERT
It perform modification at row level. Only one row is inserted at a time.

SYNTAX 1:
INSERT INTO table_name (column 1 ,column2 ,………..columnN) VALUES
(val1,val2,……valN);

12 | P a g e
ROSHAN LAL DBMS LAB
1505413051 NCS 552
SYNTAX 2:
INSERT INTO table_nameVALUES (val1,val2,……valN);

13 | P a g e
ROSHAN LAL DBMS LAB
1505413051 NCS 552
 INSERTING ROWS WITH NULL VALUES

 EXPLICIT METHOD

 IMPLICIT METHOD

14 | P a g e
ROSHAN LAL DBMS LAB
1505413051 NCS 552

Vous aimerez peut-être aussi