Experiment 1 DDL and DML
Experiment 1 DDL and DML
com/sql/online-compiler/
https://www.geeksforgeeks.org/sql-ddl-dql-dml-dcl-tcl-commands/
A Table is a combination of rows and columns. For creating a table we have to define the structure of
a table by adding names to columns and providing data type and size of data to be stored in columns.
columnN datatype(size)
);
Roll_No int(2),
Name varchar(20)
);
ADD is used to add columns to the existing table. Sometimes we may require to add additional
information, in that case, we do not require to create the whole database again, ADD comes to our
rescue.
DROP
In this article, we will be learning about the DROP statement which destroys objects like an existing
database, table, index, or view. A DROP statement in SQL removes a component from a relational
database management system (RDBMS).
To add data to the table, we use INSERT INTO, the syntax is as shown below:
The UPDATE statement in SQL is used to update the data of an existing table in the database. We can
update single columns as well as multiple columns using the UPDATE statement as per our
requirement.
In a very simple way, we can say that SQL commands(UPDATE and DELETE) are used to change the
data that is already in the database. The SQL DELETE command uses a WHERE clause.
Syntax
WHERE condition;
Existing records in a table can be deleted using the SQL DELETE Statement. We can delete a single
record or multiple records depending on the condition we specify in the WHERE clause.
DELETE FROM table_name WHERE some_condition;