-- Removes the tables for the Flugzeug DB
--
-- Author: Andreas Zweili
-- Erstellt: 2017-05-27
-- DB-Server SQL Server 2016

use marketdb;
-- Dateiname create_table.sql
--
-- Beschreibung: Queries zum erstellen der Tabellen der Case Study DB
--
-- Autor: Andreas Zweili
-- Datum: 2017-06-05
-- Server Version: SQL Server 2016

use marketdb;
if exists (select * from sysobjects where name='commercials')
    DROP TABLE commercials (
    );

use marketdb;
if exists (select * from sysobjects where name='member_status')
    DROP TABLE member_status (
    );

use marketdb;
if exists (select * from sysobjects where name='salutation')
    DROP TABLE salutation (
    );

use marketdb;
if exists (select * from sysobjects where name='subscription')
    DROP TABLE subscription (
    );

use marketdb;
if exists (select * from sysobjects where name='subscption_order')
    DROP TABLE subscption_order (
    );

use marketdb;
if exists (select * from sysobjects where name='members')
    DROP TABLE members (
    );

use marketdb;
if exists (select * from sysobjects where name='persons')
    DROP TABLE persons (
    );

use marketdb;
if exists (select * from sysobjects where name='trial_period')
    DROP TABLE trial_period (
    );

use marketdb;
if exists (select * from sysobjects where name='quality_checks')
    DROP TABLE quality_checks (
    );

use marketdb;
if exists (select * from sysobjects where name='cities')
    DROP TABLE cities (
    );

use marketdb;
if exists (select * from sysobjects where name='countries')
    DROP TABLE countries (
    );

use marketdb;
if exists (select * from sysobjects where name='rents')
    DROP TABLE rents (
    );

use marketdb;
if exists (select * from sysobjects where name='locations')
    DROP TABLE locations (
    );

use marketdb;
if exists (select * from sysobjects where name='rent_prices')
    DROP TABLE rent_prices (
    );

use master;
if exists (select * from sys.databases where name='marketdb')
    drop DATABASE marketdb;
