Skip to content

Commit 015acfe

Browse files
committed
update ex_1
1 parent 3915fec commit 015acfe

File tree

1 file changed

+246
-1
lines changed

1 file changed

+246
-1
lines changed

ex_1.md

Lines changed: 246 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,18 @@
1-
# Question
1+
# Exercise 1
22

33

44
## ex_01
55

66
寫出可以得到下方結果的 SQL 語句
77

88
Answer
9+
910
```sql
1011
/* SOME SQL STATEMENT */
1112
```
1213

1314
Output
15+
1416
```
1517
+-----------+-----------+-----------+
1618
| lastname | firstname | jobtitle |
@@ -34,4 +36,247 @@ Output
3436
| Gerard | Martin | Sales Rep |
3537
+-----------+-----------+-----------+
3638
17 rows in set (0.00 sec)
39+
```
40+
41+
## ex_02
42+
43+
寫出可以得到下方結果的 SQL 語句
44+
45+
Answer
46+
47+
```sql
48+
/* SOME SQL STATEMENT */
49+
```
50+
51+
Output
52+
53+
```
54+
+----------+-----------+-----------+------------+
55+
| lastname | firstname | jobtitle | officeCode |
56+
+----------+-----------+-----------+------------+
57+
| Jennings | Leslie | Sales Rep | 1 |
58+
| Thompson | Leslie | Sales Rep | 1 |
59+
+----------+-----------+-----------+------------+
60+
2 rows in set (0.00 sec)
61+
```
62+
63+
## ex_03
64+
65+
寫出可以得到下方結果的 SQL 語句
66+
67+
Answer
68+
69+
```sql
70+
/* SOME SQL STATEMENT */
71+
```
72+
73+
Output
74+
75+
```
76+
+-----------+-----------+------------+
77+
| firstName | lastName | officeCode |
78+
+-----------+-----------+------------+
79+
| Diane | Murphy | 1 |
80+
| Mary | Patterson | 1 |
81+
| Jeff | Firrelli | 1 |
82+
| Anthony | Bow | 1 |
83+
| Leslie | Jennings | 1 |
84+
| Leslie | Thompson | 1 |
85+
| Julie | Firrelli | 2 |
86+
| Steve | Patterson | 2 |
87+
| Foon Yue | Tseng | 3 |
88+
| George | Vanauf | 3 |
89+
+-----------+-----------+------------+
90+
10 rows in set (0.00 sec)
91+
```
92+
93+
94+
## ex_04
95+
96+
寫出可以得到下方結果的 SQL 語句
97+
98+
Answer
99+
100+
```sql
101+
/* SOME SQL STATEMENT */
102+
```
103+
104+
Output
105+
106+
```
107+
+-----------------+------------------+
108+
| contactLastname | contactFirstname |
109+
+-----------------+------------------+
110+
| Young | Jeff |
111+
| Young | Julie |
112+
| Young | Mary |
113+
| Young | Dorothy |
114+
| Yoshido | Juri |
115+
| Walker | Brydey |
116+
| Victorino | Wendy |
117+
| Urs | Braun |
118+
| Tseng | Jerry |
119+
....
120+
```
121+
122+
123+
## ex_05
124+
125+
寫出可以得到下方結果的 SQL 語句
126+
127+
Answer
128+
129+
```sql
130+
/* SOME SQL STATEMENT */
131+
```
132+
133+
Output
134+
135+
```
136+
+-----------+-----------+------------+
137+
| lastname | firstname | officeCode |
138+
+-----------+-----------+------------+
139+
| Patterson | William | 6 |
140+
| Bott | Larry | 7 |
141+
| Jones | Barry | 7 |
142+
| Fixter | Andy | 6 |
143+
| Marsh | Peter | 6 |
144+
| King | Tom | 6 |
145+
+-----------+-----------+------------+
146+
6 rows in set (0.00 sec)
147+
```
148+
149+
150+
## ex_06
151+
152+
寫出可以得到下方結果的 SQL 語句
153+
154+
Answer
155+
156+
```sql
157+
/* SOME SQL STATEMENT */
158+
```
159+
160+
Output
161+
162+
```
163+
+----------+-----------+-----------+------------+
164+
| lastname | firstname | jobtitle | officeCode |
165+
+----------+-----------+-----------+------------+
166+
| Jennings | Leslie | Sales Rep | 1 |
167+
| Thompson | Leslie | Sales Rep | 1 |
168+
+----------+-----------+-----------+------------+
169+
2 rows in set (0.00 sec)
170+
```
171+
172+
173+
## ex_07
174+
175+
寫出可以得到下方結果的 SQL 語句
176+
177+
Answer
178+
179+
```sql
180+
/* SOME SQL STATEMENT */
181+
```
182+
183+
Output
184+
185+
```
186+
+-----------+
187+
| lastname |
188+
+-----------+
189+
| Bondur |
190+
| Bott |
191+
| Bow |
192+
| Castillo |
193+
| Firrelli |
194+
195+
...
196+
| Nishi |
197+
| Patterson |
198+
| Thompson |
199+
| Tseng |
200+
| Vanauf |
201+
+-----------+
202+
19 rows in set (0.01 sec)
203+
```
204+
205+
206+
## ex_08
207+
208+
寫出可以得到下方結果的 SQL 語句
209+
210+
Answer
211+
212+
```sql
213+
/* SOME SQL STATEMENT */
214+
```
215+
216+
Output
217+
218+
```
219+
+------------------------------+---------+-------+
220+
| customername | country | state |
221+
+------------------------------+---------+-------+
222+
| Mini Gifts Distributors Ltd. | USA | CA |
223+
| Mini Wheels Co. | USA | CA |
224+
| Technics Stores Inc. | USA | CA |
225+
| Toys4GrownUps.com | USA | CA |
226+
| Boards & Toys Co. | USA | CA |
227+
| Collectable Mini Designs Co. | USA | CA |
228+
| Corporate Gift Ideas Co. | USA | CA |
229+
| Men 'R' US Retailers, Ltd. | USA | CA |
230+
| The Sharp Gifts Warehouse | USA | CA |
231+
| West Coast Collectables Co. | USA | CA |
232+
| Signal Collectibles Ltd. | USA | CA |
233+
+------------------------------+---------+-------+
234+
11 rows in set (0.00 sec)
235+
```
236+
237+
## ex_09
238+
239+
寫出可以得到下方結果的 SQL 語句
240+
241+
Answer
242+
243+
```sql
244+
/* SOME SQL STATEMENT */
245+
```
246+
247+
Output
248+
249+
```
250+
+------------------------------+---------+-------+-------------+
251+
| customername | country | state | creditlimit |
252+
+------------------------------+---------+-------+-------------+
253+
| Mini Gifts Distributors Ltd. | USA | CA | 210500.00 |
254+
| Collectable Mini Designs Co. | USA | CA | 105000.00 |
255+
| Corporate Gift Ideas Co. | USA | CA | 105000.00 |
256+
+------------------------------+---------+-------+-------------+
257+
3 rows in set (0.00 sec)
258+
```
259+
260+
## ex_10
261+
262+
寫出可以得到下方結果的 SQL 語句
263+
264+
Answer
265+
266+
```sql
267+
/* SOME SQL STATEMENT */
268+
```
269+
270+
Output
271+
272+
```
273+
+------------+---------------+-----------------+---------+
274+
| officeCode | city | phone | country |
275+
+------------+---------------+-----------------+---------+
276+
| 1 | San Francisco | +1 650 219 4782 | USA |
277+
| 2 | Boston | +1 215 837 0825 | USA |
278+
| 3 | NYC | +1 212 555 3000 | USA |
279+
| 4 | Paris | +33 14 723 4404 | France |
280+
+------------+---------------+-----------------+---------+
281+
4 rows in set (0.01 sec)
37282
```

0 commit comments

Comments
 (0)