- 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
Karthikeya Boyini has Published 2383 Articles
karthikeya Boyini
151 Views
To display IDs in a particular order i.e. the order of your choice use FIELD() method.Let us first create a table −mysql> create table DemoTable ( UserId int ); Query OK, 0 rows affected (0.64 sec)Following is the query to insert some records in the table using ... Read More
karthikeya Boyini
52 Views
An immutable copy of a duration where some nanoseconds are added to it can be obtained using the plusNanos() method in the Duration class in Java. This method requires a single parameter i.e. the number of nanoseconds to be added and it returns the duration with the added nanoseconds.A program ... Read More
karthikeya Boyini
1K+ Views
The syntax is as follows to trim commas −SELECT TRIM(BOTH ', ' FROM yourColumnName) from yourTableName;Let us see an example −mysql> create table TrimCommasDemo -> ( -> Id int NOT NULL AUTO_INCREMENT PRIMARY KEY, -> AllTechnicalSkills text -> ); Query OK, 0 rows affected (0.81 sec)Now ... Read More
karthikeya Boyini
141 Views
To perform search/ replace for only the first occurrence, use the CONCAT and REPLACE() function.The query is as follows to set user defined session variable −mysql> set @Sentence='Thks ks is a my string'; Query OK, 0 rows affected (0.00 sec)In this k will be replaced with i only once. The ... Read More
karthikeya Boyini
56 Views
The setAt1() method is used to set the Quintet value in JavaTuples and a copy with a new value at the specified index i.e. index 1 here.Let us first see what we need to work with JavaTuples. To work with Quintet class in JavaTuples, you need to import the following ... Read More
karthikeya Boyini
3K+ Views
An immutable copy of the LocalDate where the days are added to it can be obtained using the plusDays() method in the LocalDate class in Java. This method requires a single parameter i.e. the number of days to be added and it returns the instant with the added days.A program ... Read More
karthikeya Boyini
3K+ Views
Heron’s formula gives the area of a triangle when the length of all three sides are already known.Let’s say we have the following three sides of a triangle −s1 = 15191235.0; s2 = 15191235.0; s3 = 1.01235479;Now, use the Heron’s formulae to find the area −area = (s1+s2+s3)/2.0d; resArea = ... Read More
karthikeya Boyini
384 Views
You can use utc_timestamp() for this. Following is the syntax −SELECT utc_timestamp();Let us check the current time using now().Following is the query −mysql> select now();This will produce the following output −+---------------------+ | now() | +---------------------+ | ... Read More
karthikeya Boyini
64 Views
The fromCollection() method is used in JavaTuples to create Septet Tuple from another collection. We will see an example of creating a Septet Tuple using List collection.Let us first see what we need to work with JavaTuples. To work with Septet class in JavaTuples, you need to import the following ... Read More
karthikeya Boyini
1K+ Views
To create a view only if it does not already exist, you can use the following syntax −CREATE OR REPLACE VIEW yourViewName AS SELECT *FROM yourTableName;To understand the above syntax, let us create a table. The query to create a table is as follows −mysql> create table createViewDemo -> ( ... Read More