MySQL concatenation operator?

George John
Published on 11-Jan-2019 10:29:52
You can use in-built function CONCAT() from MySQL. The syntax is as follows −SELECT CONCAT(('(', yourColumnName1, ', ', yourColumnName2, ', ', yourColumnName3, ...N')')as anyVariableName from yourTableName;To understand the above syntax, let us first create a table. The query to create a table is as follows −mysql> create table Concatenation_OperatorDemo -> ... Read More

MySQL update with random number between 1 - 3

Chandu yadav
Published on 11-Jan-2019 10:22:51
The syntax for updating a column with random number between 1-3 is is as follows −update yourTableName set yourColumnName=FLOOR(1+RAND()*3);To understand the above syntax, let us first create a table. The query to create a table is as follows −mysql> create table UpdateNumber1To3 -> ( -> MyNumber int -> ); Query ... Read More

Which are the trustworthy brands for buying sanitary pads?

Ridhi Arora
Published on 11-Jan-2019 10:21:03
Needless to mention how much importance menstrual hygiene caries for females. Gone are the times when women were completely unaware of the availability of sanitary napkins. Nowadays, many trustworthy brands offer sanitary pads and people choose sanitary napkins based on cost, design, and packaging.Following are Some Good BrandWhisper − These ... Read More

Remove all elements from Java LinkedHashSet

karthikeya Boyini
Published on 11-Jan-2019 10:04:41
To remove all the elements from LinkedHashSet in Java, use the clear() method.The following is an example to declare LinkedHashSet and add elements to it −LinkedHashSet<Integer> hashSet = new LinkedHashSet<Integer>(); hashSet.add(10); hashSet.add(20); hashSet.add(30); hashSet.add(40); hashSet.add(50); hashSet.add(60);Use the clear() method to remove all elements −hashSet.clear();The following is an example −Example Live Demoimport ... Read More

Create NavigableMap from TreeMap in Java

Samual Sam
Published on 11-Jan-2019 10:02:13
To create NavigableMap from TreeMap. The following is the declaration −NavigableMap<String, Integer> n = new TreeMap<String, Integer>();Now, add some elements to the NavigableMap created above −n.put("A", 888); n.put("B", 999); n.put("C", 444); n.put("D", 555); n.put("E", 666); n.put("F", 888); n.put("G", 999); n.put("H", 444); n.put("I", 555); n.put("J", 666);The following is an example to ... Read More

Remove specified element from Java LinkedHashSet

karthikeya Boyini
Published on 11-Jan-2019 10:00:32
To remove a specified element from LinkedHashSet, use the remove() and include the element you want to remove as a parameter.First, set LinkedHashSet and add elements −LinkedHashSet<Integer> hashSet = new LinkedHashSet<Integer>(); hashSet.add(10); hashSet.add(20); hashSet.add(30); hashSet.add(40); hashSet.add(50); hashSet.add(60);Let us now remove an element −hashSet.remove(10);The following is an example to remove specified ... Read More

Create IdentityHashMap in Java

Samual Sam
Published on 11-Jan-2019 09:58:27
Let us create an IdentityHashMap −Map<String, Integer> m = new IdentityHashMap<String, Integer>();Add elements to the Map created above −m.put("1", 100); m.put("2", 200); m.put("3", 300); m.put("4", 150); m.put("5", 110); m.put("6", 50); m.put("7", 90); m.put("8", 250);The following is an example to create IdentityHashMap and how to display its elements −Example Live Demoimport java.util.*; ... Read More

NavigableMap ceilingEntry() method in Java

karthikeya Boyini
Published on 11-Jan-2019 09:56:42
Use the NavigableMap ceilingEntry() method to returna key-value mapping associated with the least key greater than or equal to the given keyThe following is an example to implement ceilingEntry() method −Example Live Demoimport java.util.*; public class Demo { public static void main(String[] args) { ... Read More

NavigableSet Class higher() method in Java

Samual Sam
Published on 11-Jan-2019 09:54:48
The higher() method in NavigableSet returns the least element strictly greater than the given element i.e. 35 here −higher(35);The following is an example to implement the higher method in Java −Example Live Demoimport java.util.NavigableSet; import java.util.TreeSet; public class Demo { public static void main(String[] args) { ... Read More

NavigableSet Class floor() method in Java

karthikeya Boyini
Published on 11-Jan-2019 09:53:00
The floor() method returns the greatest element less than or equal to the given element i.e. 30 here −floor(30)The following is an example to implement the floor method in Java −Example Live Demoimport java.util.NavigableSet; import java.util.TreeSet; public class Demo { public static void main(String[] args) { ... Read More
Advertisements