
Data Structure
Networking
RDBMS
Operating System
Java
MS Excel
iOS
HTML
CSS
Android
Python
C Programming
C++
C#
MongoDB
MySQL
Javascript
PHP
- Selected Reading
- UPSC IAS Exams Notes
- Developer's Best Practices
- Questions and Answers
- Effective Resume Writing
- HR Interview Questions
- Computer Glossary
- Who is Who
Anvi Jain has Published 569 Articles

Anvi Jain
454 Views
To replace part of string in MySQL table column, you can use REPLACE(). Following is the syntax −update yourTableName set yourColumnName = REPLACE(yourColumnName ,'yourOldValue', 'yourNewValue');Let us first create a table −mysql> create table replacePartOfStringDemo -> ( -> WebsiteURL varchar(100) -> ); Query OK, 0 rows affected (0.47 ... Read More

Anvi Jain
302 Views
This example demonstrate about How to get latitude from Network provider 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

Anvi Jain
1K+ Views
To get the element with a max id, you can use the find() method. To understand the above concept, let us create a collection with the document. The query is as follows −> db.getElementWithMaxIdDemo.insertOne({"Name":"John", "Age":21}); { "acknowledged" : true, "insertedId" : ObjectId("5c8bbce480f10143d8431e1c") } > db.getElementWithMaxIdDemo.insertOne({"Name":"Larry", "Age":24}); { ... Read More

Anvi Jain
155 Views
There is no one elegant way to iterate the words of a C/C++ string. The most readable way could be termed as the most elegant for some while the most performant for others. I've listed 2 methods that you can use to achieve this. First way is using a stringstream ... Read More

Anvi Jain
2K+ Views
Use trim() function to remove trailing zeroz in MySQL. Following is the syntax −select trim(yourColumnName)+0 As anyAliasName from yourTableName;Let us first create a table −mysql> create table removeTrailingZero -> ( -> Number DECIMAL(10, 4) -> ); Query OK, 0 rows affected (0.83 sec)Following is the query to ... Read More

Anvi Jain
783 Views
Use GROUP BY clause for this. Let us first create a table −mysql> create table sumOfFieldsDemo -> ( -> Id int NOT NULL AUTO_INCREMENT PRIMARY KEY, -> ClientSerialNumber varchar(100), -> ClientCost int -> ); Query OK, 0 rows affected (0.50 sec)Following is the query to ... Read More

Anvi Jain
460 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 ... Read More

Anvi Jain
3K+ Views
You can restrict case insensitive search in MongoDB with the help of '$regex'. The syntax is as follows −db.yourCollectionName.find({"yourFieldName" : { '$regex':'^yourValue$'}});You can use another regex. The syntax is as follows −db.yourCollectionName.find({"Name" : { '$regex':/^yourValue$/i}});To understand the concept, let us create a collection with the document. The query to create ... Read More

Anvi Jain
3K+ Views
To update multiple rows in a single column, use CASE statement. Let us first create a table −mysql> create table updateMultipleRowsDemo -> ( -> StudentId int, -> StudentMathScore int -> ); Query OK, 0 rows affected (0.63 sec)Following is the query to insert records in the ... Read More

Anvi Jain
3K+ Views
To search if strings contain special characters, you can use REGEXP. Following is the syntax −select * from yourTableName where yourColumnName REGEXP '[^a-zA-Z0-9]';Let us first create a table −mysql> create table specialCharactersDemo -> ( -> StudentId varchar(100) -> ); Query OK, 0 rows affected (0.58 sec)Insert records ... Read More