
Data Structure
Networking
RDBMS
Operating System
Java
MS Excel
iOS
HTML
CSS
Android
Python
C Programming
C++
C#
MongoDB
MySQL
Javascript
PHP
- 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 2310 Articles

Samual Sam
200 Views
You can use ORDER BY DESC command with LIMIT 1 for this since we need to delete only a single ID.Let us first create a table −mysql> create table DemoTable ( UserId int, UserName varchar(20) ); Query OK, 0 rows affected (0.57 sec)Insert records in the table using ... Read More

Samual Sam
2K+ Views
Yes, we can add a column to a table from another table. Let us first create two tables. The query to create a table is as follows −mysql> create table FirstTable -> ( -> UserId int, -> UserName varchar(20) -> ); Query OK, 0 rows ... Read More

Samual Sam
718 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
717 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
241 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
274 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
3K+ 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
175 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
3K+ 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

Samual Sam
266 Views
To store date in MySQL, use the STR_TO_DATE() method −insert into yourTableName values(STR_TO_DATE('yourDate', '%d/%m/%Y'));Let us first create a table −mysql> create table DemoTable ( AdmissionDate date ); Query OK, 0 rows affected (0.62 sec)Insert records in the table using insert command −mysql> insert into DemoTable values(STR_TO_DATE('10/01/2013', '%d/%m/%Y')); Query OK, ... Read More