SQL120. 删除表
描述
示例1
输入:
drop table if EXISTS exam_record; CREATE TABLE IF NOT EXISTS exam_record ( id int PRIMARY KEY AUTO_INCREMENT COMMENT '自增ID', uid int NOT NULL COMMENT '用户ID', exam_id int NOT NULL COMMENT '试卷ID', start_time datetime NOT NULL COMMENT '开始时间', submit_time datetime COMMENT '提交时间', score tinyint COMMENT '得分' )CHARACTER SET utf8 COLLATE utf8_general_ci; CREATE TABLE IF NOT EXISTS exam_record_2010 (LIKE exam_record); CREATE TABLE IF NOT EXISTS exam_record_2012 (LIKE exam_record); CREATE TABLE IF NOT EXISTS exam_record_2013 (LIKE exam_record); CREATE TABLE IF NOT EXISTS exam_record_2014 (LIKE exam_record); CREATE TABLE IF NOT EXISTS exam_record_2015 (LIKE exam_record);
输出:
exam_record_2010 exam_record_2015
Mysql 解法, 执行用时: 36ms, 内存消耗: 6200KB, 提交时间: 2022-01-23
drop table if exists exam_record_2011, exam_record_2012, exam_record_2013, exam_record_2014;
Mysql 解法, 执行用时: 36ms, 内存消耗: 6232KB, 提交时间: 2022-01-27
drop table if exists exam_record_2011,exam_record_2012,exam_record_2013,exam_record_2014;
Mysql 解法, 执行用时: 36ms, 内存消耗: 6244KB, 提交时间: 2021-12-27
DROP TABLE IF EXISTS exam_record_2011, exam_record_2012,exam_record_2013, exam_record_2014;
Mysql 解法, 执行用时: 36ms, 内存消耗: 6244KB, 提交时间: 2021-12-06
DROP TABLE IF EXISTS exam_record_2011, exam_record_2012, exam_record_2013, exam_record_2014
Mysql 解法, 执行用时: 36ms, 内存消耗: 6244KB, 提交时间: 2021-12-02
drop table IF EXISTS exam_record_2011, exam_record_2012 ,exam_record_2013, exam_record_2014 ;