- 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
Samual Sam has Published 2492 Articles
Samual Sam
1K+ Views
You can use CASE statement for this and set conditions to get result in the temporary column.Let us first create a table −mysql> create table DemoTable ( EmployeeId int NOT NULL AUTO_INCREMENT PRIMARY KEY, EmployeeName varchar(20), EmployeeSalary int, EmployeeExperience int ); Query OK, 0 ... Read More
Samual Sam
329 Views
To exactly count all rows, you need to use the aggregate function COUNT(*). The syntax is as follows −select count(*) as anyAliasName from yourTableName;To understand the above syntax, let us create a table. The query to create a table is as follows −mysql> create table CountAllRowsDemo -> ( ... Read More
Samual Sam
94 Views
An immutable copy of a duration where some days are added to it can be obtained using the plusDays() method in the Duration class in Java. This method requires a single parameter i.e. the number of days to be added and it returns the duration with the added days.A program ... Read More
Samual Sam
219 Views
You can use CASE statement for this. Let us see an example −mysql> create table BooleanEvaluationDemo -> ( -> Id int NOT NULL AUTO_INCREMENT PRIMARY KEY, -> FirstValue int, -> SecondValue int -> ); Query OK, 0 rows affected (0.71 sec)Insert some records in the ... Read More
Samual Sam
63 Views
Use the fromCollection() method to create Quartet Tuple from another collection i.e. we will see an example of List here.Let us first see what we need to work with JavaTuples. To work with Quartet class in JavaTuples, you need to import the following package −import org.javatuples.Quartet;Note − Steps to download ... Read More
Samual Sam
207 Views
An immutable copy of the LocalDate where the weeks are added to it can be obtained using the plusWeeks() method in the LocalDate class in Java. This method requires a single parameter i.e. the number of weeks to be added and it returns the instant with the added weeks.A program ... Read More
Samual Sam
2K+ Views
To convert integer array list to integer array is not a tedious task. First, create an integer array list and add some elements to it −ArrayList < Integer > arrList = new ArrayList < Integer > (); arrList.add(100); arrList.add(200); arrList.add(300); arrList.add(400); arrList.add(500);Now, assign each value of the integer array list ... Read More
Samual Sam
661 Views
Convert all the records in a MySQL table from uppercase to lowercase using UPDATE command along with LOWER() method.Let us first create a table −mysql> create table DemoTable ( Id varchar(100), StudentFirstName varchar(20), StudentLastName varchar(20), StudentCountryName varchar(10) ); Query OK, 0 rows affected (0.61 ... Read More
Samual Sam
202 Views
To remove item from array, you can use $pull operator. Let us create a collection with documents −> db.removeItemFromArray.insertOne( { "_id":101, "StudentName":"Larry", "StudentSubjects":["C", "MongoDB", "Java", "MySQL"] } ); { "acknowledged" : true, "insertedId" : 101 }Display all documents from a collection with the help of find() method. The query ... Read More
Samual Sam
83 Views
To create Unit Tuple from another collection, use the fromCollection() method. Here, we will create a Unit Tuple from a List collection, therefore the same method is used.Let us first see what we need to work with JavaTuples. To work with JavaTuples. To work with the Unit class in JavaTuples, ... Read More