MySQL + SQL · Lesson 59

MySQL String Functions

Common String Functions

Functionक्या करता हैExample → Result
CONCAT()text जोड़नाCONCAT('Mr ',name) → Mr Aman
UPPER()/LOWER()case बदलनाUPPER('abc') → ABC
LENGTH()लंबाईLENGTH('cat') → 3
SUBSTRING()text का हिस्साSUBSTRING('Hello',1,3) → Hel
TRIM()spaces हटानाTRIM(' hi ') → hi
REPLACE()text बदलनाREPLACE('a-b','-','/') → a/b

Example Query

SELECT CONCAT(name, ' (', class, ')') AS label,
       UPPER(name) AS caps
FROM students;

सारांश

  • CONCAT जोड़ता है, UPPER/LOWER case बदलते हैं, LENGTH गिनता है।
  • SUBSTRING निकालता है, TRIM साफ करता है, REPLACE बदलता है।
🔗

Share this topic with a friend

यह topic किसी दोस्त को भेजें

Found it useful? Send it to a classmate learning the same thing.

अच्छा लगा? जो दोस्त यही सीख रहा है, उसे भेज दीजिए।

💻 लाइव कोड एडिटर

इस पेज के प्रोग्राम यहीं तैयार हैं — चलाएँ, बदलें और सीखें। कुछ भी इंस्टॉल किए बिना।
OneCompiler द्वारा संचालित। कोड एडिटर में अपने आप आ जाता है — Run दबाकर आउटपुट देखें। अगर एडिटर न खुले तो नए टैब में खोलें.