George John has Published 1167 Articles

Best way to change the date format in MySQL SELECT?

George John

George John

Updated on 30-Jul-2019 22:30:25

1K+ Views

The best way to change the date format in MySQL SELECT is as followsSELECT DATE_FORMAT(yourColumnName, "%d/%m/%Y %H:%i") AS anyAliasName FROM yourTableName WHERE yourCondition;To understand the above concept, let us create a table. The query to create a table is as followsmysql> create table bestDateFormatDemo - > ( ... Read More

LongStream allMatch() in Java

George John

George John

Updated on 30-Jul-2019 22:30:25

41 Views

The allMatch() method in the LongStream class returns whether all elements of this stream match the provided predicate.The syntax is as follows.boolean allMatch(LongPredicate predicate)The parameter predicate is a stateless predicate to apply to elements of this stream. The LongPredicate represents a predicate of one long-valued argument.To use the LongStream class ... Read More

Update two separate arrays in a document with one update call in MongoDB?

George John

George John

Updated on 30-Jul-2019 22:30:25

84 Views

You can use $push operator for this. Let us first create a collection with documents>db.twoSeparateArraysDemo.insertOne({"StudentName":"Larry", "StudentFirstGameScore":[98], "StudentSecondGameScore":[77]}); {    "acknowledged" : true,    "insertedId" : ObjectId("5c9b152815e86fd1496b38b8") } >db.twoSeparateArraysDemo.insertOne({"StudentName":"Mike", "StudentFirstGameScore":[58], "StudentSecondGameScore":[78]}); {    "acknowledged" : true,    "insertedId" : ObjectId("5c9b152d15e86fd1496b38b9") } >db.twoSeparateArraysDemo.insertOne({"StudentName":"David", "StudentFirstGameScore":[65], "StudentSecondGameScore":[67]}); {    "acknowledged" : true,    "insertedId" ... Read More

Collectors minBy() method in Java 8

George John

George John

Updated on 30-Jul-2019 22:30:25

341 Views

The minBy() method of the Collectors class in Java 8 returns a Collector that produces the minimum element according to a given Comparator, described as an OptionalThe syntax is as followsstatic Collector

Early binding and Late binding in C++

George John

George John

Updated on 30-Jul-2019 22:30:25

13K+ Views

In this section we will see what is early binding and what is late binding in C++. The binding means the process of converting identifiers into addresses. For each variables and functions this binding is done. For functions it is matching the call with the right function definition by the ... Read More

MySQL query to discover current default database collation (via command line client)?

George John

George John

Updated on 30-Jul-2019 22:30:25

256 Views

You need to use INFORMATION_SCHEMA.SCHEMATA for current default database collation.The syntax is as followsSELECT DEFAULT_COLLATION_NAME FROM information_schema.SCHEMATA WHERE SCHEMA_NAME = 'yourDatabaseName' LIMIT 1;Let us implement the above syntax to discover current default database collation (via command line client). Our database here is ‘sample’.The query is as follows −mysql> SELECT DEFAULT_COLLATION_NAME ... Read More

BCD numbers in 8085 Microprocessor

George John

George John

Updated on 30-Jul-2019 22:30:25

1K+ Views

Many a time, we are required to represent decimal numbers in a computer, and perform arithmetic on these numbers. For example, we may be required to total the marks a student has obtained in five different subjects, where obviously, the marks are awarded in decimal notation.For this purpose, the BCD ... Read More

How to update value of a key in a list of a json in MongoDB?

George John

George John

Updated on 30-Jul-2019 22:30:25

698 Views

Let us first create a collection with documents> db.updateListOfKeyValuesDemo.insertOne( { "StudentDetails":[ { "StudentName":"John", "StudentAge":23, "StudentCountryName":"US" }, { "StudentName":"Carol", "StudentAge":24, "StudentCountryName":"UK" }, { "StudentName":"Bob", "StudentAge":22, "StudentCountryName":"AUS" } ] } ); {    "acknowledged" : true,    "insertedId" : ObjectId("5c9b5b759882024390176545") }Following is the query to display all documents from a collection with ... Read More

How to add a number to a current value in MySQL (multiple times at the same time)?

George John

George John

Updated on 30-Jul-2019 22:30:25

299 Views

You can use UPDATE command for this.The syntax is as followsupdate yourTableName set yourColumnName =yourColumnName +yourIntegerValue where ;To understand the above syntax, let us create a table. The query to create a table is as followsmysql> create table addANumberToCurrentValueDemo    -> (    -> Game_Id int NOT NULL AUTO_INCREMENT PRIMARY ... Read More

Instruction register (IR) in 8085 Microprocessor

George John

George John

Updated on 30-Jul-2019 22:30:25

3K+ Views

IR (Instruction Register) is a special purpose register, which is used to receive the 8-bit opcode portion of an instruction. It is not accessible to the programmer. What it means is that there are no instructions by which the programmer can load it with values of his choice. For example, ... Read More

Advertisements