Home > Database > Mysql Tutorial > body text

Detailed explanation of how to write SQL statements to delete tables in different databases

Y2J
Release: 2017-05-22 14:57:00
Original
1793 people have browsed it

This article mainly introduces the relevant information about how DROP TABLE is written in different databases. Friends who need it can refer to

How DROP TABLE is written in different databases.

1, in MySql

DROP TABLE IF EXISTS [table_name]
Copy after login

2, in Oracle:

BEGIN
  EXECUTE IMMEDIATE 'DROP TABLE [table_name]';
  EXCEPTION WHEN OTHERS THEN NULL;
END;
Copy after login

3, in Sql Server

IF EXISTS (
  SELECT TABLE_NAME FROM INFORMATION_SCHEMA.TABLES
  WHERE  TABLE_NAME = '[table_name]')
DROP TABLE [table_name]
Copy after login

【Related recommendations】

1. Mysql free video tutorial

2. mysql 5.7 Changing the database data storage location Detailed explanation of examples

3. Detailed explanation of the method of importing mysql big data into Navicat and reporting errors

4. Detailed explanation of examples of unlocking and locking tables in MYSQL

5. How to improve the database query speed of millions of items

The above is the detailed content of Detailed explanation of how to write SQL statements to delete tables in different databases. For more information, please follow other related articles on the PHP Chinese website!

Related labels:
source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template