
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
Ankith Reddy has Published 996 Articles

Ankith Reddy
302 Views
The skip() method of the IntStream class in Java returns a stream consisting of the remaining elements of this stream after discarding the first n elements of the stream.The syntax is as followsIntStream skip(long n)Here, n is the number of elements to skip. The method returns the new stream.Create an ... Read More

Ankith Reddy
126 Views
To get a distinct aggregation of an array field across indexes, let us take an example and create a collection with some documents.Following is the query to create a collection with documents> db.distinctAggregation.insertOne({"UserName":"Larry", "UserPost":["Hi", "Hello"]}); { "acknowledged" : true, "insertedId" : ObjectId("5c98aefb330fd0aa0d2fe4c6") } > db.distinctAggregation.insertOne({"UserName":"Chris", "UserPost":["Hi", "Good Morning"]}); ... Read More

Ankith Reddy
2K+ Views
For this, let us first create a new table in MySQLmysql> create table useProcedure - > ( - > Id int NOT NULL AUTO_INCREMENT PRIMARY KEY, - > FirstName varchar(20), - > LastName varchar(20) - ... Read More

Ankith Reddy
153 Views
The count() method of the IntStream class in Java returns the count of elements in this streamThe syntax is as followslong count()First, create an IntStream and add some elementsIntStream intStream = IntStream.of(30, 13, 67, 56, 89, 99, 76, 56);Now, get the count of elements of the stream using the count() ... Read More

Ankith Reddy
778 Views
To specify exact order with where id IN, you need to use find_in_set() function.The syntax is as followsSELECT *FROM yourTableName WHERE yourColumnName IN (yourValue1, yourValue2, yourValue3, ....N) ORDER BY FIND_IN_SET(yourColumnName , ‘yourValue1, yourValue2, yourValue3, ....N’');Let us first create a tablemysql> create table FindInSetDemo - > ( - > ... Read More

Ankith Reddy
349 Views
The max() method of the LongStream class in Java returns an OptionalLong describing the maximum element of this stream, or an empty optional if this stream is empty.The syntax is as followsOptionalLong max()Here, OptionalLong is a container object which may or may not contain a long value.To use the LongStream ... Read More

Ankith Reddy
4K+ Views
Let us first create a collection. Following is the query to create a collection with documents> db.documentExistsOrNotDemo.insertOne({"UserId":101, "UserName":"John"}); { "acknowledged" : true, "insertedId" : ObjectId("5c9932bd330fd0aa0d2fe4cf") } > db.documentExistsOrNotDemo.insertOne({"UserId":102, "UserName":"Chris"}); { "acknowledged" : true, "insertedId" : ObjectId("5c9932c6330fd0aa0d2fe4d0") } > db.documentExistsOrNotDemo.insertOne({"UserId":102, "UserName":"Robert"}); { "acknowledged" : true, ... Read More

Ankith Reddy
448 Views
ReferencesWhen a variable is declared as reference, it becomes an alternative name for an existing variable.SyntaxType &newname = existing name;InitializatioType &pointer; pointer = variable name;PointersPointers are used to store the address of variable.SyntaxType *pointer;InitializationType *pointer; pointer = variable name;The main differences between references and pointers are -References are used to ... Read More

Ankith Reddy
1K+ Views
Use aggregate() method to get all the non-distinct values of a field. Let us first create a collection with documents> db.findAllNonDistinctDemo.insertOne({"UserName":"John", "UserAge":28}); { "acknowledged" : true, "insertedId" : ObjectId("5c995078863d6ffd454bb647") } > db.findAllNonDistinctDemo.insertOne({"UserName":"Larry", "UserAge":21}); { "acknowledged" : true, "insertedId" : ObjectId("5c995081863d6ffd454bb648") } > db.findAllNonDistinctDemo.insertOne({"UserName":"Larry", "UserAge":23}); { ... Read More

Ankith Reddy
2K+ Views
To get data from MySQL database, you need to use executeQuery() method from java. First create a table in the MySQL database. Here, we will create the following table in the ‘sample’ databasemysql> create table javaGetDataDemo - > ( - > Id int NOT NULL AUTO_INCREMENT PRIMARY KEY, - > ... Read More