Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commitd0c9816

Browse files
committed
Some sql
1 parent0cf1623 commitd0c9816

File tree

2 files changed

+33
-21
lines changed

2 files changed

+33
-21
lines changed

‎hackerrank/Sql/README.md

Lines changed: 33 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -97,53 +97,65 @@ FROM (
9797
)AS longest;
9898
```
9999

100-
###
101-
100+
###Weather Observation Station 6
101+
Query the list of CITY names starting with vowels (i.e., a, e, i, o, or u) from STATION. Your result cannot contain duplicates.
102102
```sql
103103
-- mysql
104-
104+
SELECT DISTINCT cityFROM stationWHERE (cityLIKE'a%'OR cityLIKE'e%'OR cityLIKE'i%'OR cityLIKE'o%'OR cityLIKE'u%');
105105
```
106106

107-
###
108-
107+
###Weather Observation Station 7
108+
Query the list of CITY names ending with vowels (a, e, i, o, u) from STATION. Your result cannot contain duplicates.
109109
```sql
110110
-- mysql
111-
111+
SELECT DISTINCT city
112+
FROM station
113+
WHERE city REGEXP'[aeiouAEIOU]$';
112114
```
113115

114-
###
115-
116+
###Weather Observation Station 8
117+
Query the list of CITY names from STATION which have vowels (i.e., a, e, i, o, and u) as both their first and last characters. Your result cannot contain duplicates.
116118
```sql
117119
-- mysql
118-
120+
SELECT DISTINCT city
121+
FROM station
122+
WHERE city REGEXP'^[aeiouAEIOU].*[aeiouAEIOU]$';
119123
```
120124

121-
###
122-
125+
###Weather Observation Station 9
126+
Query the list of CITY names from STATION that do not start with vowels. Your result cannot contain duplicates.
123127
```sql
124128
-- mysql
125-
129+
SELECT DISTINCT city
130+
FROM station
131+
WHERE NOT city REGEXP'^[aeiouAEIOU]';
126132
```
127133

128-
###
129-
134+
###Weather Observation Station 10
135+
Query the list of CITY names from STATION that do not end with vowels. Your result cannot contain duplicates.
130136
```sql
131137
-- mysql
132-
138+
SELECT DISTINCT city
139+
FROM station
140+
WHERE NOT city REGEXP'[aeiouAEIOU]$';
133141
```
134142

135-
###
136-
143+
###Weather Observation Station 11
144+
Query the list of CITY names from STATION that either do not start with vowels or do not end with vowels. Your result cannot contain duplicates.
137145
```sql
138146
-- mysql
139-
147+
SELECT DISTINCT city
148+
FROM station
149+
WHERE NOT city REGEXP'^[aeiouAEIOU].*[aeiouAEIOU]$';
140150
```
141151

142-
###
143-
152+
###Weather Observation Station 12
153+
Query the list of CITY names from STATION that do not start with vowels and do not end with vowels. Your result cannot contain duplicates.
144154
```sql
145155
-- mysql
146-
156+
SELECT DISTINCT city
157+
FROM station
158+
WHERE NOT (city REGEXP'^[aeiouAEIOU]'OR city REGEXP'[aeiouAEIOU]$');
147159
```
148160

149161
###

‎hackerrank/Sql/students.png

10 KB
Loading

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp