0% found this document useful (0 votes)
88 views3 pages

Experiment-3: Queries Retrieve and Change Data Create, Insert, Update, Delete Command

The document discusses SQL commands to create, insert, update, and delete data in a database table. It shows how to use the create command to define a student table with name, roll number, and address columns. The insert command is used to add multiple records to the student table. The update command demonstrates updating the address for a student. Finally, the delete command deletes a student record from the table where name is equal to a specified value.
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
88 views3 pages

Experiment-3: Queries Retrieve and Change Data Create, Insert, Update, Delete Command

The document discusses SQL commands to create, insert, update, and delete data in a database table. It shows how to use the create command to define a student table with name, roll number, and address columns. The insert command is used to add multiple records to the student table. The update command demonstrates updating the address for a student. Finally, the delete command deletes a student record from the table where name is equal to a specified value.
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 3

15

EXPERIMENT-3
Queries retrieve and change data create, insert, update, delete command

Create command: To create table we use create command.

create table table-name (column1 data-type,column2 data-type,….);

EX: student table

>create table student(name char(10),rollno number(5),address char(15));

Table created

>desc student;

Name NULL? Type

Name char(10)

Rollno number(5)

Address char(15)

Insert command:The insert command is used to insert the data into the created table.

Syntax:

insert into table-name values(value1,value2,value3)

>insert into student values (‘Alekhya’,501,’ongole’);

>insert into student values(‘sai’,502,’nellore’);

>insert into student values(‘sudha’,503,’ongole’);

>insert into student values (‘Navya’, 504,’kandukur’);

>>select * from student;

NAME ROLLNO ADDRESS

ALEKHYA 501 ONGOLE

SAI 502 NELLORE

WWW.KVRSOFTWARES.BLOGSPOT.COM
16

SUDHA 503 ONGOLE

NAVYA 504 KANDUKUR

Update command :To update the values for particular column(value).

Syntax: update
table tablename

set column1=value1,column2=value2,..

where condition

Ex:

> update table student set address=’VIZAG’ where name=’ALEKHYA’;

Table updated.

>select * from student;

NAME ROLLNO ADDRESS

ALEKHYA 501 VIZAG

SAI 502 NELLORE

SUDHA 503 ONGOLE

NAVYA 504 KANDUKUR

Delete command: To delete the values for a particular column (value).

Syntax:

Delete from tablename where [condition];

Ex:

>delete from student where name=’NAVYA’;

Table deleted.

>select * from student;

NAME ROLLNO ADDRESS

WWW.KVRSOFTWARES.BLOGSPOT.COM
17

ALEKHYA 501 VIZAG

SAI 502 NELLORE

SUDHA 503 ONGOLE

WWW.KVRSOFTWARES.BLOGSPOT.COM

You might also like