From the course: Oracle Database 12c: Basic SQL

Introduction to DML and DDL commands - Oracle Database Tutorial

From the course: Oracle Database 12c: Basic SQL

Start my 1-month free trial

Introduction to DML and DDL commands

- [Instructor] So far in our course we wrote and executed SQL queries which essentially allows us to retrieve data from database tables. For example, select * from employees will return all columns and all rows from the employees tables. However, in addition to SQL queries, two additional categories of statements that are part of the SQL language are DML and DDL commands. Let's understand what DML and DDL command mean. So DML, which stands for Data Modification Language, is used to modify existing data in your database. For example, you can use DML commands to insert data into our tables such as using an insert command, specifying the table name, column names and the values which we would like to insert into our table. We can also use DML commands to update existing data, as well as delete rows. We will see all of these examples throughout this chapter. We also have another category of commands known as DDL commands, or Data Definition Language, which are used to create new database objects. So for example, we can create a new table using the DDL create table command, specifying the table name, and the column names, as well as the data types for each column. So to recap, we run SQL queries when we wish to retrieve data from our database tables. We run DML or Data Modification Language commands when we wish to modify the data in our database such as inserting new records, updating existing values, or deleting rows and we run DDL commands, or Data Definition Language commands, when we want to create new database objects, such as creating new database tables.

Contents