- 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
Daniol Thomas has Published 209 Articles
Daniol Thomas
3K+ Views
You can achieve this with the help of aggregate framework in MongoDB. To understand it, let us create a collection with document. The query to create a collection with document is as follows:> db.sortInnerArrayDemo.insertOne( ... ... { ... "EmployeeDetails": ... { ... ... Read More
Daniol Thomas
279 Views
The number of days for a particular Period can be obtained using the getDays() method in the Period class in Java. This method requires no parameters and it returns the number of days in the Period.A program that demonstrates this is given as followsExample Live Demoimport java.time.Period; public class Demo { ... Read More
Daniol Thomas
90 Views
The number of months for a particular Period can be obtained using the getMonths() method in the Period class in Java. This method requires no parameters and it returns the number of months in the Period.A program that demonstrates this is given as followsExample Live Demoimport java.time.Period; public class Demo { ... Read More
Daniol Thomas
171 Views
The number of years for a particular Period can be obtained using the getYears() method in the Period class in Java. This method requires no parameters and it returns the number of years in the Period.A program that demonstrates this is given as followsExample Live Demoimport java.time.Period; public class Demo { ... Read More
Daniol Thomas
111 Views
It can be checked if the days, months and years in the Period are zero or not using the isZero() method in the Period class in Java. This method requires no parameters. Also, it returns true if the days, months and years in the Period are zero and false otherwise.A ... Read More
Daniol Thomas
348 Views
Let us first create a table with one column as datetime and another wherein the days are stored:mysql> create table DemoTable ( ShippingDate datetime, CountOfDate int ); Query OK, 0 rows affected (0.52 sec)Following is the query to insert some records in the table using insert command:mysql> insert ... Read More
Daniol Thomas
710 Views
You need to use GROUP BY with COUNT(*) for this to group the values and display the count eliminating multiple values. Let us first create a table:mysql> create table DemoTable (Value int); Query OK, 0 rows affected (0.55 sec)Following is the query to insert some records in the table using ... Read More
Daniol Thomas
3K+ Views
To get today’s date in (YYYY-MM-DD) format in MySQL, you can use CURDATE().Following is the query to get the current date:mysql> SELECT CURDATE();This will produce the following output:+------------+ | CURDATE() | +------------+ | 2019-04-09 | +------------+ 1 row in set (0.00 sec)You can also use NOW() for this. Following ... Read More
Daniol Thomas
198 Views
For this, you can use SUBSTR() method. Let us first create a table:mysql> create table DemoTable ( Id int NOT NULL AUTO_INCREMENT PRIMARY KEY, FirstName varchar(20)); Query OK, 0 rows affected (1.31 sec)Following is the query to insert some records in the table using insert command:mysql> insert into ... Read More
Daniol Thomas
3K+ Views
The Period between two dates can be obtained using the between() method in the Period class in Java. This method requires two parameters i.e. the start date and the end date and it returns the Period between these two dates.A program that demonstrates this is given as followsExample Live Demoimport java.time.Period; ... Read More