Dropping tables
To remove all entries from the table we can issue the DELETE statement without any conditions.
DELETE from employee_data; Query OK, 0 rows affected (0.00 sec)
However, this does not delete the table. The table still remains, which you can check with SHOW TABLES;
mysql> SHOW TABLES; +---------------------+ | Tables in employees | +---------------------+ | employee_data | +---------------------+ 1 rows in set (0.00 sec)
To delete the table, we issue a DROP table command.
DROP TABLE employee_data; Query OK, 0 rows affected (0.01 sec)
Now, we won’t get this table in SHOW TABLES; listing
|
« Previous
|
Next »
|
Deleting entries from tables The SQL delete statement requires the table name and optional conditions. DELETE from table_name [WHERE conditions]; NOTE: If you don't specify ...
MySQL tables Now that we've created our employee_data table, let's check its listing. Type SHOW TABLES; at the mysql prompt. This should present you with ...
Creating tables In this section of the mysql training course we will explore the MySQL commands to create database tables and selecting the database. Databases ...
Inserting data in MySQL tables Inserting data into tables The INSERT SQL statement impregnates our table with data. Here is a general form of INSERT. ...
Querying MySQL tables Our employee_data table now contains enough data for us to work with. Let us see how we can extract (query) it. Querying ...