CSY1026-assignment-2-group-9/drop_9.sql

183 lines
2.8 KiB
MySQL
Raw Normal View History

2022-05-22 18:48:27 +00:00
2022-05-12 20:44:48 +00:00
ALTER TABLE statistics
DROP CONSTRAINT ck_game_WLD;
ALTER TABLE games
DROP CONSTRAINT ck_game_name;
ALTER TABLE rounds
DROP CONSTRAINT ck_achievement_name;
ALTER TABLE prizes
DROP CONSTRAINT ck_achievement_name;
ALTER TABLE sponsors
DROP CONSTRAINT ck_sponsor_type
DROP CONSTRAINT ck_sponsor_name;
ALTER TABLE tournaments
DROP CONSTRAINT ck_tournament_arena
DROP CONSTRAINT ck_tournament_country
DROP CONSTRAINT ck_tournament_city;
ALTER TABLE categories
DROP CONSTRAINT ck_genre_accronym
DROP CONSTRAINT ck_genre_description
DROP CONSTRAINT ck_genre_name;
ALTER TABLE teams
DROP CONSTRAINT ck_team_name;
ALTER TABLE players
DROP CONSTRAINT ck_contact_email
DROP CONSTRAINT ck_player_name;
--foreign key
ALTER TABLE game_participants
2022-05-22 20:34:55 +00:00
DROP CONSTRAINT fk_gp_games
DROP CONSTRAINT fk_gp_tournament_participants;
2022-05-12 20:44:48 +00:00
ALTER TABLE statistics
2022-05-22 20:34:55 +00:00
DROP CONSTRAINT fk_s_games;
2022-05-12 20:44:48 +00:00
ALTER TABLE games
2022-05-22 20:34:55 +00:00
DROP CONSTRAINT fk_g_rounds;
2022-05-12 20:44:48 +00:00
ALTER TABLE prizes
2022-05-22 20:34:55 +00:00
DROP CONSTRAINT fk_p_sponsors
DROP CONSTRAINT fk_p_tournaments;
2022-05-12 20:44:48 +00:00
ALTER TABLE tournament_participants
2022-05-22 20:34:55 +00:00
DROP CONSTRAINT fk_tp_tournaments
DROP CONSTRAINT fk_tp_players
DROP CONSTRAINT fk_tp_teams;
2022-05-12 20:44:48 +00:00
ALTER TABLE tournaments
2022-05-22 20:34:55 +00:00
DROP CONSTRAINT fk_t_categories;
2022-05-12 20:44:48 +00:00
ALTER TABLE team_players
2022-05-22 20:34:55 +00:00
DROP CONSTRAINT fk_team_players_olayers
DROP CONSTRAINT fk_team_players_teams;
2022-05-12 20:44:48 +00:00
--unique
ALTER TABLE categories
DROP unique (genre_name);
ALTER TABLE players
DROP UNIQUE(contact_email)
DROP UNIQUE(contact_number);
2022-05-22 20:21:32 +00:00
--PRIMARYKEY
2022-05-12 20:44:48 +00:00
ALTER TABLE game_participants
2022-05-22 20:21:32 +00:00
DROP CONSTRAINT pk_game_participant;
2022-05-12 20:44:48 +00:00
ALTER TABLE statistics
2022-05-22 20:21:32 +00:00
DROP CONSTRAINT pk_game_result;
2022-05-12 20:44:48 +00:00
ALTER TABLE rounds
2022-05-22 20:21:32 +00:00
DROP CONSTRAINT pk_round;
2022-05-12 20:44:48 +00:00
ALTER TABLE prizes
2022-05-22 20:21:32 +00:00
DROP CONSTRAINT pk_prize;
2022-05-12 20:44:48 +00:00
ALTER TABLE sponsors
2022-05-22 20:21:32 +00:00
DROP CONSTRAINT pk_sponsor;
2022-05-12 20:44:48 +00:00
ALTER TABLE tournament_participants
2022-05-22 20:21:32 +00:00
DROP CONSTRAINT pk_tournament_participant;
2022-05-12 20:44:48 +00:00
ALTER TABLE tournaments
2022-05-22 20:21:32 +00:00
DROP CONSTRAINT pk_tournament;
2022-05-12 20:44:48 +00:00
ALTER TABLE categories
2022-05-22 20:21:32 +00:00
DROP CONSTRAINT pk_genre;
2022-05-12 20:44:48 +00:00
ALTER TABLE team_players
2022-05-22 20:21:32 +00:00
DROP CONSTRAINT pk_team_player;
2022-05-12 20:44:48 +00:00
ALTER TABLE teams
2022-05-22 20:21:32 +00:00
DROP CONSTRAINT pk_team;
2022-05-12 20:44:48 +00:00
ALTER TABLE players
2022-05-22 20:21:32 +00:00
DROP CONSTRAINT pk_player;
2022-05-12 20:44:48 +00:00
--Sequence
2022-05-22 18:48:27 +00:00
2022-05-12 20:44:48 +00:00
DROP SEQUENCE seq_game_participants;
2022-05-22 18:48:27 +00:00
2022-05-12 20:44:48 +00:00
DROP SEQUENCE seq_statistics;
2022-05-22 18:48:27 +00:00
2022-05-12 20:44:48 +00:00
DROP SEQUENCE seq_games;
2022-05-22 18:48:27 +00:00
2022-05-12 20:44:48 +00:00
DROP SEQUENCE seq_rounds;
2022-05-22 18:48:27 +00:00
2022-05-12 20:44:48 +00:00
DROP SEQUENCE seq_prizes;
2022-05-22 18:48:27 +00:00
2022-05-12 20:44:48 +00:00
DROP SEQUENCE seq_sponsors;
2022-05-22 18:48:27 +00:00
2022-05-12 20:44:48 +00:00
DROP SEQUENCE seq_tournament_participants;
2022-05-22 18:48:27 +00:00
2022-05-12 20:44:48 +00:00
DROP SEQUENCE seq_tournament;
2022-05-22 18:48:27 +00:00
2022-05-12 20:44:48 +00:00
DROP SEQUENCE seq_categories;
2022-05-22 18:48:27 +00:00
2022-05-12 20:44:48 +00:00
DROP SEQUENCE seq_team_players;
2022-05-22 18:48:27 +00:00
2022-05-12 20:44:48 +00:00
DROP SEQUENCE seq_teams;
2022-05-22 18:48:27 +00:00
2022-05-12 20:44:48 +00:00
DROP SEQUENCE seq_players;
-- Tables
2022-05-22 20:21:32 +00:00
2022-05-22 18:48:27 +00:00
DROP TABLE game_participants PURGE;
2022-05-12 20:44:48 +00:00
2022-05-22 20:21:32 +00:00
2022-05-22 18:48:27 +00:00
DROP TABLE statistics PURGE;
2022-05-12 20:44:48 +00:00
2022-05-22 20:21:32 +00:00
2022-05-22 18:48:27 +00:00
DROP TABLE games PURGE;
2022-05-12 20:44:48 +00:00
2022-05-22 20:21:32 +00:00
2022-05-22 18:48:27 +00:00
DROP TABLE rounds PURGE;
2022-05-12 20:44:48 +00:00
2022-05-22 18:48:27 +00:00
DROP TABLE prizes PURGE;
2022-05-12 20:44:48 +00:00
2022-05-22 20:21:32 +00:00
2022-05-22 18:48:27 +00:00
DROP TABLE sponsors PURGE;
2022-05-12 20:44:48 +00:00
2022-05-22 20:21:32 +00:00
2022-05-22 18:48:27 +00:00
DROP TABLE tournament_participants PURGE;
2022-05-12 20:44:48 +00:00
2022-05-22 20:21:32 +00:00
2022-05-22 18:48:27 +00:00
DROP TABLE tournaments PURGE;
2022-05-12 20:44:48 +00:00
2022-05-22 18:48:27 +00:00
DROP TABLE categories PURGE;
2022-05-12 20:44:48 +00:00
2022-05-22 20:21:32 +00:00
2022-05-22 18:48:27 +00:00
DROP TABLE team_players PURGE;
2022-05-12 20:44:48 +00:00
2022-05-22 20:21:32 +00:00
2022-05-22 18:48:27 +00:00
DROP TABLE teams PURGE;
2022-05-12 20:44:48 +00:00
2022-05-22 20:21:32 +00:00
2022-05-22 18:48:27 +00:00
DROP TABLE players PURGE;