Thursday, May 4, 2023

DML commands

DML COMMANDS:

1. INSERT:

SQL INSERT statement is a SQL query. It is used to insert a single or a multiple records in a table.

Syntax:

INSERT INTO table_name

VALUES (value1, value2, value3 .....);

Example:

INSERT INTO STUDENTS (ROLL_NO, NAME, AGE, CITY) VALUES (1,naresh, 21, hyd)
3. ALTER:

The ALTER TABLE statement in Structured Query Language allows you to add, modify, and delete columns of an existing table.

Syntax:

ALTER table_name

ADD column_name datatype;

Example:

ALTER TABLE EMPLOYEE ADD Email varchar (255);

4. DROP:

The DROP TABLE statement is used to drop an existing table in a database. This command deletes both the structure & Records Stored in the table.

Syntax:

DROP TABLE table_name;

Example:

DROP TABLE Employee