
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
673 Views
To set default value for empty row, use the concept of COALESCE(). Let us first create a table −mysql> create table DemoTable1863 ( FirstName varchar(20) ); Query OK, 0 rows affected (0.00 sec)Insert some records in the table using insert command −mysql> insert into ... Read More

AmitDiwan
227 Views
For this, use the concept of GREATEST(). Let us first create a table −mysql> create table DemoTable1862 ( Value1 int, Value2 int, Value3 int, Value4 int ); Query OK, 0 rows affected (0.00 sec)Insert some records in the ... Read More

AmitDiwan
452 Views
For this, you can use GROUP BY HAVING with subquery. Let us first create a table −mysql> create table DemoTable1861 ( Id int NOT NULL AUTO_INCREMENT PRIMARY KEY, Name varchar(20), Marks int ); Query OK, 0 rows affected (0.00 sec)Insert ... Read More

AmitDiwan
558 Views
For this, you can use SELECT INTO. Let us first create a table −mysql> create table DemoTable1860 ( Amount int ); Query OK, 0 rows affected (0.00 sec)Insert some records in the table using insert command −mysql> insert into DemoTable1860 values(1590); Query OK, 1 ... Read More

AmitDiwan
222 Views
Yes, use the ALTER command with RENAME. Let us first create a table −mysql> create table DemoTable1859 ( Id int ); Query OK, 0 rows affected (0.00 sec)Insert some records in the table using insert command −mysql> insert into DemoTable1859 values(101); Query OK, 1 ... Read More

AmitDiwan
679 Views
For this, use GROUP BY HAVING clause. Let us first create a table −mysql> create table DemoTable1858 ( ModelNumber varchar(50) ); Query OK, 0 rows affected (0.00 sec)Insert some records in the table using insert command −mysql> insert into DemoTable1858 values('Audi A4'); Query OK, ... Read More

AmitDiwan
1K+ Views
For this, you can use SUBSTRING_INDEX(). Let us first create a table −mysql> create table DemoTable1857 ( Name varchar(20) ); Query OK, 0 rows affected (0.00 sec)Insert some records in the table using insert command −mysql> insert into DemoTable1857 values('John-Smith'); Query OK, 1 row ... Read More

AmitDiwan
171 Views
To fix, use group_concat() with addition of 0 with column. Let us first create a table −mysql> create table DemoTable1856 ( Id int, Value bit(1) ); Query OK, 0 rows affected (0.00 sec)Insert some records in the table using insert command −mysql> ... Read More

AmitDiwan
989 Views
To store BloodType, use varchar(3) or ENUM. Let us first create a table −mysql> create table DemoTable1855 ( BloodType varchar(3) ); Query OK, 0 rows affected (0.00 sec)Insert some records in the table using insert command −mysql> insert into DemoTable1855 values('A+'); Query OK, 1 ... Read More

AmitDiwan
194 Views
To find distinct number of specific items, use COUNT() along with GROUP BY clause. Let us first create a table −mysql> create table DemoTable1854 ( Name varchar(20) ); Query OK, 0 rows affected (0.00 sec)Insert some records in the table using insert command −mysql> ... Read More