Smita Kapse has Published 498 Articles

How to work Date query with ISODate in MongoDB?

Smita Kapse

Smita Kapse

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

2K+ Views

Use $gte operator along with ISODate() to work Date query with ISODate in MongoDB.To understand the concept, let us create a collection with the document. The query to create a collection with a document is as follows −> db.dateDemo.insertOne({"StudentName":"John", "StudentAge":26, "AdmissionDate":new ISODate("2013-06-07")}); {    "acknowledged" : true,    "insertedId" : ... Read More

MySQL SELECT from table A that does not exist in table B using JOINS?

Smita Kapse

Smita Kapse

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

2K+ Views

To SELECT from table A that does not exist in table B, you can use left join. Following is the syntax −select yourTableNameA.* from yourTableNameA left join yourTableNameB on yourTableNameA.yourColumnName = yourTableNameB.yourColumnName where yourTableNameB.yourColumnName IS NULL;Let us first create a table. Following is the query −mysql> create table table_A   ... Read More

Achieve Pagination with MongoDB?

Smita Kapse

Smita Kapse

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

283 Views

You can achieve pagination with the help of limit() and skip() in MongoDB.To understand the concept, let us create a collection with the document. The query to create a collection with a document is as follows −> db.paginationDemo.insertOne({"CustomerName":"Chris", "CustomerAge":23}); {    "acknowledged" : true,    "insertedId" : ObjectId("5c949de44cf1f7a64fa4df52") } > ... Read More

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

Smita Kapse

Smita Kapse

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

529 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

228 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

100 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

150 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

292 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

111 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

Advertisements