✅5/50 | All SQL50 Explained
Code\nmysql []\nSELECT tweet_id\nFROM Tweets\nWHERE CHAR_LENGTH(content) > 15\n;\n\nmssql [MS SQL Server]\nSELECT tweet_id\nFROM Tweets\nWHERE LEN(content) > 15
# Code\n```mysql []\nSELECT tweet_id\nFROM Tweets\nWHERE CHAR_LENGTH(content) > 15\n;\n```\n```mssql [MS SQL Server]\nSELECT tweet_id\nFROM Tweets\nWHERE LEN(content) > 15;\n;\n```\n```oraclesql [Oracle]\nSELECT tweet_id\nFROM Tweets\nWHERE LENGTH(content) > 15\n;\n```\n```postgresql [PostgreSQL]\nSELECT tweet_id\nFROM Tweets\nWHERE CHAR_LENGTH(content) > 15\n;\n```\n```pythondata [Pandas]\n# Time: O(n) , Space: O(n) \nimport pandas as pd\n\ndef invalid_tweets(tweets: pd.DataFrame) -> pd.DataFrame:\n    return tweets[tweets[\'content\'].str.len()>15][[\'tweet_id\']]\n\n```\n### System differences\nMS SQL Server - **LEN()** is synonymous with CHAR_LENGTH() in MySQL.\nOracle - **LENGTH()** is synonymous with CHAR_LENGTH() in MySQL.\n## So why CHAR_LENGTH?\n\nLENGTH() counts in bytes. Some characters occupy more than one byte. CHAR_LENGTH() counts characters and is safer.\n\n\n![image.png](https://assets.leetcode.com/users/images/73262279-7fb0-49df-84d4-4dd9b1a43a3b_1728054905.1639714.png)\n\n\n# Order of Execution\n\n\n1. **FROM** Tweets\n2. **WHERE** The condition **CHAR_LENGTH(content)** > 15 is applied to filter rows\n3. **SELECT** tweet_id\n\n![image.png](https://assets.leetcode.com/users/images/8e79f743-e4a2-446a-811c-f4941d9a0d63_1727286203.1927686.png)\n![image.png](https://assets.leetcode.com/users/images/cdbcac52-b5c7-45e2-823e-87b59d33a741_1727295353.7574322.png)\n\n
['MySQL', 'Oracle', 'MS SQL Server', 'PostgreSQL', 'Pandas']