
Data Structure
Networking
RDBMS
Operating System
Java
MS Excel
iOS
HTML
CSS
Android
Python
C Programming
C++
C#
MongoDB
MySQL
Javascript
PHP
- Selected Reading
- UPSC IAS Exams Notes
- Developer's Best Practices
- Questions and Answers
- Effective Resume Writing
- HR Interview Questions
- Computer Glossary
- Who is Who
AmitDiwan has Published 10744 Articles

AmitDiwan
505 Views
For this, use SUBSTRING_INDEX(). Let us first create a table −mysql> create table DemoTable1615 -> ( -> ListOfSubject text -> ); Query OK, 0 rows affected (0.81 sec)Insert some records in the table using insert command −mysql> insert into DemoTable1615 values('Python, Java, MySQL, MongoDB, C, C++, ASP.net'); ... Read More

AmitDiwan
95 Views
Let us first create a table −mysql> create table DemoTable1614 -> ( -> StudentName varchar(20), -> StudentScore int -> ); Query OK, 0 rows affected (0.78 sec)Insert some records in the table using insert command −mysql> insert into DemoTable1614 values('Adam', 65); Query OK, 1 row affected ... Read More

AmitDiwan
854 Views
Yes, you can use DATE() to get only date part in MySQL and you can use CURDATE() to get the current date in MySQL.The current date is as follows −mysql> select curdate(); +------------+ | curdate() | +------------+ | 2019-10-20 | +------------+ 1 row in set (0.00 sec)Let us first create ... Read More

AmitDiwan
1K+ Views
To get the size of selected rows, use CHAR_LENGTH(). Let us first create a table −mysql> create table DemoTable1612 -> ( -> FirstName varchar(20), -> LastName varchar(20) -> ); Query OK, 0 rows affected (0.87 sec)Insert some records in the table using insert command −mysql> insert ... Read More

AmitDiwan
256 Views
To combine multiple text records, use GROUP_CONCAT(). Let us first create a table −mysql> create table DemoTable1611 -> ( -> Value text -> ); Query OK, 0 rows affected (0.86 sec)Insert some records in the table using insert command −mysql> insert into DemoTable1611 values('John'); Query OK, 1 ... Read More

AmitDiwan
221 Views
For this, use ORDER BY clause along with CASE statement. Let us first create a table −mysql> create table DemoTable1610 -> ( -> Marks int, -> Name varchar(20) -> ) ; Query OK, 0 rows affected (0.51 sec)Insert some records in the table using insert command ... Read More

AmitDiwan
320 Views
The correct way is as follows −DELIMITER // CREATE PROCEDURE yourStoredProcedureName() BEGIN IF yourCondition then yourStatement1 ; else yourStatement2 ; END IF ; END // DELIMITER ;Let us now see an example and create a stored procedure −mysql> DELIMITER // mysql> CREATE PROCEDURE delimiter_demo() ... Read More

AmitDiwan
180 Views
For this, you can use UNION in MySQL. Let us first create a table −mysql> create table DemoTable1 -> ( -> Value int -> ) -> ; Query OK, 0 rows affected (0.48 sec)Insert some records in the table using insert command −mysql> insert into DemoTable1 ... Read More

AmitDiwan
412 Views
The select and insert statements are the minimum required MySQL user privileges to allow optimize and repair.You can use below syntax to give insert and select privileges to the user −grant insert, select on yourDatabaseName.* to 'yourUserName'@'localhost';At first, here is the query to create a user −mysql> create user 'Emma'@'localhost' ... Read More

AmitDiwan
170 Views
To implement a query like MySQL IN(), you need to use COUNT(), IF() along with LIKE operator. Let us first create a table −mysql> create table DemoTable -> ( -> Subject varchar(80) -> ); Query OK, 0 rows affected (0.58 sec)Insert some records in the table using ... Read More