- 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
Karthikeya Boyini has Published 2383 Articles
karthikeya Boyini
1K+ Views
To select dates in 30-day range, you can use arithmetic operation - with interval.The syntax is as follows −select *from yourTableName where yourDateColumnName > NOW() - INTERVAL 30 DAY and yourDateColumnName < NOW() + INTERVAL 30 DAY;To understand the above syntax, let us create a table. The query to create ... Read More
karthikeya Boyini
93 Views
To query MongoDB using the $ne operator, following is the syntax −db.yourCollectionName.find({yourFieldName:{$ne:yourValue}}).pretty();Let us create a collection with documents −> db.notEqaulToDemo.insertOne({"StudentName":"Larry", "StudentMathMarks":68}); { "acknowledged" : true, "insertedId" : ObjectId("5cbd3a6bde8cc557214c0ded") } > db.notEqaulToDemo.insertOne({"StudentName":"Chris", "StudentMathMarks":88}); { "acknowledged" : true, "insertedId" : ObjectId("5cbd3a79de8cc557214c0dee") } > db.notEqaulToDemo.insertOne({"StudentName":"David", "StudentMathMarks":45}); { "acknowledged" ... Read More
karthikeya Boyini
110 Views
The hash code value of the duration can be obtained using the hashCode() method in the Duration class in Java. This method requires no parameters and it returns the hash code value of the duration.A program that demonstrates this is given as follows −Example Live Demoimport java.time.Duration; public class Demo { ... Read More
karthikeya Boyini
98 Views
To create a Triplet tuple from Array in Java, you need to use the fromArray() method.Let us first see what we need to work with JavaTuples. To work with Triplet class in JavaTuples, you need to import the following package −import org.javatuples.Triplet;Note − Steps to download and run JavaTuples program ... Read More
karthikeya Boyini
2K+ Views
An immutable copy of a instant where a time unit is added to it can be obtained using the plus() method in the Instant class in Java. This method requires two parameters i.e. time to be added to the instant and the unit in which it is to be added. ... Read More
karthikeya Boyini
310 Views
A duplicate buffer of a buffer can be created using the method duplicate() in the class java.nio.ByteBuffer. This duplicate buffer is identical to the original buffer. The method duplicate() returns the duplicate buffer that was created.A program that demonstrates this is given as follows −Example Live Demoimport java.nio.*; import java.util.*; public ... Read More
karthikeya Boyini
682 Views
To remove hyphens using MySQL update, you can use replace() function. The syntax is as follows −update yourTableName set yourColumnName=replace(yourColumnName, '-', '' );To understand the above syntax, let us create a table. The query to create a table is as follows −mysql> create table removeHyphensDemo -> ( ... Read More
karthikeya Boyini
158 Views
To get the count of the number of documents in a collection MongoDB, you can use the below syntax −db.getCollectionNames().map(function(anyVariableName) { return { "yourVariableName": yourVariableName, "count": db[yourVariableName].count() } });Here, we are using ‘test’ database.Let us implement the above syntax to get the count of the number of documents in ... Read More
karthikeya Boyini
80 Views
An immutable copy of a duration where some seconds are removed from it can be obtained using the minusSeconds() method in the Duration class in Java. This method requires a single parameter i.e. the number of seconds to be subtracted and it returns the duration with the subtracted seconds.A program ... Read More
karthikeya Boyini
103 Views
It can be checked if a ChronoUnit is supported by the Instant class or not by using the isSupported() method in the Instant class in Java. This method requires a single parameter i.e. the ChronoUnit to check. It returns true if the ChronoUnit is supported by the Instant class and ... Read More