- Trending Categories
Data Structure
Networking
RDBMS
Operating System
Java
iOS
HTML
CSS
Android
Python
C Programming
C++
C#
MongoDB
MySQL
Javascript
PHP
Physics
Chemistry
Biology
Mathematics
English
Economics
Psychology
Social Studies
Fashion Studies
Legal Studies
- Selected Reading
- UPSC IAS Exams Notes
- Developer's Best Practices
- Questions and Answers
- Effective Resume Writing
- HR Interview Questions
- Computer Glossary
- Who is Who
MySQL automatic conversion on lowercase? Is this possible?
Yes, it is possible with triggers. You can create trigger for automatic conversion on lower case. Let us first create a table −
mysql> create table DemoTable ( StudentSubject text ); Query OK, 0 rows affected (0.61 sec)
Let us create a trigger for automatic conversion on lower case −
mysql> CREATE TRIGGER lowerCaseOnInsertDemo BEFORE INSERT ON DemoTable FOR EACH ROW SET NEW.StudentSubject = LOWER(NEW.StudentSubject); Query OK, 0 rows affected (0.21 sec)
Insert some records in the table using insert command −
mysql> insert into DemoTable values('MOngoDb'); Query OK, 1 row affected (0.18 sec) mysql> insert into DemoTable values('JaVA'); Query OK, 1 row affected (0.12 sec) mysql> insert into DemoTable values('MySqL'); Query OK, 1 row affected (0.15 sec)
Display all records from the table using select statement −
mysql> select *from DemoTable;
This will produce the following output displaying the converted lowercase values −
+----------------+ | StudentSubject | +----------------+ | mongodb | | java | | mysql | +----------------+ 3 rows in set (0.00 sec)
- Related Articles
- Conversion of whole String to uppercase or lowercase using STL in C++
- A single MySQL select query on two tables is possible?
- ‘Avoid plastics as far as possible’. Comment on this advice.
- How is it possible to enter multiple MySQL statements on a single line?
- MySQL format time with lowercase am/pm?
- Is there a MySQL command to convert a string to lowercase?
- Automatic Repeat reQuest (ARQ)
- An erect and enlarged image of an object is formed on a screen. Explain how this could be possible.
- Is it possible to assign a reference to "this" in java?
- Is it possible to use $(this) and universal selector (*) with jQuery?
- Automatic resource management in Java
- Automatic Power Save Delivery (APSD)
- Is HTML5 canvas and image on polygon possible?
- MySQL automatic string to integer casting in WHERE clause to fetch a specific id
- What is maven automatic build tool in Java eclipse projects?

Advertisements