- 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
Chandu yadav has Published 1163 Articles
Chandu yadav
4K+ 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
65 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
277 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
79 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
190 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
12K+ Views
A Binary Heap is a complete binary tree which is either Min Heap or Max Heap. In a Max Binary Heap, the key at root must be maximum among all keys present in Binary Heap. This property must be recursively true for all nodes in Binary Tree. Min Binary Heap ... Read More
Chandu yadav
606 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
848 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
120 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