-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathsmb3_db_queries.txt
176 lines (146 loc) · 4.44 KB
/
smb3_db_queries.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
Queries for SMB3 database
SQLITE output command
.output <filename>
<any query will be concatenated to this file>
use `.output` with no filename to stop this mode
BASEBALL PLAYER ABILITIES
GUID | originalGUID | teamGUID | power | contact | speed | fielding | arm | velocity | junk | accuracy | age
select * from t_baseball_players;
BASEBALL PLAYER NAMES/POSITION
baseballPlayerGUID | firstName | lastName | primaryPosition | pitcherRole
select * from v_baseball_player_info;
BATTING LINEUPS
select * from t_batting_orders limit 10;
startingLineupID battingOrder baseballPlayerGUID
// BATTING
select
localId id,
team.teamName,
vbpi.firstName,
vbpi.lastName,
battingOrder.battingOrder
from v_baseball_player_info vbpi
join t_baseball_players tbp
on vbpi.baseballPlayerGUID = tbp.GUID
join t_baseball_player_local_ids localId
on localId.GUID = tbp.GUID
join t_teams team
on tbp.teamGUID = team.GUID
join t_batting_orders battingOrder
on vbpi.baseballPlayerGUID = battingOrder.baseballPlayerGUID
join t_starting_lineups lineup
on battingOrder.startingLineupID = lineup.startingLineupID
where lineup.usesDesignatedHitter = 0
order by team.teamName, battingOrder.battingOrder;
// pitching rotations
select
localId id,
team.teamName,
vbpi.firstName,
vbpi.lastName,
pitchingRotation.pitchingRotation
from v_baseball_player_info vbpi
join t_baseball_players tbp
on vbpi.baseballPlayerGUID = tbp.GUID
join t_baseball_player_local_ids localId
on localId.GUID = tbp.GUID
join t_teams team
on tbp.teamGUID = team.GUID
join t_pitching_rotations pitchingRotation
on vbpi.baseballPlayerGUID = pitchingRotation.pitcherGUID
order by team.teamName, pitchingRotation.pitchingRotation;
TEAM TYPES
select * from t_team_types;
teamType | typeName
0, standard
1, sandbox
2, template
TEAMS
GUID | originalGUID | teamName | isBuiltIn | isGenerated | teamType | templateTeamFamily | isHistorical
select * from t_teams;
GET PLAYERS AND ABILITIES AND TEAMS
- Some duplicate players show up with different traits. Not sure why
select
localId.localID id,
team.teamName,
vbpi.firstName,
vbpi.lastName,
vbpi.primaryPosition,
vbpi.pitcherRole,
tbp.power,
tbp.contact,
tbp.speed,
tbp.fielding,
tbp.arm,
tbp.velocity,
tbp.junk,
tbp.accuracy,
tbp.age,
traits.trait,
traits.subType,
battingOrder.battingOrder,
options.*
from v_baseball_player_info vbpi
join t_baseball_players tbp
on vbpi.baseballPlayerGUID = tbp.GUID
join t_teams team
on tbp.teamGUID = team.GUID
join t_baseball_player_local_ids localId
on localId.GUID = tbp.GUID
left join t_baseball_player_traits traits
on localId.localID = traits.baseballPlayerLocalID
left join t_baseball_player_options options
on localId.localID = options.baseballPlayerLocalID
left join t_batting_orders battingOrder
on vbpi.baseballPlayerGUID = battingOrder.baseballPlayerGUID
order by vbpi.lastName;
DUPLICATES
select
vbpi.firstName,
vbpi.lastName,
traits.trait,
traits.subType,
count(*)
from v_baseball_player_info vbpi
join t_baseball_players tbp
on vbpi.baseballPlayerGUID = tbp.GUID
join t_teams team
on tbp.teamGUID = team.GUID
join t_baseball_player_local_ids localId
on localId.GUID = tbp.GUID
left join t_baseball_player_traits traits
on localId.localID = traits.baseballPlayerLocalID
GROUP BY vbpi.firstName, vbpi.lastName
HAVING COUNT(*) > 1
whiffer
McGee,Brown,Kringer,Rojas,Nale,Batts
utility
Idoya,Fielder,Leathar,Efforto,Hand,Steak,Hobbes,rags
tough out
Dexterez,Gutterson,Bolter,Elyve,Crisp,Slam,Gold,Kauffman,Storm,
stealer
Nubswubbles,Sax,Jumps,Tools,Magikko,Baker,Miles,
pow vs rhp
Monstur,Steed,O'Ften,King,Hart,Starr,Stadkleef,Bobbit,Song,
pow vs lhp
Bigsby,Baskette,Miyoshi,Dingers,Rodriguez,Young Jr.,Plattune,Bergman,Gaspar,
RBI Man
Greene,Blastman,Jackman,Bambino,Manly,Vinicio,Goodwood,Studwick,Tantrum,Jones,Liner,
RBI Dud
Swanson,Oowanga,Berko,Yatter,Stern,Sandbrick,Nutmeg,
outside pitch
James,Sparks,Stanza,Straus,
low
Glover,Quaker,Fowl,Bags,Goyo,
inside
Evergreen,Hackman,Tobo,
high
LeBoink,Hampster,Moonshota,Blings,
contact v right
Woodburn,Wilson,Gobbleson,Pickleford,Yew,Trips,Addonomus,
contact v left
Hardman,Moore,Delgado,Yamamoto,Zoner,Young Sr.,Battery
bad JumpsRicky Quan
Candela,Dazzler,Swiner,Park,
trait2
Tobo,Dexterez,Storm,Tools,Manly,Sparks,Young Sr.,Berko,Steed,Yew,Dingers,King,Bigsby,Blastman,Yatter,Zoner,Stadkleef,Baskette,Rodriguez,O'Ften,