- 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](https://www.tutorialspoint.com/assets/profiles/13514/profile/60_83486-1512649303.jpg)
Samual Sam
530 Views
You can use ENUM datatype for this. Let us first create a table −mysql> create table DemoTable ( Id int NOT NULL AUTO_INCREMENT PRIMARY KEY, UserRating ENUM('1', '2', '3', '4', '5') ); Query OK, 0 rows affected (0.54 sec)Insert records in the table using insert command −mysql> insert into ... Read More
![Samual Sam](https://www.tutorialspoint.com/assets/profiles/13514/profile/60_83486-1512649303.jpg)
Samual Sam
581 Views
You need to use DateTime class if you want to extract the only date from datetime field. The syntax is as follows −DateTime::createFromFormat("Y-m-d H:i:s", yourDateTimeValue)->format("yourFormatSpecifier");Now you can implement the above syntax in your PHP code to extract the only date from datetime field. The PHP code is as follows −$MySQLDataBaseDateTime ... Read More
![Samual Sam](https://www.tutorialspoint.com/assets/profiles/13514/profile/60_83486-1512649303.jpg)
Samual Sam
241 Views
Create a HashMap and set key-value pair −Mapmap = new HashMap(); map.put(10, "A"); map.put(20, "B"); map.put(30, "C"); map.put(40, "D"); map.put(50, "E"); map.put(60, "F"); map.put(70, "G"); map.put(80, "H");Now, let’s say you need to set a different value for an identical key. For that, use put() −map.put(30, "T");Example Live Demoimport java.util.HashMap; import java.util.Map; ... Read More
![Samual Sam](https://www.tutorialspoint.com/assets/profiles/13514/profile/60_83486-1512649303.jpg)
Samual Sam
467 Views
Heap OverflowHeap is used to store dynamic variables. It is a region of process’s memory. malloc(), calloc(), resize() all these inbuilt functions are generally used to store dynamic variables.Heap overflow occurs when −A) If we allocate dynamic large number of variables −int main() { float *ptr = (int *)malloc(sizeof(float)*1000000.0)); ... Read More
![Samual Sam](https://www.tutorialspoint.com/assets/profiles/13514/profile/60_83486-1512649303.jpg)
Samual Sam
179 Views
To select from a set of integers, you can use UNION. Following is the syntax −SELECT yourValue1 UNION SELECT yourValue2 UNION SELECT yourValue3 UNION SELECT yourValue4 . . . . NLet us implement the above syntax to select from a set of integers in MySQL −mysql> SELECT 1000 UNION SELECT 2000 ... Read More
![Samual Sam](https://www.tutorialspoint.com/assets/profiles/13514/profile/60_83486-1512649303.jpg)
Samual Sam
176 Views
To track the order of insertion, you can use Map.Entry() in case of a Map. Let’s say we have the following LinkedHashMap −Mapmap = new LinkedHashMap(); map.put("Jack", 0); map.put("Tim", 1); map.put("David", 2); map.put("Tom", 3); map.put("Kevin", 4); map.put("Jeff", 5);Now, loop through Map.Entry and get the order of insertion correctly with Key ... Read More
![Samual Sam](https://www.tutorialspoint.com/assets/profiles/13514/profile/60_83486-1512649303.jpg)
Samual Sam
2K+ Views
To order by from highest to lowest value, you can use ORDER BY DESC command −select *from yourTableName order by yourColumnName DESC;If you want the result from lowest to highest, you can use ORDER BY ASC command −select *from yourTableName order by yourColumnName ASC;Let us first create a table −mysql> ... Read More
![Samual Sam](https://www.tutorialspoint.com/assets/profiles/13514/profile/60_83486-1512649303.jpg)
Samual Sam
95 Views
Before getting into an example, we should know what ConcurrentLinkedDeque is, it is unbounded deque based on linked nodes. Multiple threads can access deque elements with safety.This example demonstrates about How to use poll() in android ConcurrentLinkedDequeStep 1 − Create a new project in Android Studio, go to File ⇒ ... Read More
![Samual Sam](https://www.tutorialspoint.com/assets/profiles/13514/profile/60_83486-1512649303.jpg)
Samual Sam
2K+ Views
A hash table is a data structure which is used to store key-value pairs. Hash function is used by hash table to compute an index into an array in which an element will be inserted or searched. Quadratic probing is a collision resolving technique in Open Addressed Hash tables. It ... Read More
![Samual Sam](https://www.tutorialspoint.com/assets/profiles/13514/profile/60_83486-1512649303.jpg)
Samual Sam
2K+ Views
Yes, you can set null as key in Java HashMap. For this, let’s first create a HashMap with key and value pair −Mapmap = new HashMap(); map.put("Football", "A"); map.put("Squash", "B"); map.put("Cricket", "C"); map.put("Hockey", "D"); map.put("Rugby", "E");Now, let’s add null value as key −map.put(null, "H");You can try to get the value ... Read More