DBMS PRG4 LAB
DBMS PRG4 LAB
MANIPULATION
DATE :
AIM:
To Query the database using SQL manipulation.
DML commands are the most frequently used SQL commands and is used to query and manipulate the
existing database objects. Some of the commands are.
1. INSERT
This is used to add one or more rows to a table. The values are separated by commas and the data
types char and date are enclosed in apostrophes. The values must be entered in the same order as they are
defined.
2. SELECT
It is used to retrieve information from the table.it is generally referred to as querying the table.
We can either display all columns in a table or only specify column from the table.
3. UPDATE
It is used to alter the column values in a table. A single column may be updated or more than one
column could be updated.
4. DELETE
After inserting row in a table we can also delete them if required. The delete command consists
of a from clause followed by an optional where clause
PROCEDURE
1. INSERT COMMAND
Example:
SQL> INSERT INTO students VALUES('Ram',25,'Male','Salem','9874563210');
(c) Inserting more than one record using a single insert commands:
Syntax:
insert into <table name> values (&col1, &col2, ….),(&col1,&col2),….
Example
SQL> INSERT INTO students (name, age, gender, city, contact) VALUES
('Ravi',23,'Male','Namakkal','9876543210'),('Sara',23,'Female','Erode','9874521360');
Example:
SQL> select *from students;
4. DELETE COMMAND
Example:
DELETE FROM students WHERE id=3;
RESULT:
The DML commands are executed successfully.