MySQL Delete Operation Where ID is the Biggest

Samual Sam
Updated on 30-Jul-2019 22:30:25

220 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 insert command −mysql> insert into DemoTable values(100, 'John'); Query OK, 1 row affected (0.10 sec) mysql> insert into DemoTable values(234, 'Mike'); Query OK, 1 row affected (0.28 sec) mysql> insert into DemoTable values(145, 'Sam'); Query OK, 1 row affected (0.19 sec) mysql> insert into DemoTable values(278, 'Carol'); Query OK, 1 ... Read More

Add Column to a Table from Another Table in MySQL

Samual Sam
Updated on 30-Jul-2019 22:30:25

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 affected (1.48 sec)Now create the second table. The query to create the second table is as follows −mysql> create table SecondTable    -> (    -> UserId int,    -> UserAge int    -> ); Query OK, 0 rows affected (1.57 sec)Now, add column Age to the first table. Firstly, ... Read More

Use TinyText Value in Android SQLite

Jennifer Nicholas
Updated on 30-Jul-2019 22:30:25

151 Views

Before getting into an example, we should know what SQLite database in android is. SQLite is an open source SQL database that stores data to a text file on a device. Android comes in with built-in SQLite database implementation. SQLite supports all the relational database features. In order to access this database, you don't need to establish any kind of connections for it like JDBC, ODBC etc.This example demonstrates How to use TINYTEXT value in Android SQLite.Step 1 − Create a new project in Android Studio, go to File ⇒ New Project and fill all required details to create a ... Read More

Get Size of Label-Value Tuple in Java

Nishtha Thakur
Updated on 30-Jul-2019 22:30:25

207 Views

To get the size of the LabelValue tuple in Java, use the getSize() method. Let us first see what we need to work with JavaTuples. To work with LabelValue class in JavaTuples, you need to import the following package −import org.javatuples.LabelValue;Note − Download JavaTuples Jar library to run JavaTuples program. If you are using Eclipse IDE, then Right Click Project -> Properties -> Java Build Path -> Add External Jars and upload the downloaded JavaTuples jar file. Refer the below guide for all the steps to run JavaTuples −Steps − How to run JavaTuples program in EclipseThe following is an ... Read More

MySQL Query to Select All Entries from a Particular Month

Ankith Reddy
Updated on 30-Jul-2019 22:30:25

20K+ Views

To select all entries from a particular month in MySQL, use the monthname() or month() function.The syntax is as follows.select *from yourTableName where monthname(yourColumnName)='yourMonthName';To understand the above syntax, let us create a table. The query to create a table is as followsmysql> create table selectAllEntriesDemo -> ( -> Id int NOT NULL AUTO_INCREMENT PRIMARY KEY, -> ShippingDate datetime -> ); Query OK, 0 rows affected (0.63 sec)Insert some records in the table using insert command.The query is as followsmysql> insert into selectAllEntriesDemo(ShippingDate) values('2019-01-21'); Query OK, 1 row affected ... Read More

What is Octet Class in JavaTuples

Krantik Chavan
Updated on 30-Jul-2019 22:30:25

180 Views

An Octetclass is a Tuple of 8 element. It is in the JavaTuples library. The following is the declaration of the Octet class:public final class Octet extends Tuple implements IValue0, IValue1, IValue2, IValue3, IValue4, IValue5, IValue6, IValue7Let us first see what we need to work with JavaTuples. To work with Octet class in JavaTuples, you need to import the following package:import org.javatuples.Octet;Some of its features include:TypesafeSerializableComparableIterableImmutableNote: Download JavaTuples Jar library to run JavaTuples program. If you are using Eclipse IDE, then Right Click Project → Properties → Java Build Path → Add External Jars and upload the downloaded JavaTuples jar ... Read More

Put a Border Around an Android TextView

Arjun Thakur
Updated on 30-Jul-2019 22:30:25

13K+ Views

If you wants to see text view as 3D view as we seen in Microsoft power point 3d texts. This example demonstrate about how do I put a border around an Android text view.Step 1 − Create a new project in Android Studio, go to File ⇒ New Project and fill all required details to create a new project.Step 2 − Add the following code to res/layout/activity_main.xml.     In the above code we have taken one text view with background as border so we need to create a file in drawable as boarder.xml and add the following content. ... Read More

MySQL Query to Select Too Many Rows

karthikeya Boyini
Updated on 30-Jul-2019 22:30:25

518 Views

You can use LIMIT for this, which is used to fetch limited number of records. Let us first create a table −mysql> create table DemoTable (    Id int,    Name varchar(20) ); Query OK, 0 rows affected (0.53 sec)Insert records in the table using insert command −mysql> insert into DemoTable values(10, 'John'); Query OK, 1 row affected (0.11 sec) mysql> insert into DemoTable values(11, 'Chris'); Query OK, 1 row affected (0.17 sec) mysql> insert into DemoTable values(12, 'David'); Query OK, 1 row affected (0.13 sec) mysql> insert into DemoTable values(13, 'Carol'); Query OK, 1 row affected (0.13 sec) mysql> ... Read More

RST5.5 and RST6.5 Pins in 8085

Arjun Thakur
Updated on 30-Jul-2019 22:30:25

892 Views

 Both the pins RST5.5 and RST6.5 pins are inputs which are level sensitive. RST6.5 is of higher priority than RST5.5 but the pin RST5.5 is of higher priority than INTR. RST5.5 and RST6.5 have similar functions. The point to be noted that these pins must remain high till the 8085 checks all the internal interrupt signals at the end of the instructions. As we can easily see from the Fig. We activate the RST5.5 and RST6.5 internal interrupt signals if and only if when the external interrupt pins are in logic 1 state;Flip-flop IE is in logic 1 state;SIM instructions ... Read More

Filter Data Using WHERE Clause and AND in Android SQLite

Nitya Raut
Updated on 30-Jul-2019 22:30:25

223 Views

Before getting into example, we should know what sqlite data base in android is. SQLite is an open source SQL database that stores data to a text file on a device. Android comes in with built in SQLite database implementation. SQLite supports all the relational database features. In order to access this database, you don't need to establish any kind of connections for it like JDBC, ODBC etc.This example demonstrates How to filter data using where Clause and “AND” in Android sqlite.Step 1 − Create a new project in Android Studio, go to File ⇒ New Project and fill all ... Read More

Advertisements