
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
Karthikeya Boyini has Published 2193 Articles

karthikeya Boyini
2K+ Views
To copy data from one field to another on every row, use the UPDATE command.Let us first create a table −mysql> create table DemoTable ( StudentId int, StudentFirstName varchar(20), StudentMarks int default 0 ); Query OK, 0 rows affected (0.49 sec)Following is the query to ... Read More

karthikeya Boyini
116 Views
The immutable copy of a duration with the required nanoseconds is obtained using the method withNanos() in the Duration class in Java. This method requires a single parameter i.e. the number of nanoseconds and it returns the duration with the required nanoseconds that were passed as a parameter.A program that ... Read More

karthikeya Boyini
257 Views
To work with time in PHP/ MySQL, you can use strtotime() function. The PHP code is as follows for the same −$timeValue='8:55 PM'; $changeTimeFormat = date('H:i:s', strtotime($timeValue)); echo("The change Format in 24 Hours="); echo($changeTimeFormat);The snapshot of PHP code is as follows −Here is the output.Here is the MySQL query to ... Read More

karthikeya Boyini
2K+ Views
You can use the concept of toArray() to create array. Following is the syntax −db.yourCollectonName.find({}, {yourFieldName:1}).toArray();Let us create a collection with documents −> db.createArrayDemo.insertOne({"UserName":"Chris"}); { "acknowledged" : true, "insertedId" : ObjectId("5cbd6461de8cc557214c0e00") } > db.createArrayDemo.insertOne({"UserName":"David"}); { "acknowledged" : true, "insertedId" : ObjectId("5cbd6467de8cc557214c0e01") } > db.createArrayDemo.insertOne({"UserName":"Robert"}); { ... Read More

karthikeya Boyini
802 Views
There is no equivalent of ROW_NUMBER() in MySQL for inserting but you can achieve this with the help of variable. The syntax is as follows −SELECT (@yourVariableName:=@yourVariableName + 1) AS `anyAliasName`, yourColumnName1, yourColumnName2, ...N FROM yourTableName ,(SELECT @yourVariableName:=0) AS anyAliasName;To understand the above syntax, let us create a table. The ... Read More

karthikeya Boyini
739 Views
The range of values for a field can be obtained using the range() method in the Instant class in Java. This method requires a single parameter i.e. the ChronoField for which the range of values are required and it returns the range of valid values for the ChronoField.A program that ... Read More

karthikeya Boyini
405 Views
You can use system variables character_set_server to know the default server character set in MySQL. Following is the syntax −SHOW VARIABLES LIKE 'character_set_server';Additionally, to u can use collation_server system variable to know the default collation in MySQL. Following is the syntax −SHOW VARIABLES LIKE 'collation_server';Let us execute the above syntaxes ... Read More

karthikeya Boyini
69 Views
An immutable copy of a duration where some nanoseconds are removed from it can be obtained using the minusNanos() method in the Duration class in Java. This method requires a single parameter i.e. the number of nanoseconds to be subtracted and it returns the duration with the subtracted nanoseconds.A program ... Read More

karthikeya Boyini
1K+ Views
The syntax is as follows to skip the duplicate value and select only one from the duplicated values −select min(yourColumnName1), yourColumnName2 from yourTableName group by yourColumnName2;To understand the above syntax, let us create a table. The query to create a table is as follows −mysql> create table doNotSelectDuplicateValuesDemo -> ... Read More

karthikeya Boyini
369 Views
You can use $set operator for this Let us first create a collection with documents −> db.updateRecordDemo.insertOne({"StudentName":"Larry"}); { "acknowledged" : true, "insertedId" : ObjectId("5cbd6f95de8cc557214c0e0a") } > db.updateRecordDemo.insertOne({"StudentName":"David"}); { "acknowledged" : true, "insertedId" : ObjectId("5cbd6f9cde8cc557214c0e0b") } > db.updateRecordDemo.insertOne({"StudentName":"Mike"}); { "acknowledged" : true, "insertedId" : ObjectId("5cbd6f9dde8cc557214c0e0c") ... Read More