Home >> FAQs/Tutorials >> MySQL Tutorials

MySQL Tutorial - DDL Commands Supported

By: FYIcenter.com

(Continued from previous topic...)

How Many SQL DDL Commands Are Supported by "mysql"?

There are 4 SQL Data Definition Language (DDL) commands that are supported by "mysql". They are listed below with short descriptions:

  • "CREATE dataObjectType dataObjectName" - Creates new databases, tables, views, triggers, indexes, and other data objects.
  • "RENAME dataObjectType dataObjectName" - Renames existing databases, tables, views, triggers, indexes, and other data objects.
  • "ALTER dataObjectType dataObjectName" - Alters properties of existing databases, tables, views, triggers, indexes, and other data objects.
  • "DROP dataObjectType dataObjectName" - Drops existing databases, tables, views, triggers, indexes, and other data objects.

Here is a tutorial exercise of how to use DDL commands to create a database and a table:

>cd \mysql\bin
>mysql -u root

mysql> CREATE DATABASE fyi;
Query OK, 1 row affected (0.50 sec)

mysql> CREATE TABLE articles (name VARCHAR(80));
Query OK, 0 rows affected (0.25 sec)

mysql> DROP DATABASE fyi;
Query OK, 0 rows affected (0.41 sec)

(Continued on next topic...)

  1. What Is the Command Line End User Interface - mysql?
  2. What Are the "mysql" Command Line Options?
  3. What Are the "mysql" Command Line Arguments?
  4. How Many SQL DDL Commands Are Supported by "mysql"?
  5. How Many SQL DML Commands Are Supported by "mysql"?
  6. What Are the Non-Standard SQL Commands Supported by "mysql"?
  7. How To Get Help Information from the Server?
  8. How To Run "mysql" Commands from a Batch File?
  9. How To Return Query Output in HTML Format?
  10. How To Return Query Output in XML Format?

MySQL Tutorials:

More...


Other Tutorials/FAQs:

More...


Related Resources:

More...


Selected Jobs:

More...