For this, you can insert using MySQL dual table. Let us create a table to understand the concept conditional insert. The query to create a table is as follows −mysql> create table ConditionalInsertDemo -> ( -> UserId int, -> TotalUser int, -> NumberOfItems int -> ); Query OK, 0 rows affected (0.58 sec)Insert some records in the table using insert command. The query is as follows −mysql> insert into ConditionalInsertDemo values(101, 560, 780); Query OK, 1 row affected (0.19 sec) mysql> insert into ConditionalInsertDemo values(102, 660, 890); Query OK, 1 row affected (0.20 sec) ... Read More
The NavigableMap lastEntry() method returns a key-value mapping associated with the greatest key in this map.Let us first create a NavigableMap and add some elements to it −NavigableMap n = new TreeMap(); n.put(5, "Tom"); n.put(9, "John"); n.put(14, "Jamie"); n.put(1, "Tim"); n.put(4, "Jackie"); n.put(15, "Kurt"); n.put(19, "Tiger"); n.put(24, "Jacob");Now, get the last entry −n.lastEntry();The following is another example to get last entry from NavigableMap −Example Live Demoimport java.util.*; public class Demo { public static void main(String[] args) { NavigableMap n = new TreeMap(); n.put("A", 498); ... Read More
The fishes that can survive without water for a good amount of time are known as amphibious fishes. Convergent evolution plays an important role in these species, as the next generation species receives analogous structures that have similar function but were not present in the last generation.Many fishes are amphibious, which means they can naturally survive out of the water. These fishes have developed limbs or use lateral undulation (that is, wave-like movement patterns that act to propel an animal forward) for terrestrial locomotion. They leave water bodies for many reasons like escaping predators, low oxygen environments etc.Ancient fish had ... Read More
To improve the radiation efficiency and directivity of the beam, the waveguide should be provided with an extended aperture so as to make the abrupt discontinuity of the wave into a gradual transformation, so that all the energy in the forward direction gets radiated. This can be termed as Flaring. Flaring is done to provide greater directivity and narrower beam width. The types of horn antennas depend on how they are flared.Sectoral HornThis type of horn antenna, flares out in only in one direction. Flaring in the direction of Electric vector produces the sectorial E-plane horn. As well, flaring in ... Read More
You can get the last entry in a MySQL table using ORDER BY. The first approach is as follows:Case 1: Using DESC LIMITSELECT * FROM yourTableName ORDER BY yourColumnName DESC LIMIT 1;The second approach is as follows:Case 2: Using MAX()SET @anyVariableName = (SELECT MAX(yourColumnName) FROM yourTableName); SELECT *FROM yourtableName WHERE yourColumnName = @anyVariableName;Now to understand both the approaches, let us create a table. The query to create a table is as follows:mysql> create table lastEntryDemo -> ( -> Id int NOt NULL AUTO_INCREMENT, -> Name varchar(30), -> Age int, -> PRIMARY KEY(Id) -> ); ... Read More
Here we are going to develop a keylogger using python. But before that, what is a keylogger? Keylogger is a program with which we monitor keystrokes. These keystrokes will be stored in a log file. We can record sensitive information like username and password using this keystroke.To create a keylogger we are going to use the pynput module. As its not the standard library of python, we might need to install it.Installing pyxhook module −I’m going to use pip to install pynput −pip install pynput Requirement already satisfied: pynput in c:\python\python361\lib\site-packages (1.4) Requirement already satisfied: six in c:\python\python361\lib\site-packages (from pynput) ... Read More
Apple launched iPhone in 2007 and caused a tidal wave of change throughout the mobile phone industry. It was the only smartphone with just one functional button (home button) which created a revolution in the market.Apple StoreApple has invented apple store for its product where you can download software safely.The invention of the apple store, created a revolution because you can download any type of software for your phone which is compatible with the i phone. Apple store can only be accessed by an apple phone user.Before iPhone, the idea of using on-screen keyboard on a phone was unimaginable. When ... Read More
The MySQL BOOLEAN and BOOL both are equivalent to TINYINT(1). Whenever you create a column using BOOLEAN and BOOL data type, MySQL implicitly convert the BOOLEAN and BOOL to TINYINT(1). The BOOLEAN and BOOL are equivalents of TINYINT(1), since they are synonyms.Create a table using BOOLEAN data type. The query to create a table.mysql> create table BooleanDemo -> ( -> IsOn BOOLEAN -> ); Query OK, 0 rows affected (0.58 sec)Now check internal structure of the above table. The query is as follows −mysql> show create table BooleanDemo;Output+-------------+----------------------------------------------------------------------------------------------------------------------------------+ | Table | Create Table ... Read More
Charminar is a monument which was constructed in 1591, in Hyderabad, India. The literal translation of Charminar in English is 4 pillars. It is located on the east bank of the Musi River and is listed among the most recognized structures of India. There are many theories regarding the reason for the construction of Charminar but the commonly accepted theory is that it was built to celebrate the elimination of the Plague, which was widespread at that time.Charminar was built by Muhammad Quli Qutb Shah, the fifth ruler of the Qutb Shahi dynasty. After shifting his capital from Golkonda to ... Read More
The \G modifier gets the result in vertical order. If you use \g modifier, then it won’t affect the result. The \g works likesemi-colon.Let us first create a table. The query to create a table is as follows:mysql> create table DemoOfVertical -> ( -> Id int NOT NULL AUTO_INCREMENT, -> Name varchar(20), -> PRIMARY KEY(Id) -> ); Query OK, 0 rows affected (3.40 sec)Now you can insert some records in the table using insert command. The query is as follows:mysql> insert into DemoOfVertical(Name) values('Bob'); Query OK, 1 row affected (0.18 sec) mysql> insert into ... Read More
Data Structure
Networking
RDBMS
Operating System
Java
iOS
HTML
CSS
Android
Python
C Programming
C++
C#
MongoDB
MySQL
Javascript
PHP