
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
204 Views
Yes, you can give the year as a column name in MySQL table since it isn’t a reserved word. Let us first create a table −mysql> create table DemoTable ( Year int ); Query OK, 0 rows affected (0.87 sec)Insert some records in the table using insert command −mysql> ... Read More

AmitDiwan
369 Views
To concatenate rows on the basis of boolean value in another column, use GROUP_CONCAT(). Let us first create a table. Here, we have set one of the columns “isValidUser” as BOOLEAN −mysql> create table DemoTable ( Id int NOT NULL AUTO_INCREMENT PRIMARY KEY, UserMessage varchar(100), isValidUser boolean ... Read More

AmitDiwan
147 Views
To ORDER BY letters, use ORDER BY SUBSTRING(). Let us first create a table −mysql> create table DemoTable ( Id varchar(100) ); Query OK, 0 rows affected (0.65 sec)Insert some records in the table using insert command −mysql> insert into DemoTable values('456 John Smith'); Query OK, 1 row affected ... Read More

AmitDiwan
179 Views
To fetch the maximum value, use any of the below-given syntaxes −select max(yourColumnName) from yourTableName; OR select *from yourTableName order by yourColumnName desc limit 1;Let us first create a table −mysql> create table DemoTable ( Value int ); Query OK, 0 rows affected (0.84 sec)Insert some records in the ... Read More

AmitDiwan
535 Views
For alphabetic search, use the REGEX in MySQL. Here, let’s say we are searching for records beginning with A, B or C. The syntax to use REGEXP for the same purpose is as follows −select *from yourTableName where yourColumnName REGEXP '^[ABC]';Let us first create a table −mysql> create table DemoTable ... Read More

AmitDiwan
630 Views
TRIM is used to remove leading and trailing spaces. Let us first create a table −mysql> create table DemoTable ( StudentName varchar(100) ); Query OK, 0 rows affected (0.64 sec)Insert some records in the table using insert command. Here, we have inserted records with leading and trailing whitespaces −mysql> ... Read More

AmitDiwan
4K+ Views
Let us first create a table −mysql> create table DemoTable ( DueDate date ); Query OK, 0 rows affected (0.56 sec)Insert some records in the table using insert command −mysql> insert into DemoTable values('2018-10-01'); Query OK, 1 row affected (0.14 sec) mysql> insert into DemoTable values('2016-12-31'); Query OK, 1 ... Read More

AmitDiwan
264 Views
Let us first create a table −mysql> create table DemoTable ( AdmissionDate varchar(100) ); Query OK, 0 rows affected (0.76 sec)Insert some records in the table using insert command −mysql> insert into DemoTable values('Sunday, 11 August 2019'); Query OK, 1 row affected (0.10 sec) mysql> insert into DemoTable values('Friday, ... Read More

AmitDiwan
319 Views
Let us first create a table −mysql> create table DemoTable ( Id int NOT NULL AUTO_INCREMENT PRIMARY KEY, Value1 int, Value2 int ); Query OK, 0 rows affected (0.55 sec)Insert some records in the table using insert command −mysql> insert into DemoTable(Value1, Value2) values(100, 150); Query OK, ... Read More

AmitDiwan
539 Views
To replace, use REPLACE() function from MySQL. Let us first create a table −mysql> create table DemoTable ( Number varchar(100) ); Query OK, 0 rows affected (0.86 sec)Insert some records in the table using insert command −mysql> insert into DemoTable values('+916578675547'); Query OK, 1 row affected (0.17 sec) mysql> ... Read More