
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
Chandu yadav has Published 1091 Articles

Chandu yadav
5K+ Views
To exclude entries with “0”, you need to use NULLIF() with function AVG().The syntax is as followsSELECT AVG(NULLIF(yourColumnName, 0)) AS anyAliasName FROM yourTableName;Let us first create a tablemysql> create table AverageDemo - > ( - > Id int NOT NULL AUTO_INCREMENT PRIMARY KEY, - > StudentName varchar(20), ... Read More

Chandu yadav
115 Views
The DoubleStream.iterate() returns an infinite sequential ordered DoubleStream produced by iterative application of a function f to an initial element seed, producing a Stream consisting of seed.The syntax is as followsstatic DoubleStream iterate(double seed, DoubleUnaryOperator f)Here, seed is the initial element and f is a function to be applied to ... Read More

Chandu yadav
347 Views
Yes, it is possible to enforce data checking in MySQL using regular expression. First, you need to create a table. After that you need to create a trigger before insert in table. Here, we will be checking the Phone Number format.The query to create a table is as followsmysql> create ... Read More

Chandu yadav
129 Views
The clear() method of the ArrayBlockingQueue class in Java is used to remove all the elements from this queue.The syntax is as followspublic void clear()To work with ArrayBlockingQueue class, you need to import the following packageimport java.util.concurrent.ArrayBlockingQueue;The following is an example to implement clear() method of Java ArrayBlockingQueue classExample Live Demoimport ... Read More

Chandu yadav
253 Views
Following is the syntax to drop all indexes from all collections in a MongoDB database using command linedb.getCollectionNames().forEach(function(yourVariableName) { db.runCommand({dropIndexes: yourVariableName, index: "*"}); });The above syntax will drop all indexes except _id.Let us check the current database. Following is the query> dbThis will produce the following outputTestFollowing is the ... Read More

Chandu yadav
718 Views
Access objects using dot notation. Let us first create a collection with documents> db.nestedObjectDemo.insertOne({"Student" : { "StudentDetails" : { "StudentPersonalDetails" : { "StudentName" : [ "John" ], ... "StudentCountryName" : [ "US" ], ... "StudentCoreSubject" : [ "C", "Java" ], ... "StudentProject" : [ "Online Book Store", "Pig Dice Game" ... Read More

Chandu yadav
1K+ Views
For this, use the substring_index() function.The syntax is as followsselect substring_index(yourColumnName, '. ', -1) AS anyAliasNamefrom yourTableName;Let us first create a table. The query to create a table is as followsmysql> create table AllFiles - > ( - > Id int NOT NULL AUTO_INCREMENT ... Read More

Chandu yadav
1K+ Views
This example demonstrate about How to get default phone Network operator name in android.Step 1 − Create a new project in Android Studio, go to File ⇒ New Project and fill all required details to create a new project.Step 2 − Add the following code to res/layout/activity_main.xml. ... Read More

Chandu yadav
177 Views
To query MongoDB with length criteria, you can use regex. Following is the syntaxdb.yourCollectionName.find({ ‘yourFieldName’: { $regex: /^.{yourLengthValue1, yourLengthValue2}$/ } });Let us create a collection with documents. Following is the query> db.queryLengthDemo.insertOne({"StudentFullName":"John Smith"}); { "acknowledged" : true, "insertedId" : ObjectId("5c9a01ae353decbc2fc927c0") } > db.queryLengthDemo.insertOne({"StudentFullName":"John Doe"}); { "acknowledged" : ... Read More

Chandu yadav
7K+ Views
You can use UNION to get the previous and next record in MySQL.The syntax is as follows(select *from yourTableName WHERE yourIdColumnName > yourValue ORDER BY yourIdColumnName ASC LIMIT 1) UNION (select *from yourTableName WHERE yourIdColumnName < yourValue ORDER BY yourIdColumnName DESC LIMIT 1);To understand the concept, let us create a ... Read More