- 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
Krantik Chavan has Published 308 Articles
Krantik Chavan
185 Views
Yes, you can use SUM() with IF() in MySQL. Let us first create a demo table:mysql> create table DemoTable ( Value int, Value2 int ); Query OK, 0 rows affected (0.51 sec)Following is the query to insert some records in the table using insert command:mysql> insert into DemoTable ... Read More
Krantik Chavan
173 Views
You cannot use backticks with column value. For this, use only table name or column name. If you use backtick with column value then MySQL will give the following error message:ERROR 1054 (42S22): Unknown column '191.23.41.10' in 'where clause'Let us first create a table:mysql> create table DemoTable6 ( SystemIPAddress ... Read More
Krantik Chavan
98 Views
The forEach() method of the DoubleStream class performs an action for each element of this stream.The syntax is as follows:void forEach(DoubleConsumer action)Here, DoubleConsumer represents an operation that accepts a single double-valued argument and returns no result. The parameter action is a non-interfering action to perform on the elements.To use the ... Read More
Krantik Chavan
79 Views
The put() method of the ArrayBlockingQueue class inserts the specified element at the tail of this queue. It waits for the space to become available, if the queue is full.The syntax is as follows:void put(E e)Here, e is the element to be inserted.To work with ArrayBlockingQueue class, you need to ... Read More
Krantik Chavan
110 Views
To understand this, let us create a table with fields like ID, Customer Name, Items, Price. We will first multiply the items with price. After that the rows with similar records i.e. same customer name will get added.Let us first create a table:mysql> create table DemoTable ( CustomerId int ... Read More
Krantik Chavan
94 Views
To create Octet Tuple from an array in Java, use the fromArray() method. Let us first see what we need to work with JavaTuples. To work with Octet class in JavaTuples, you need to import the following package:import org.javatuples.Octet;Note: Download JavaTuples Jar library to run JavaTuples program. If you are ... Read More
Krantik Chavan
447 Views
To get number of values that only appear once in a column, use GROUP BY HAVING. Let us first create a table:mysql> create table DemoTable ( Name varchar(20) ); Query OK, 0 rows affected (0.55 sec)Following is the query to insert some records in the table using insert command:mysql> ... Read More
Krantik Chavan
1K+ Views
The average() method of the DoubleStream class in Java returns an OptionalDouble which is the arithmetic mean of elements of this stream. If the stream is empty, empty is returned.The syntax is as follows:OptionalDouble average()Here, OptionalDouble is a container object which may or may not contain a double value.To use ... Read More
Krantik Chavan
109 Views
To get maximum and minimum values in a single query, use the aggregate function min() and max(). Let us first create a table:mysql> create table DemoTable ( FirstValue int, SecondValue int ); Query OK, 0 rows affected (0.66 sec)Following is the query to insert some records in the ... Read More
Krantik Chavan
78 Views
To create KeyValue tuple from List collection, use the fromCollection() method. Let us first see what we need to work with JavaTuples. To work with KeyValue class in JavaTuples, you need to import the following package:import org.javatuples.KeyValue;Note: Download JavaTuples Jar library to run JavaTuples program. If you are using Eclipse ... Read More