-
Notifications
You must be signed in to change notification settings - Fork 0
/
db.sql
55 lines (55 loc) · 1.51 KB
/
db.sql
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
-- Create Database
CREATE DATABASE IF NOT EXISTS TheWeeklyChallenge;
-- Use the Database
USE TheWeeklyChallenge;
-- Create Challenge Table
CREATE TABLE IF NOT EXISTS Challenge (
ChallengeID INT PRIMARY KEY AUTO_INCREMENT,
Week INT NOT NULL,
Date DATE NOT NULL,
PRIMARY KEY (Week, Date)
);
-- Create Task Table
CREATE TABLE IF NOT EXISTS Task (
TaskID INT PRIMARY KEY AUTO_INCREMENT,
ChallengeID INT,
Name VARCHAR(255) NOT NULL,
FOREIGN KEY (ChallengeID) REFERENCES Challenge(ChallengeID)
);
-- Create Champions Table
CREATE TABLE IF NOT EXISTS Champions (
ChampionID INT PRIMARY KEY AUTO_INCREMENT,
Name VARCHAR(255) NOT NULL,
Image VARCHAR(255),
Description VARCHAR(255),
InterviewLink VARCHAR(255)
);
-- Create Guest Table
CREATE TABLE IF NOT EXISTS Guest (
GuestID INT PRIMARY KEY AUTO_INCREMENT,
Name VARCHAR(255) NOT NULL,
Image VARCHAR(255),
Designation VARCHAR(255),
Description VARCHAR(255)
);
-- Create PerlReview Table
CREATE TABLE IF NOT EXISTS PerlReview (
PerlReviewID INT PRIMARY KEY AUTO_INCREMENT,
Name VARCHAR(255) NOT NULL,
Url VARCHAR(255),
Image VARCHAR(255)
);
-- Create RakuReview Table
CREATE TABLE IF NOT EXISTS RakuReview (
RakuReviewID INT PRIMARY KEY AUTO_INCREMENT,
Name VARCHAR(255) NOT NULL,
Url VARCHAR(255),
Image VARCHAR(255)
);
-- Create Recap Table
CREATE TABLE IF NOT EXISTS Recap (
RecapID INT PRIMARY KEY AUTO_INCREMENT,
Name VARCHAR(255) NOT NULL,
Url VARCHAR(255),
Image VARCHAR(255)
);