Introduction To DBMS: 1.1 What Is DATA ?
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.
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.
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.
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".
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.
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