Smita Kapse has Published 558 Articles

Can we enforce compound uniqueness in MySQL?

Smita Kapse

Smita Kapse

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

37 Views

Yes, we can do that. To understand, let us first create a table −mysql> create table enforceCompoundUniqueness    -> (    -> StudentId int NOT NULL AUTO_INCREMENT PRIMARY KEY,    -> StudentName varchar(40) NOT NULL,    -> StudentMobileNumber varchar(12) NOT NULL,    -> UNIQUE StudentName_StudentMobileNumber(StudentName, StudentMobileNumber)    -> ); Query ... Read More

How to query for records where field is null or not set in MongoDB?

Smita Kapse

Smita Kapse

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

677 Views

Let us work around two cases −Case 1 − The syntax is as follows when the field is present and set to null.db.yourCollectionName.count({yourFieldName: null});Case 1 − The syntax is as follows when the field is not present and not set.db.yourCollectionName.count({yourFieldName: {$exists: false}});To understand both the above syntaxes, let us create ... Read More

How to use endsWith () in Android textview?

Smita Kapse

Smita Kapse

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

211 Views

This example demonstrate about How to use endsWith () 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

While developing an iOS application you might have got a scenario where you require to send a text message and you would be baffling around with Why? How? And What?

Smita Kapse

Smita Kapse

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

71 Views

In this tutorial we will be focussing on how to send text message from your iOS application in Swift, where we will be sending a text message from your user’s phone number. While we cannot do this directly without the content of your user’s but we can display a precomposed ... Read More

How does MongoDB order their docs in one collection?

Smita Kapse

Smita Kapse

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

50 Views

MongoDB order the docs in one collection with the help of a $natural operator. It stores the document as it is when we get from find(). The default order is $natural. Let us now see the syntax −db.yourCollectionName.find().sort({ "$natural": 1 });To understand the above syntax, let us create a collection ... Read More

How to write MySQL procedure to insert data into a table?

Smita Kapse

Smita Kapse

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

542 Views

To write stored procedure to insert data into a table, at first you need to create a table −mysql> create table insertDataUsingStoredProcedure    -> (    -> Id int NOT NULL AUTO_INCREMENT PRIMARY KEY ,    -> Name varchar(20),    -> Age int    -> ); Query OK, 0 rows ... Read More

How to use equalsIgnoreCase () in Android textview?

Smita Kapse

Smita Kapse

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

362 Views

This example demonstrate about How to use equalsIgnoreCase () 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

MySQL query to display databases sorted by creation date?

Smita Kapse

Smita Kapse

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

433 Views

You can display databases sorted by creation date with ORDER BY clause. Following is the query to display all databases −mysql> show databases;This will produce the following output −+---------------------------+ | Database                  | +---------------------------+ | bothinnodbandmyisam       | | business   ... Read More

MongoDB aggregation framework match OR is possible?

Smita Kapse

Smita Kapse

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

158 Views

Let us first create a collection with the document. The query to create a collection with a document is as follows −> db.aggregationFrameworkWithOrMatchDemo.insertOne({"StudentFirstName":"John",    "StudentLastName":"Smith", "StudentAge":23}); {    "acknowledged" : true,    "insertedId" : ObjectId("5c8ac3a96cea1f28b7aa080d") } > db.aggregationFrameworkWithOrMatchDemo.insertOne({"StudentFirstName":"Carol",    "StudentLastName":"Tayor", "StudentAge":24}); {    "acknowledged" : true,    "insertedId" : ObjectId("5c8ac3bc6cea1f28b7aa080e") ... Read More

How to use unlikely () in Android sqlite?

Smita Kapse

Smita Kapse

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

53 Views

Before getting into 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

Advertisements