
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
84 Views
An immutable copy of a Period where all the Period elements are multiplied by a value can be obtained using the method multipliedBy() in the Period class in Java. This method requires a single parameter i.e. the value which is to be multiplied and it returns the immutable copy of ... Read More

Krantik Chavan
539 Views
Following is the syntax to GROUP BY in a select query on positive or negative values:select *from yourTableName group by -yourColumnName;Let us first create a table:mysql> create table DemoTable (Value int); Query OK, 0 rows affected (0.60 sec)Following is the query to insert some records in the table using insert ... Read More

Krantik Chavan
2K+ Views
You can use ORDER BY SUBSTRING() to order by certain part of a string in MySQL. Let us first create a table:mysql> create table DemoTable (UserId varchar(200)); Query OK, 0 rows affected (0.68 sec)Following is the query to insert records in the table using insert command:mysql> insert into DemoTable values('USER_1234'); ... Read More

Krantik Chavan
175 Views
With this, get the nanoseconds in days, hours and minutes. At first, set the Duration:Duration d1 = Duration.ofDays(5); Duration d2 = Duration.ofHours(20); Duration d3 = Duration.ofMinutes(15);Convert the above Duration to nanoseconds:System.out.println("Nanoseconds in 5 days = "+d1.toNanos()); System.out.println("Nanoseconds in 20 hours = "+d2.toNanos()); System.out.println("Nanoseconds in 15 minutes = "+d3.toNanos());Exampleimport java.time.Duration; public ... Read More

Krantik Chavan
1K+ Views
Create Instant from Epoch SecondExampleimport java.time.Instant; public class Demo { public static void main(String[] args) { Instant instant = Instant.ofEpochSecond(282829279); System.out.println(instant); } }Output1978-12-18T11:41:19ZCreate Instant from Epoch MillisecondsExampleimport java.time.Instant; public class Demo { public static void main(String[] args) { ... Read More

Krantik Chavan
131 Views
In order to remove every column in a table in MySQL, you can use DROP TABLE command. Following is the syntax:DROP TABLE yourTableName;Let us first create a table:mysql> create table DemoTable ( StudentId int NOT NULL AUTO_INCREMENT PRIMARY KEY, StudentFirstName varchar(20), StudentLastName varchar(20), StudentAge int, ... Read More

Krantik Chavan
241 Views
Create an Instant and get an Instant using milliseconds passed as parameter from the epoch of 1970-01- 01T00:00:00Z. This is done using ofEpochMilli():Instant instant = Instant.ofEpochMilli(342627282920l);Now, get the Epoch seconds from Instant:instant.getEpochSecond();Exampleimport java.time.Instant; public class Demo { public static void main(String[] args) { Instant instant = ... Read More

Krantik Chavan
241 Views
Create an Instant and get an Instant using milliseconds passed as parameter from the epoch of 1970-01- 01T00:00:00Z. This is done using ofEpochMilli():Instant instant = Instant.ofEpochMilli(342627282920l);Now, get the Epoch milliseconds from Instant:instant. toEpochMilli();Exampleimport java.time.Instant; public class Demo { public static void main(String[] args) { Instant instant ... Read More

Krantik Chavan
411 Views
Yes, you can write own MySQL function to use in MySQL queries. Following is the syntax:DELIMITER // CREATE FUNCTION yourFunctionName(optional parameters)) RETURNS yourDataType DETERMINISTIC NO SQL BEGIN yourStatements1 . . . . N END // DELIMITER ;We have used the CREATE FUNCTION above to create a custom function.Let us create ... Read More

Krantik Chavan
7K+ Views
The Central Processing Unit and the main memory are always very accurate and fast as compared with electromechanical input or output devices like printers, etc. Here in this case it is essential for us that the data lines of the computer are not engaged for a long time during communication ... Read More