Smita Kapse has Published 558 Articles

How to search for “ñ” and avoid records that include “n” in MySQL?

Smita Kapse

Smita Kapse

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

369 Views

If you do not want all records that include “n” when you search for “ñ”, use the following syntax −select *from yourTableName where yourColumnName LIKE '%ñ%' COLLATE utf8_spanish_ci;Let us first create a table. Following is the query −mysql> create table NotIncludenDemo    -> (    -> Id int NOT NULL ... Read More

How to use typeof () in Android sqlite?

Smita Kapse

Smita Kapse

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 ... Read More

Does MongoDB getUsers() and SHOW command fulfil the same purpose?

Smita Kapse

Smita Kapse

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

68 Views

Both the getUsers() method and SHOW command can be used to list all users in the Mongo shell.Case 1 − Using getUsers()The syntax is as follows −db.getUsers();Case 2 − Using show commandThe syntax is as follows −show users;Let us implement both the syntaxes in order to list all users in ... Read More

How to use concept () in Android text view?

Smita Kapse

Smita Kapse

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

96 Views

This example demonstrate about How to use concat () in Android textview.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.         ... Read More

Get the average row length of a MySQL table

Smita Kapse

Smita Kapse

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

139 Views

In order to get the average row length of a table in MySQL, you can use INFORMATION_SCHEMA.TABLES. Let us first create a table. Following is the query −mysql> create table Client_information    -> (    -> Id int,    -> Name varchar(10)    -> ); Query OK, 0 rows affected ... Read More

How to get current time zone in android using clock API class?

Smita Kapse

Smita Kapse

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

1K+ Views

This example demonstrate about How to get current time zone in android using clock API class.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. ... Read More

Can we use current_date() for table with column timestamp default in MySQL?

Smita Kapse

Smita Kapse

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

74 Views

Use the CURRENT_TIMESTAMP instead of current_date() in MySQL for timestamp default current_date. Let us first create a table. Following is the query −mysql> create table defaultCurrent_DateDemo    -> (    -> StudentId int NOT NULL AUTO_INCREMENT PRIMARY KEY,    -> StudentName varchar(20),    -> StudentAdmissionDate timestamp default CURRENT_TIMESTAMP    -> ... Read More

How to delete n-th element of array in MongoDB?

Smita Kapse

Smita Kapse

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

234 Views

You can use $unset as well as $pull operator with an update to delete the nth element of an array.Let us create a collection with a document. The query to create a collection with a document is as follows −> db.getNThElementDemo.insertOne({"UserName":"John", "UserAge":23, "ListOfFriends":["Carol", "Sam", "Mike", "Bob"]}); {    "acknowledged" : ... Read More

Merge two tables with union in MySQL?

Smita Kapse

Smita Kapse

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

531 Views

To merge two tables with UNION, you can use create table select statement. Following is the syntax −create table yourNewTableName select * from yourFirstTableName UNION select * from yourSecondTableName;Let us first create a table. Following is the query −mysql> create table FirstTable    -> (    -> Id int,   ... Read More

How to change current country code in android?

Smita Kapse

Smita Kapse

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

680 Views

This example demonstrate about How to change current country code in android.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 ... Read More

Advertisements