0% found this document useful (0 votes)
64 views4 pages

DML Commands b6-56

The document discusses four different data manipulation language (DML) commands in SQL: INSERT, SELECT, UPDATE, and DELETE. It provides the syntax and usage for each command. INSERT is used to insert new rows into a table and has two methods - specifying only values or specifying column names and values. SELECT is used to retrieve data from a database and can fetch entire tables or specific fields and rows. UPDATE is used to modify existing data in a table. DELETE removes existing records from a table based on a specified condition.

Uploaded by

praveen kumar
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
64 views4 pages

DML Commands b6-56

The document discusses four different data manipulation language (DML) commands in SQL: INSERT, SELECT, UPDATE, and DELETE. It provides the syntax and usage for each command. INSERT is used to insert new rows into a table and has two methods - specifying only values or specifying column names and values. SELECT is used to retrieve data from a database and can fetch entire tables or specific fields and rows. UPDATE is used to modify existing data in a table. DELETE removes existing records from a table based on a specified condition.

Uploaded by

praveen kumar
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 4

DML commands

(-select, insert, update and delete)

INSERT :
The INSERT INTO statement of SQL is used to insert a new row in a table. There are two
ways of using INSERT INTO statement for inserting rows:
1.Only values: First method is to specify only the value of data to be inserted without the
column names.

Syntax:
INSERT INTO table_name VALUES(value1,value2,value3,.........);

2.Column names and values both: In the second method we will specify both the
columns which we want to fill and their corresponding values as shown below:
Syntax:
INSERT INTO table_name(column1,column2,column3,.......) VALUES(value1,value2,value3,.....);

Output:
SELECT:
Select is the most commonly used statement in SQL. The SELECT Statement in SQL is used
to retrieve or fetch data from a database. We can fetch either the entire table or according to
some specified rules. The data returned is stored in a result table. This result table is also
called result-set.

Syntax:
SELECT column1,column2 FROM table_name
 To fetch the entire table or all the fields in the table:
SELECT *FROM table_name;
 Query to fetch the fields ROLL_NO, NAME, AGE from the table Student:
SELECT ROLL_NO, NAME, AGE FROM Student;

Output:
UPDATE:
The UPDATE statement in SQL is used to update the data of an existing table in database.
We can update single columns as well as multiple columns using UPDATE statement as per
our requirement.

Syntax :
UPDATE table_name SET column1=value1,column2=value2,.............WHERE condition;

Output :

DELETE:
The DELETE Statement in SQL is used to delete existing records from a table. We can delete
a single record or multiple records depending on the condition we specify in the WHERE
clause.
Syntax:
DELETE FROM table_name WHERE some condition;
Output:

You might also like