What are DDL, DML and DCL in MySQL?

Instructor: David Gloag

David has over 40 years of industry experience in software development and information technology and a bachelor of computer science

Information comes us at from many directions. Databases help us make sense of the information in our world. In this lesson, we'll take a look at a specific example, MySQL, and the commands that can be employed to make sense of data.

Organizing Chaos

Information comes to us in many forms. We hear news reports on TV every night, we read articles in our favorite magazines, and we hear stats about local sporting events from our friends. It never seems to end! So it makes sense to have the means to organize it all. It also makes sense that this means would have some flexible way of describing or manipulating the information to suit our specific needs. Enter MySQL.

What is MySQL?

MySQL is relational database management system (RDBMS). That is, it is a software system that organizes data into a set of tables, where each table represents a collection of related data. Further, each row of a table, identified by a key, represents a specific element of the table's relation. As an example, let's consider a table that contains employee information. Each row will represent a single employee, and contain an employee number (key) along with various pieces of information.

Employee # Employee Name Title Department
12345 Mark Support Rep Support
54321 Susan Manager Accounting
13245 Gary Programmer Development
42315 Karen Sales Rep Outside Sales

MySQL is also open source, meaning that it is freely available on the Internet, along with the source code for the system. In fact, according to their website, they are the most popular open source database in the world.

What is SQL in MySQL?

SQL stands for structured query language. It is the internal language that someone can use to make the RDBMS perform various operations on its data. These range from database creation and deletion, to updating an individual row. As we will see, some are used more than others. We'll take a look at DDL, DML, and DCL in the following paragraphs.

What is DDL in MySQL?

DDL stands for data definition language. It is a set of SQL statements that work on the database as a whole, rather than an individual table or row. Create, alter, and drop are elements of this language. You would use these elements, when you want to add a table, change the makeup of a table, or delete a table. These operations are significant, changing the nature of the database in question.

Here's an example:

ALTER TABLE table_name ADD column_name data_type;
DROP TABLE table_name;

What is DML in MySQL?

DML stand for data manipulation language. It is a set of SQL statements that act on the data within a table. Select, insert, update, and delete are elements of this language. You would use these elements, when you want to retrieve a portion of, add data to, change data within, or delete data from a table. This is the most commonly used language of the RDBMS.

Look at this example:

To unlock this lesson you must be a Member.
Create your account

Register to view this lesson

Are you a student or a teacher?

Unlock Your Education

See for yourself why 30 million people use

Become a member and start learning now.
Become a Member  Back
What teachers are saying about
Try it risk-free for 30 days

Earning College Credit

Did you know… We have over 200 college courses that prepare you to earn credit by exam that is accepted by over 1,500 colleges and universities. You can test out of the first two years of college and save thousands off your degree. Anyone can earn credit-by-exam regardless of age or education level.

To learn more, visit our Earning Credit Page

Transferring credit to the school of your choice

Not sure what college you want to attend yet? has thousands of articles about every imaginable degree, area of study and career path that can help you find the school that's right for you.

Create an account to start this course today
Try it risk-free for 30 days!
Create an account