
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
394 Views
For this, use ORDER BY RAND() with subquery. Let us first create a table −mysql> create table DemoTable1853 ( UserId int NOT NULL AUTO_INCREMENT, PRIMARY KEY(UserId) ); Query OK, 0 rows affected (0.00 sec)Insert some records in the table using insert command ... Read More

AmitDiwan
145 Views
If you try to compare string to int, MySQL won’t raise an error because it converts string to int. Let us first create a table −mysql> create table DemoTable1852 ( Value1 varchar(20), Value2 int ); Query OK, 0 rows affected (0.00 sec)Insert ... Read More

AmitDiwan
2K+ Views
For this, use DELETE command. Let us first create a table −mysql> create table DemoTable1851 ( DueDate datetime ); Query OK, 0 rows affected (0.00 sec)Insert some records in the table using insert command −mysql> insert into DemoTable1851 values('2019-12-03 21:30:35'); Query OK, 1 row ... Read More

AmitDiwan
675 Views
Let us first create a table −mysql> create table DemoTable1850 ( OrderStatus varchar(20) ); Query OK, 0 rows affected (0.00 sec)Insert some records in the table using insert command −mysql> insert into DemoTable1850 values('Yes'); Query OK, 1 row affected (0.00 sec) mysql> insert into ... Read More

AmitDiwan
1K+ Views
For this, you can use IFNULL() or COALESCE(). Let us first create a table −mysql> create table DemoTable1849 ( ClientFirstName varchar(20), ClientLastName 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
826 Views
To add time to datetime, use ADDTIME() function in MySQL. Let us first create a table −mysql> create table DemoTable1848 ( ShippingDate datetime ); Query OK, 0 rows affected (0.00 sec)Insert some records in the table using insert command −mysql> insert into DemoTable1848 values('2019-10-11 ... Read More

AmitDiwan
471 Views
Let us first create a table −mysql> create table DemoTable1847 ( GameStatus ENUM('PENDING', 'COMPLETED', 'CANCELLED') ); Query OK, 0 rows affected (0.00 sec)Insert some records in the table using insert command −mysql> insert into DemoTable1847 values('PENDING'); Query OK, 1 row affected (0.00 sec) mysql> ... Read More

AmitDiwan
801 Views
For this, use MONTH() and YEAR(). Let us first create a table −mysql> create table DemoTable1846 ( PurchaseDate date ); Query OK, 0 rows affected (0.00 sec)Insert some records in the table using insert command −mysql> insert into DemoTable1846 values('2019-01-10'); Query OK, 1 row ... Read More

AmitDiwan
957 Views
For this, you can use the concept of INTERVAL and DATE_SUB(). Let us first create a table −mysql> create table DemoTable1845 ( ArrivalDate date ); Query OK, 0 rows affected (0.00 sec)Insert some records in the table using insert command −mysql> insert into DemoTable1845 ... Read More

AmitDiwan
4K+ Views
For this, you can use CONCAT() and round(). Let us first create a table −mysql> create table DemoTable1844 ( Number int, TotalNumber int ); Query OK, 0 rows affected (0.00 sec)Insert some records in the table using insert command −mysql> insert into ... Read More