forked from tsweeney256/Pokedex
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathsqlstmts.hpp
140 lines (127 loc) · 3.68 KB
/
sqlstmts.hpp
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
//only PokemonData.cpp should ever include this file. It's purely for convenience
#ifndef SQLSTMTS_HPP_
#define SQLSTMTS_HPP_
#include <string>
std::string doubleImmuneToSQL(
"select distinct immunityidType "
"from Type_Immune_To "
"where (targetidType=? or targetidType=?) and immunityidType is not null");
std::string doubleNormalToSQL(
"select idType "
"from Type "
"except "
"select resistanceidType "
"from Type_Resistant_To "
"where (targetidType=? or targetidType=?) "
"except "
"select weaknessidType "
"from Type_Weak_To "
"where (targetidType=? or targetidType=?) "
"except "
"select immunityidType "
"from Type_Immune_To "
"where (targetidType=? or targetidType=?)");
std::string immuneToSQL(
"select distinct immunityidType "
"from Type_Immune_To "
"where targetidType=? and immunityidType is not null");
std::string normalToSQL(
"select idType "
"from Type "
"except "
"select resistanceidType "
"from Type_Resistant_To "
"where targetidType=? "
"except "
"select weaknessidType "
"from Type_Weak_To "
"where targetidType=? "
"except "
"select immunityidType "
"from Type_Immune_To "
"where targetidType=?");
std::string resistantToSQL(
"select distinct resistanceidType "
"from Type_Resistant_To "
"where targetidType=? and resistanceidType is not null");
std::string weakToSQL(
"select distinct weaknessidType "
"from Type_Weak_To "
"where targetidType=? and weaknessidType is not null");
std::string x2ResistantToSQL(
"select resistanceidType "
"from Type_Resistant_To "
"where (targetidType=? or targetidType=?) and resistanceidType is not null "
"except "
"select weaknessidType "
"from Type_Weak_To "
"where (targetidType=? or targetidType=?) "
"except "
"select immunityidType "
"from Type_Immune_To "
"where (targetidType=? or targetidType=?) "
"except "
"select resistanceidType "
"from ( "
"select resistanceidType "
"from Type_Resistant_To "
"where targetidType=? "
"intersect "
"select resistanceidType "
"from Type_Resistant_To "
"where targetidType=?)");
std::string x2WeakToSQL(
"select weaknessidType "
"from Type_Weak_To "
"where (targetidType=? or targetidType=?) and weaknessidType is not null "
"except "
"select resistanceidType "
"from Type_Resistant_To "
"where (targetidType=? or targetidType=?) "
"except "
"select immunityidType "
"from Type_Immune_To "
"where (targetidType=? or targetidType=?) "
"except "
"select weaknessidType "
"from ( "
"select weaknessidType "
"from Type_Weak_To "
"where targetidType=? "
"intersect "
"select weaknessidType "
"from Type_Weak_To "
"where targetidType=?)");
std::string x4ResistantToSQL(
"select resistanceidType "
"from Type_Resistant_To "
"where targetidType=? and resistanceidType is not null "
"intersect "
"select resistanceidType "
"from Type_Resistant_To "
"where targetidType=? "
"except "
"select weaknessidType "
"from Type_Weak_To "
"where (targetidType=? or targetidType=?) "
"except "
"select immunityidType "
"from Type_Immune_To "
"where (targetidType=? or targetidType=?)");
std::string x4WeakToSQL(
"select weaknessidType "
"from Type_Weak_To "
"where targetidType=? and weaknessidType is not null "
"intersect "
"select weaknessidType "
"from Type_Weak_To "
"where targetidType=? "
"except "
"select resistanceidType "
"from Type_Resistant_To "
"where (targetidType=? or targetidType=?) "
"except "
"select immunityidType "
"from Type_Immune_To "
"where (targetidType=? or targetidType=?)");
#endif /* SQLSTMTS_HPP_ */