
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
Krantik Chavan has Published 278 Articles

Krantik Chavan
826 Views
In order to select particular range of values in a MySQL table, you can use WHERE clause. Let us first create a table:mysql> create table DemoTable ( CustomerId int NOT NULL AUTO_INCREMENT PRIMARY KEY, CustomerName varchar(200), CustomerAge int, isRegularCustomer bool ); Query OK, 0 rows affected ... Read More

Krantik Chavan
234 Views
To get Age using BirthDate column in a MySQL query, you can use datediff(). Let us first create a table:mysql> create table DemoTable ( Id int NOT NULL AUTO_INCREMENT PRIMARY KEY, DateOfBirth date ); Query OK, 0 rows affected (1.46 sec)Following is the query to insert some records ... Read More

Krantik Chavan
2K+ Views
To perform Regex search on integer value, you need to use $where operator. The syntax is as follows:db.yourCollectionName.find({ $where: "/^yourIntegerPatternValue.*/.test(this.yourFieldName)" });To understand the above concept, let us create a collection with document. The query to create a collection with document is as follows:> db.regExpOnIntegerDemo.insertOne({"StudentId":2341234}); { "acknowledged" : true, ... Read More

Krantik Chavan
723 Views
To get the names beginning with a particular character, you need to use LIKE. Let us first create a table:mysql> create table DemoTable ( StudentFirstName varchar(20) ); Query OK, 0 rows affected (1.01 sec)Following is the query to insert some records in the table using insert command:mysql> insert into ... Read More

Krantik Chavan
1K+ Views
To convert string to 24 hour datetime format in MySQL, you can use STR_TO_DATE() method. With that use the following format for datetime as the parameter:'%Y-%m-%d %H:%i:%s'Following is the syntaxSELECT STR_TO_DATE(yourColumnName, '%Y-%m-%d %H:%i:%s') FROM yourTableName;Let us first create a table:mysql> create table DemoTable (ArrivalDate varchar(200)); Query OK, 0 rows affected ... Read More

Krantik Chavan
851 Views
If you’re using InnoDB engine, then you cannot set auto_increment value of tables to lower value. You need to change your engine from InnoDB to MyISAM.Note: The engine MyISAM allows you to set lower value. Here, we are using the same.According to the official documents:You cannot reset the counter to ... Read More

Krantik Chavan
77 Views
The total number of months for a particular Period can be obtained using the toTotalMonths() method in the Period class in Java. This method requires no parameters and it returns the total number of months in the Period in the form of a long value.A program that demonstrates this is ... Read More

Krantik Chavan
108 Views
The Period can be obtained with the given number of days, months and years using the of() method in the Period class in Java. This method requires a 3 parameters i.e. the number of days, the number of months and the number of years. Also, it returns the Period object ... Read More

Krantik Chavan
537 Views
The Period instance can be obtained from a string value using the parse() method in the Period class in Java. This method requires a single parameter i.e. the string which is to be parsed. This string cannot be null. Also, it returns the Period instance obtained from the string value ... Read More

Krantik Chavan
114 Views
An instance of a Period object can be obtained from a Temporal object using the from() method in the Period class in Java. This method requires a single parameter i.e. the TemporalAmount and it returns the Period object that is obtained.A program that demonstrates this is given as followsExample Live Demoimport ... Read More