Grokking SQL for Tech Interviews
Vote

0% completed

25. Long Comments (Easy)

Problem Statement

Table: Comments
Each row in this table represents a comment made by a user, identified by comment_id, and includes the text of the comment.

+-------------+---------+
| Column Name | Type    |
+-------------+---------+
| comment_id  | int     |
| text        | varchar |
+-------------+---------+
comment_id is the primary key for this table.
This table can contain duplicate rows.

Develop a solution to identify comments that are considered too long. A comment is deemed too long if it consists of more than 100 characters, including spaces and punctuation

.....

.....

.....

Like the course? Get enrolled and start learning!
Christopher Guy Slater

Christopher Guy Slater

· 4 days ago

-- CHAR_LENGTH() function counts actual character length -- LENGTH() function counts bytes SELECT comment_id   FROM Comments WHERE CHAR_LENGTH(text) > 100;

Reading Progress

0%