Arjun Thakur has Published 1109 Articles

How to make an existing field Unique in MySQL?

Arjun Thakur

Arjun Thakur

Updated on 30-Jul-2019 22:30:23

7K+ Views

To make an existing field unique in MySQL, we can use the ALTER command and set UNIQUE constraint for the field. Let us see an example. First, we will create a table. mysql> create table AddingUnique -> ( -> Id int, ... Read More

How to display all tables in MySQL with InnoDB storage engine?

Arjun Thakur

Arjun Thakur

Updated on 30-Jul-2019 22:30:23

423 Views

To display all table names with ENGINE as InnoDB, implement the following query mysql> SELECT TABLE_SCHEMA as DATABASENAME ,TABLE_NAME as AllTABLENAME ,ENGINE as ENGINETYPE FROM information_schema.TABLES -> WHERE ENGINE = 'innoDB' -> AND TABLE_SCHEMA NOT IN('mysql', 'information_schema', 'performance_schema'); The following is the ... Read More

What is search view in android?

Arjun Thakur

Arjun Thakur

Updated on 30-Jul-2019 22:30:23

170 Views

Before getting into searchview example, we should know what is search view in android, search view is just like search box in HTML. we can search anything from particular list items.This example demonstrate about how to integrate search view in android.Step 1 − Create a new project in Android Studio, ... Read More

How to access unique Android device ID?

Arjun Thakur

Arjun Thakur

Updated on 30-Jul-2019 22:30:23

2K+ Views

If you want to check unique device id like IMEI number through programmatically we can do this by telephonic manger as shown below example −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 ... Read More

How to prepend a string to a column value in MySQL?

Arjun Thakur

Arjun Thakur

Updated on 30-Jul-2019 22:30:23

4K+ Views

To prepend a string to a column value in MySQL, we can use the function CONCAT. The CONCAT function can be used with UPDATE statement. Creating a table. mysql> create table PrependStringOnCOlumnName   -> (   -> Id int,   -> Name varchar(200)   -> ); Query OK, 0 ... Read More

How do I see what character set a MySQL database  / table / column is?

Arjun Thakur

Arjun Thakur

Updated on 30-Jul-2019 22:30:23

4K+ Views

To check what character set a MySQL database/ table/ column is, let us see an example: A database which has the name ‘business’ and table name is ‘student’ which is already present in the database is used. Syntax in order to check the table character set. SELECT CCSA.character_set_name ... Read More

Get digits from a record in MySQL?

Arjun Thakur

Arjun Thakur

Updated on 30-Jul-2019 22:30:23

155 Views

Use the function CONVERT() or Regular Expression. The CONVERT() method converts a value from one datatype to another. This will ecnetually fetch digits for us. Let us see an example. Firstly, we will create a table. mysql> create table textIntoNumberDemo   -> (   -> Name varchar(100)   -> ... Read More

MySQL pagination without double-querying?

Arjun Thakur

Arjun Thakur

Updated on 30-Jul-2019 22:30:23

203 Views

To work with MySQL pagination, firstly let us see how to use CREATE command and use it to create a table. mysql>CREATE table RowCountDemo -> ( -> ID int, -> Name varchar(100) -> ); Query OK, 0 ... Read More

Find rows that have the same value on a column in MySQL?

Arjun Thakur

Arjun Thakur

Updated on 30-Jul-2019 22:30:23

2K+ Views

First, we will create a table and insert some values into the table. Let us create a table. mysql> create table RowValueDemo -> ( -> Name varchar(100) -> ); Query OK, 0 rows affected (0.69 sec) Insert records using ... Read More

How to use MySQL JOIN without ON condition?

Arjun Thakur

Arjun Thakur

Updated on 30-Jul-2019 22:30:23

4K+ Views

We can use ‘cross join’ without on condition. Cross join gives the result in cartesian product form. For instance, if in one table there are 3 records and another table has 2 records, then the first record will match with all the second table records. Then, the same process will ... Read More

Advertisements