Commit e6594ae2 authored by mi's avatar mi

Simplifying multipe «drop table» statements

parent 4addeedb
DROP TABLE IF EXISTS Para;
DROP TABLE IF EXISTS `To`;
DROP TABLE IF EXISTS Memo;
DROP TABLE IF EXISTS Para, `To`, Memo ;
CREATE TABLE Memo (
id INT PRIMARY KEY,
......
DROP TABLE IF EXISTS Student;
DROP TABLE IF EXISTS StudyCourse;
DROP TABLE IF EXISTS Student, StudyCourse;
CREATE TABLE StudyCourse (
id INTEGER NOT NULL PRIMARY KEY
......
DROP TABLE IF EXISTS Student;
DROP TABLE IF EXISTS StudyCourse;
DROP TABLE IF EXISTS Student, StudyCourse;
CREATE TABLE StudyCourse (
id INTEGER NOT NULL PRIMARY KEY
......
DROP TABLE IF EXISTS LanguageScript;
DROP TABLE IF EXISTS Script;
DROP TABLE IF EXISTS Language;
DROP TABLE IF EXISTS LanguageScript, Script, Language;
CREATE TABLE Language (
id BIGINT NOT NULL PRIMARY KEY AUTO_INCREMENT,
......
DROP TABLE IF EXISTS Translation;
DROP TABLE IF EXISTS Noun;
DROP TABLE IF EXISTS Language;
DROP TABLE IF EXISTS Translation, Noun, Language;
CREATE TABLE Language (
id INTEGER AUTO_INCREMENT PRIMARY KEY,
......
DROP TABLE IF EXISTS ActorMovie;
DROP TABLE IF EXISTS Movie;
DROP TABLE IF EXISTS Person;
DROP TABLE IF EXISTS ActorMovie, Movie, Person;
CREATE TABLE Person (
id CHAR(255) PRIMARY KEY
......
DROP TABLE IF EXISTS Employee;
DROP TABLE IF EXISTS Department;
DROP TABLE IF EXISTS Employee, Department;
CREATE TABLE Department(
......
DROP TABLE IF EXISTS Employee;
DROP TABLE IF EXISTS Department;
DROP TABLE IF EXISTS Employee, Department;
CREATE TABLE Department(
......
show tables;
show create TABLE FsObject;
DROP TABLE IF EXISTS FsObject;
CREATE TABLE FsObject (
......
DROP TABLE IF EXISTS Student;
CREATE TABLE Student (
......
show tables;
show create TABLE FsObject;
DROP TABLE IF EXISTS FsObject;
CREATE TABLE FsObject (
......
DROP TABLE IF EXISTS Student;
CREATE TABLE Student (
......
DROP TABLE IF EXISTS Competition;
DROP TABLE IF EXISTS Athlete;
DROP TABLE IF EXISTS Competition, Athlete;
CREATE TABLE Athlete (
id INT NOT NULL PRIMARY KEY
......
DROP TABLE IF EXISTS Competition;
DROP TABLE IF EXISTS Athlete;
DROP TABLE IF EXISTS Competition, Athlete;
CREATE TABLE Athlete (
id INT NOT NULL PRIMARY KEY
......
DROP TABLE IF EXISTS Para;
DROP TABLE IF EXISTS Section;
DROP TABLE IF EXISTS Para, Section;
-- TODO
-- Read the exercise's documentation and add your schema here. You may
......
DROP TABLE IF EXISTS Para;
DROP TABLE IF EXISTS Section;
DROP TABLE IF EXISTS Para, Section;
CREATE TABLE Section (
id VARCHAR(255) PRIMARY KEY
......
DROP TABLE IF EXISTS Category2Article;
DROP TABLE IF EXISTS Article;
DROP TABLE IF EXISTS Category;
DROP TABLE IF EXISTS Category2Article, Article, Category;
CREATE TABLE Category
(
......@@ -58,9 +56,6 @@ VALUES ('hardware', 232434);
INSERT INTO Category2Article
VALUES ('food', 544343);
SELECT *
FROM Category;
SELECT *
FROM Article;
SELECT *
FROM Category2Article;
\ No newline at end of file
SELECT * FROM Category;
SELECT * FROM Article;
SELECT * FROM Category2Article;
\ No newline at end of file
DROP TABLE IF EXISTS Student;
DROP TABLE IF EXISTS StudyCourse;
DROP TABLE IF EXISTS Student, StudyCourse;
CREATE TABLE StudyCourse (
id INTEGER NOT NULL PRIMARY KEY
......
DROP TABLE IF EXISTS Student;
DROP TABLE IF EXISTS StudyCourse;
DROP TABLE IF EXISTS Student, StudyCourse;
CREATE TABLE StudyCourse (
id INTEGER NOT NULL PRIMARY KEY
......
DROP TABLE IF EXISTS Description;
DROP TABLE IF EXISTS Product;
DROP TABLE IF EXISTS Description, Product;
CREATE TABLE Product (
id INTEGER NOT NULL PRIMARY KEY
......
DROP TABLE IF EXISTS Description;
DROP TABLE IF EXISTS Product;
DROP TABLE IF EXISTS Description, Product;
CREATE TABLE Product (
id INTEGER NOT NULL PRIMARY KEY
......
DROP TABLE IF EXISTS Course;
DROP TABLE IF EXISTS Lecturer;
DROP TABLE IF EXISTS Course, Lecturer;
CREATE TABLE Lecturer (
id INT AUTO_INCREMENT
......
DROP TABLE IF EXISTS Flight;
DROP TABLE IF EXISTS Destination;
DROP TABLE IF EXISTS Airline;
DROP TABLE IF EXISTS Flight, Destination, Airline;
CREATE Table Airline (
id INT NOT NULL
......
DROP TABLE IF EXISTS Description;
DROP TABLE IF EXISTS Product;
DROP TABLE IF EXISTS Description, Product;
CREATE TABLE Product (
id INTEGER NOT NULL PRIMARY KEY
......
DROP TABLE IF EXISTS Description;
DROP TABLE IF EXISTS Product;
DROP TABLE IF EXISTS Description, Product;
CREATE TABLE Product (
id INTEGER NOT NULL PRIMARY KEY
......
DROP TABLE IF EXISTS Description;
DROP TABLE IF EXISTS Product;
DROP TABLE IF EXISTS Description, Product;
CREATE TABLE Product (
id INTEGER NOT NULL PRIMARY KEY
......
DROP TABLE IF EXISTS Description;
DROP TABLE IF EXISTS Product;
DROP TABLE IF EXISTS Description, Product;
CREATE TABLE Product (
id CHAR(20) NOT NULL PRIMARY KEY
......
DROP TABLE IF EXISTS Description;
DROP TABLE IF EXISTS Product;
DROP TABLE IF EXISTS Description, Product;
CREATE TABLE Product (
id INTEGER NOT NULL
......
-- possible present from a related exercise
DROP TABLE IF EXISTS Description;
DROP TABLE IF EXISTS Product;
DROP TABLE IF EXISTS Description, Product;
CREATE TABLE Product(
orderNo CHAR(10) NOT NULL PRIMARY KEY
......
DROP Table IF EXISTS SysUserGroup;
DROP Table IF EXISTS SysUser;
DROP Table IF EXISTS SysGroup;
DROP Table IF EXISTS SysUserGroup, SysUser, SysGroup;
CREATE TABLE SysGroup ( -- The system's groups --
id INTEGER AUTO_INCREMENT PRIMARY KEY
......
drop table if exists Employee;
drop table if exists Project;
drop table if exists Department;
drop table if exists EmployeeProject;
drop table if exists EmployeeProject, Project, Employee, Department;
CREATE TABLE Department(
id BIGINT PRIMARY KEY
......
drop table if exists Employee;
drop table if exists Project;
drop table if exists Department;
drop table if exists EmployeeProject;
drop table if exists EmployeeProject, Employee, Project, Department;
CREATE TABLE Department(
id BIGINT PRIMARY KEY
......
-- possible present from a related exercise
DROP TABLE IF EXISTS Description;
DROP TABLE IF EXISTS Product;
DROP TABLE IF EXISTS Description, Product;
CREATE TABLE Product(
orderNo CHAR(10) NOT NULL PRIMARY KEY
......
drop table if exists ArtistAlbum;
drop table if exists Artist;
drop table if exists Track;
drop table if exists Album;
drop table if exists Format;
drop table if exists ArtistAlbum, Artist, Track, Album, Format;
CREATE TABLE Format (
id BIGINT PRIMARY KEY
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment