DDL DML Commands 1
DDL DML Commands 1
Data Manipulation Language (DML) is a class of SQL statements that are used to
query, edit, add and delete row-level data from database tables or views. The main
DML statements are SELECT, INSERT, DELETE, and UPDATE.
DML is contrasted with Data Definition Language (DDL) which is a series of SQL
statements that you can use to edit and manipulate the structure of databases and
the objects in them.
With the exception of SELECT statements, all of the others are only applicable to
data within tables in a database.
1.1 Let us CREATE first a database (DDL Command). (See code below, you can copy and
paste.)
1.2 Let us then CREATE the first database table (DDL Command). (See code below, you
can copy and paste.)
1.3 Let us then CREATE second database table (DDL Command). (See code below, you
can copy and paste.)
1.4 Let us now INSERT data into the first database table (DML Command). (See code
below, you can copy and paste.)
1.5 Let us check if the first table is already populated with data or records by
using the SELECT statement. (DML Command). (See code below, you can copy and
paste.)
SELECT * FROM tblStudInfo;
1.6 Let us now INSERT data into the second database table (DML Command). (See code
below, you can copy and paste.)
1.7 Let us check if the second table is already populated with data or records by
using the SELECT statement. (DML Command). (See code below, you can copy and
paste.)
1.8 Let us UPDATE the name of �FRED� into �FREDERICO� in the first database table
(DML Command). (See code below, you can copy and paste.)
1.9 Let us check if the name is updated by using the SELECT statement. (DML
Command). (See code below, you can copy and paste.)
2.0 Let us UPDATE the Subject Grade of �FREDERICO� in �ENG101� to �96� in the
second database table (DML Command). (See code below, you can copy and paste.)
2.1 Let us check if the name is updated by using the SELECT statement. (DML
Command). (See code below, you can copy and paste.)
2.2 Let us now DELETE specific data from the first database table (DML Command).
(See code below, you can copy and paste.)
2.3 Let us check if the record is already DELETED in topic 2.2 using the SELECT
statement. (DML Command). (See code below, you can copy and paste.)
2.4 Let us now DELETE specific data from the second database table (DML Command).
(See code below, you can copy and paste.)
2.5 Let us check if the record is already DELETED in topic 2.4 using the SELECT
statement. (DML Command). (See code below, you can copy and paste.)
(Note: if MySQL returned an empty result set, then your code is correct)
2.6 Let us for now DELETE all the data from the first database table (DML Command).
(See code below, you can copy and paste.)
2.7 Let us check if the records are already DELETED in topic 2.6 using the SELECT
statement. (DML Command). (See code below, you can copy and paste.)
(Note: if MySQL returned an empty result set, then your code is correct)
2.8 Let us for now DELETE all the data from the second database table (DML
Command). (See code below, you can copy and paste.)
2.9 Let us check if the records are already DELETED in topic 2.8 using the SELECT
statement. (DML Command). (See code below, you can copy and paste.)
SELECT * FROM tblStudGrade;
(Note: if MySQL returned an empty result set, then your code is correct)
2.9 Please go back to topic 1.4, copy and paste the code and execute the command.
3.0 Please go back to topic 1.6, copy and paste the code and execute the command.