
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
773 Views
Let us first create a table −mysql> create table DemoTable ( Value varchar(100) ); Query OK, 0 rows affected (0.75 sec)Insert some records in the table using insert command −mysql> insert into DemoTable values('100'); Query OK, 1 row affected (0.17 sec) mysql> insert into DemoTable values(''); Query OK, 1 ... Read More

AmitDiwan
184 Views
Use BETWEEN to find the logins between two dates. Let us first create a table −mysql> create table DemoTable ( Login datetime ); Query OK, 0 rows affected (0.66 sec)Insert some records in the table using insert command −mysql> insert into DemoTable values('2019-08-10'); Query OK, 1 row affected (0.11 ... Read More

AmitDiwan
556 Views
Let us first create a table −mysql> create table DemoTable1045 ( Id int NOT NULL AUTO_INCREMENT PRIMARY KEY, FirstName varchar(100) )AUTO_INCREMENT=100; Query OK, 0 rows affected (0.62 sec)Insert some records in the table using insert command −mysql> insert into DemoTable1045(FirstName) values('John'); Query OK, 1 row affected (0.15 sec) ... Read More

AmitDiwan
144 Views
For this, use ORDER BY LIKE operator. Let us first create a table −mysql> create table DemoTable ( Name varchar(100) ); Query OK, 0 rows affected (0.60 sec)Insert some records in the table using insert command −mysql> insert into DemoTable values('John'); Query OK, 1 row affected (0.17 sec) mysql> ... Read More

AmitDiwan
465 Views
Use MAX() along with subquery for this Here, MAX() is used to get the maximum amount. Let us first create a table −mysql> create table DemoTable ( ProductId int NOT NULL AUTO_INCREMENT PRIMARY KEY, ProductName varchar(100), ProductAmount int ); Query OK, 0 rows affected (0.53 sec)Insert some ... Read More

AmitDiwan
342 Views
To compare the first date with the last date, use TIME_TO_SEC() along with MAX() and MIN(). Let us first create a table −mysql> create table DemoTable ( UserName varchar(100), UserPostDatetime datetime ); Query OK, 0 rows affected (0.65 sec)Insert some records in the table using insert command −mysql> ... Read More

AmitDiwan
772 Views
Let us first create a table −mysql> create table DemoTable ( Id int, Name varchar(100) ); Query OK, 0 rows affected (0.60 sec)Insert some records in the table using insert command −mysql> insert into DemoTable values(100, 'Chris'); Query OK, 1 row affected (0.16 sec) mysql> insert into DemoTable ... Read More

AmitDiwan
298 Views
For this, use the CASE WHEN statement. Let us first create a table −mysql> create table DemoTable1040 ( Value1 int, Value2 int, Value3 int ); Query OK, 0 rows affected (0.65 sec)Insert some records in the table using insert command −mysql> insert into DemoTable1040 values(10, 30, 1); ... Read More

AmitDiwan
375 Views
To get the left substring, use LEFT() along with substring_index(). For example, let’s say the file path is −“/MyFile/JavaProgram/Hello.java “Here, we will see how to display the entire file path except for the file name i.e. −/MyFile/JavaProgram/Let us first create a table −mysql> create table DemoTable ( FileLocation text ... Read More

AmitDiwan
330 Views
To get the fourth-highest value, use LIMIT OFFSET along with ORDER BY. Let us first create a table −mysql> create table DemoTable ( Amount int ); Query OK, 0 rows affected (0.88 sec)Insert some records in the table using insert command −mysql> insert into DemoTable values(980); Query OK, 1 ... Read More