Skip to content

Commit 7b9f73b

Browse files
authored
Create 1683. Invalid Tweets
SELECT tweet_id FROM tweets WHERE CHAR_LENGTH(content) > 15 (strictly > 15)
1 parent 7f3099b commit 7b9f73b

File tree

1 file changed

+50
-0
lines changed

1 file changed

+50
-0
lines changed

1683. Invalid Tweets

Lines changed: 50 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,50 @@
1+
/*
2+
Problem Description:
3+
4+
+----------------+---------+
5+
| Column Name | Type |
6+
+----------------+---------+
7+
| tweet_id | int |
8+
| content | varchar |
9+
+----------------+---------+
10+
tweet_id is the primary key for this table.
11+
This table contains all the tweets in a social media app.
12+
13+
14+
15+
Write an SQL query to find the IDs of the invalid tweets. The tweet is invalid if the number of characters used in the content of the tweet is strictly greater than 15.
16+
17+
Return the result table in any order.
18+
19+
20+
The query result format is in the following example.
21+
22+
23+
24+
Example 1:
25+
26+
Input:
27+
Tweets table:
28+
+----------+----------------------------------+
29+
| tweet_id | content |
30+
+----------+----------------------------------+
31+
| 1 | Vote for Biden |
32+
| 2 | Let us make America great again! |
33+
+----------+----------------------------------+
34+
Output:
35+
+----------+
36+
| tweet_id |
37+
+----------+
38+
| 2 |
39+
+----------+
40+
Explanation:
41+
Tweet 1 has length = 14. It is a valid tweet.
42+
Tweet 2 has length = 32. It is an invalid tweet.
43+
44+
*/
45+
46+
# Write your MySQL query statement below
47+
48+
SELECT tweet_id
49+
FROM tweets
50+
WHERE CHAR_LENGTH(content) > 15

0 commit comments

Comments
 (0)