Orkun Tahir Aran, PhD Profile picture
Associate Prof. in Health Sciences | Data Analyst & Scientist | Freelancer | Open to Work

Jun 13, 2022, 10 tweets

#Chapter VII of @OReillyMedia Learning SQL book - Data Generation, Manipulation, Conversion

note, this is a long chapter, so I divided it. Let's start

1. Working with string data (today's posts).
3 types of string;
- CHAR - 255 chars
- VARCHAR - 65K chars
- TEXT - see chapter II thread, can store up to 4 GB of data

2. the difference between them is only the stored char length, so keep Length restrictions in your mind.

Additional info, check sql_mode

3. Quotes
We can't use " ' " for quotes in SQL. However, there is a way to use them.

4. CHAR() function to get special characters such as ö,ç,ı
SELECT CHAR(128,129......)

5. LOCATE() function to find chars in string

6. STRCMP() function

Checks the position for the statements.
-1 if first statement is before the second
0 if they are the same
1 if the second statement is before the first

7. LIKE and REGEXP

Common used string expressions. finds the names ending with 'y'

Of course there are too many other string manipulation methods. see the documentation for these, and also leetcode and hackerrank challenges.

See you tomorrow.

Share this Scrolly Tale with your friends.

A Scrolly Tale is a new way to read Twitter threads with a more visually immersive experience.
Discover more beautiful Scrolly Tales like this.

Keep scrolling