- Trending Categories
- Data Structure
- Networking
- RDBMS
- Operating System
- Java
- MS Excel
- iOS
- HTML
- CSS
- Android
- Python
- C Programming
- C++
- C#
- MongoDB
- MySQL
- Javascript
- PHP
- Physics
- Chemistry
- Biology
- Mathematics
- English
- Economics
- Psychology
- Social Studies
- Fashion Studies
- Legal Studies
- Selected Reading
- UPSC IAS Exams Notes
- Developer's Best Practices
- Questions and Answers
- Effective Resume Writing
- HR Interview Questions
- Computer Glossary
- Who is Who
George John has Published 1167 Articles
George John
65 Views
To get floor key means to return the greatest key less than or equal to the given key, or null if there is no such key. This can be done with the floorKey() metho.The following is an example to get floor key from NavigableMapExample Live Demoimport java.util.*; public class Demo { ... Read More
George John
3K+ Views
Format the date DD/MM/YYYY using select and order by in descending order. The syntax is as follows −SELECT *FROM yourTableName where yourDatetimeColumnName order by STR_TO_DATE(yourDatetimeColumnName, ’%d/%m%Y’) desc;The above syntax will give the date in descending order. To understand the above syntax, let us first create a table. The query to ... Read More
George John
222 Views
To select max of mixed string/int column, you need to use substring() function. The syntax is as follows:SELECT MAX(CAST(SUBSTRING(yourColumnName, 4, length(yourColumnName)-3) AS UNSIGNED)) AS anyVariableName FROM yourTableName;To understand the above syntax, let us create a table. The query to create a table is as follows:mysql> create table StringIntMixHighestDemo -> ... Read More
George John
4K+ Views
To select the last 6 months records from news table, use the date_sub() function from MySQL since news records are arranged according to date.The syntax is as follows −select *from yourTableName where yourDateTimeColumnName >= date_sub(now(), interval 6 month);To understand the above concept, let us first create a NEWS table with ... Read More
George John
3K+ Views
To cut only the first character, use the substr() function with UPDATE command. The syntax is as follows.UPDATE yourTableName set yourColumnName=substr(yourColumnName, 2);To understand the above syntax, let us first create a table. The query to create a table is as follows.mysql> create table CutStringDemo -> ( -> Value varchar(100) -> ... Read More
George John
3K+ Views
To connect MySQL from the command line, firstly open command prompt. You can do this with the help of shortcut key “Windows + R”. On clicking, a panel will open and you need to type CMD and need to press OK button as shown below −After pressing the OK button, ... Read More
George John
2K+ Views
For this, you can insert using MySQL dual table. Let us create a table to understand the concept conditional insert. The query to create a table is as follows −mysql> create table ConditionalInsertDemo -> ( -> UserId int, -> TotalUser int, -> NumberOfItems int -> ... Read More
George John
122 Views
The \G modifier gets the result in vertical order. If you use \g modifier, then it won’t affect the result. The \g works likesemi-colon.Let us first create a table. The query to create a table is as follows:mysql> create table DemoOfVertical -> ( -> Id int NOT NULL ... Read More
George John
1K+ Views
To display current configuration variables, you can use show command. The syntax is as follows −show variables;You can further rewrite the above syntax with LIKE operator. The syntax is as follows −show variables like ‘%anyStringValue%’;The query is as follows displaying an example to fetch some of the configuration variables −mysql> ... Read More
George John
2K+ Views
To select rows where a column is null, you can use IS NULL from MySQL with the help of where clause.The syntax is as follows −select *from yourTableName where yourColumnName IS NULL;Let us first create a table to understand the concept −mysql> create table NULLDemo1 -> ( ... Read More