-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathDDL_Commands.txt
251 lines (206 loc) · 5.65 KB
/
DDL_Commands.txt
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
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
● DATABASE NAME: IPL AUCTION
Create database Ipl_Auction;
● TABLE: TEAM
Create table Team(
Team_Name varchar(100) not null,
Full_Name varchar(100) not null,
Tropies_Won int,
Captain varchar(100) not null,
Vice_Captain varchar(100),
Home_Ground_Name varchar(100) not null,
Purchase_Bag_Available int not null,
Primary key(Team_Name)
);
● TABLE: PLAYER
Create table Player(
PID int not null,
Name varchar(100) not null,
Age int not null,
Height int not null,
Nationality varchar(100) not null,
State_Association varchar(100) not null,
Batting_Style varchar(100) not null,
Bowling_Style varchar(100) not null,
Speciality varchar(100) not null,
Base_Price int not null,
IPL_Debut_Year int not null,
Capped Boolean not null,
Status varchar(100) not null,
Type varchar(100) not null,
Primary key(PID)
);
● TABLE: TEAM STAFF
Create table Team_Staff(
Team_Name varchar(100) not null,
Head_Coach varchar(100) not null,
Batting_Coach varchar(100) not null,
Bowling_Coach varchar(100) not null,
Fielding_coach varchar(100) not null,
Throwdown_Specialist varchar(100) not null,
Physio varchar(100) not null,
High_Performer_Analyst varchar(100) not null,
Physical_Trainer varchar(100) not null,
Team_Doctor varchar(100) not null,
Primary key(Team_Name),
Foreign key(Team_Name) references Team(Team_Name)
);
● TABLE: HOME GROUND
Create table Home_Ground(
Name varchar(100) not null,
Location varchar(100) not null,
Capacity varchar(100) not null,
Pitch_Type varchar(100) not null,
Dimensions varchar(100) not null,
Year_Of_Establishment int not null,
Avg_First_Inning_Score float not null,
Avg_Second_Inning_Score float not null,
Curator_Name varchar(100) not null,
Team_Name varchar(100) not null,
Primary key(Team_Name),
Foreign key(Team_Name) reference Team(Team_Name)
);
● TABLE: STATS
Create table Stats(
PID int not null,
Runs int,
Matches_Played int,
Strike_Rate double,
Batting_Average double,
Bowling_Average double,
6s int,
4s int,
100s int,
50s int,
No_of_wickets int,
No_of_catches int,
No_of_Stumpings int,
Primary key(PID),
Foreign key(PID) references Player(PID)
);
● TABLE: AUCTION
Create table Auction(
Date date not null,
Time time not null,
Location varchar(100) not null,
Auctioneer_Name varchar(100) not null,
Auctioneer_Age varchar(100) not null,
Auctioneer_Nationality varchar(100) not null,
Primary key(Auctioneer_Name)
);
● TABLE: USER
Create table User(
ID int not null,
Name varchar(100) not null,
Gender varchar(100) not null,
Age int not null,
Favourite_Team varchar(100) not null,
Favourite_Player varchar(100) not null,
Primary key(ID)
);
● TABLE: OWNER
Create table Owner(
ID int not null,
Name varchar(100) not null,
Team_Name varchar(100) not null,
Primary key(ID),
Foreign key(Team_Name) references Team(Team_Name)
);
● TABLE: TEAM PLAYED UNDER
Create table Team_Played_Under(
PID int not null,
Teams_Name varchar(100) not null,
Primary Key(PID),
Foreign key(PID) references Player(PID)
);
● TABLE: TROPIES WON
Create table Tropies_Won(
Team_Name varchar(100) not null,
Year int not null,
Primary key(Year),
Foreign key(Team_Name) references Team(Team_Name)
);
● TABLE: INTERNATIONAL RECORD
Create table International_Record(
PID int not null,
Test_Caps int,
ODI_Caps int,
T20_Caps int,
Primary key(PID),
Foreign key(PID) references Player(PID)
);
● TABLE: PLAYER LIST FOR AUCTION
Create table Players_List_For_Auction(
PID int not null,
Set_No int not null,
2021_Set varchar(10) not null,
Primary key(PID),
Foreign key(PID) references Player(PID)
);
● TABLE: RETAINED PLAYER LIST
Create table Retained_Player_List(
PID int not null,
Team_Name varchar(100) not null,
Salary int not null,
Primary key(PID),
Foreign key(PID) references Player(PID)
);
● TABLE: PREVIOUS STANDING
Create table Previous_Standing(
Year int not null,
Team_Name varchar(100) not null,
Position int not null,
Foreign key(Team_Name) references Team(Team_Name)
);
● TABLE: SPONSOR
Create table Sponsor(
SID int not null,
Name varchar(100) not null,
Primary key(SID)
);
● TABLE: PLAYER SPONSOR
Create table Player_Sponsor(
SID int not null,
PID int not null,
Primary key(PID),
Foreign key(PID) references Player(PID),
Foreign key(SID) references Sponsor(SID)
);
● TABLE: TEAM SPONSOR
Create table Team_Sponsor(
SID int not null,
Team_Name varchar(100) not null,
Foreign key(Team_Name) references Team(Team_Name),
Foreign key(SID) references Sponsor(SID)
);
● TABLE: TEAM RECORD
Create table Team_Record(
Team_Name varchar(100) not null,
Name varchar(100) not null,
Stats varchar(100) not null,
Primary key(Name),
Foreign key(Team_Name) references Team(Team_Name)
);
● TABLE: PLAYER RECORD
Create table Player_Record(
PID int not null,
Name varchar(100) not null,
Stats varchar(100) not null,
Primary key(Name),
Foreign key(PID) references Player(PID)
);
● TABLE: BUYS IN
Create table Buys_In(
Team_Name varchar(100) not null,
Money_Spent float not null,
Primary Key(Team_Name),
Foreign key(Team_Name) references Team(Team_Name)
);
● TABLE: AUCTIONED IN
Create table Auctioned_In(
PID int not null,
Status varchar(100) not null,
Price int not null,
Team_Name varchar(100) not null,
Primary Key(PID),
Foreign key(PID) references Player(PID)
);