Description
Write a SQL query to find tweet IDs where content length is strictly greater than 15. Return tweet_id.
Table:
tweets| Column | Type |
|---|---|
| tweet_id | INT |
| content | TEXT |
Examples
Input:
CREATE TABLE tweets (tweet_id INT, content TEXT); INSERT INTO tweets VALUES (1, 'Hello World'), (2, 'This is a very long tweet that exceeds fifteen');Output:
2Explanation:
Tweet 1 has 11 characters. Tweet 2 has 46 characters which is > 15, so it's returned.
Input:
CREATE TABLE tweets (tweet_id INT, content TEXT); INSERT INTO tweets VALUES (1, 'Short tweet'), (2, 'Exactly fifteen!'), (3, 'Just a bit longer than the limit'), (4, 'Hi');Output:
2
3Explanation:
Tweet 1 has 11 characters, tweet 2 has 16 characters (>15), tweet 3 has 32 characters (>15), and tweet 4 has 2 characters. Tweets 2 and 3 exceed the 15-character limit.
Input:
CREATE TABLE tweets (tweet_id INT, content TEXT); INSERT INTO tweets VALUES (5, 'Learning SQL is fun and exciting today'), (6, 'Yes'), (7, 'Programming challenges help us grow'), (8, 'Maybe tomorrow');Output:
5
7Explanation:
Tweet 5 has 38 characters, tweet 6 has 3 characters, tweet 7 has 35 characters, and tweet 8 has 14 characters. Tweets 5 and 7 both have more than 15 characters.
Constraints
- •
Use LENGTH function