How To Drop an Existing Table in MySQL?
Submitted by: AdministratorIf you want to delete an existing table and its data rows, you can use the "DROP TABLE" statement as shown in the tutorial script below:
<pre>mysql> SELECT * FROM tipBackup;
+----+-------------+-------------------------+-------------+
| id | subject | description | create_date |
+----+-------------+-------------------------+-------------+
| 1 | Learn MySQL | Visit www.GlobalGuideLine.com | 2006-07-01 |
+----+-------------+-------------------------+-------------+</pre>
1 row in set (0.40 sec)
mysql> DROP TABLE tipBackup;
Query OK, 0 rows affected (0.00 sec)
mysql> SELECT * FROM tipBackup;
ERROR 1146 (42S02): Table 'ggl.tipbackup' doesn't exist
Be careful, when you use the "DROP TABLE" statement. All data rows are gone too.
Submitted by: Administrator
<pre>mysql> SELECT * FROM tipBackup;
+----+-------------+-------------------------+-------------+
| id | subject | description | create_date |
+----+-------------+-------------------------+-------------+
| 1 | Learn MySQL | Visit www.GlobalGuideLine.com | 2006-07-01 |
+----+-------------+-------------------------+-------------+</pre>
1 row in set (0.40 sec)
mysql> DROP TABLE tipBackup;
Query OK, 0 rows affected (0.00 sec)
mysql> SELECT * FROM tipBackup;
ERROR 1146 (42S02): Table 'ggl.tipbackup' doesn't exist
Be careful, when you use the "DROP TABLE" statement. All data rows are gone too.
Submitted by: Administrator
Read Online MySQL Programming Job Interview Questions And Answers
Top MySQL Programming Questions
☺ | How To Use Regular Expression in Pattern Match Conditions? |
☺ | What Is TIMESTAMP in MySQL? |
☺ | How To Write Date and Time Literals? |
☺ | How To Use CASE Expression? |
☺ | What Is View? |
Top Databases Programming Categories
☺ | RDBMS Interview Questions. |
☺ | SQL Interview Questions. |
☺ | SSRS Interview Questions. |
☺ | Database Administrator (DBA) Interview Questions. |
☺ | Sybase Interview Questions. |