- Trending Categories
- Data Structure
- Networking
- RDBMS
- Operating System
- Java
- MS Excel
- iOS
- HTML
- CSS
- Android
- Python
- C Programming
- C++
- C#
- MongoDB
- MySQL
- Javascript
- PHP
- Physics
- Chemistry
- Biology
- Mathematics
- English
- Economics
- Psychology
- Social Studies
- Fashion Studies
- Legal Studies
- 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 629 Articles
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
2K+ Views
StackThe stack which is implemented as LIFO, where insertion and deletion are done from the same end, top. The last element that entered is deleted first.Stack operations are −push (int data) − Insertion at topint pop() − Deletion from topQueueThe queue which is implemented as FIFO where insertions are done ... Read More
Anvi Jain
2K+ 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
Anvi Jain
163 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
9K+ Views
Dequeue or Double Ended Queue is a generalized version of Queue data structure that allows insert and delete at both ends.Some basic operations of dequeue are −insert_at_beg(): inserts an item at the front of Dequeue.insert_at_end(): inserts an item at the rear of Dequeue.delete_fr_beg(): Deletes an item from front of Dequeue.delete_fr_rear(): ... Read More
Anvi Jain
1K+ Views
To calculate a value from multiple columns, use GROUP BY. Following is the syntax −select yourColumnName1, sum(yourColumnName2*yourColumnName3) AS anyAliasName from yourTableName group by yourColumnName1;Let us first create a table −mysql> create table calculateValueDemo -> ( -> Id int, -> ProductPrice int, -> ProductWeight int -> ... Read More
Anvi Jain
479 Views
You can return a specific field from collection.find() by using the following syntax.Case 1 − The syntax is as follows −db.yourCollectionName.find({}, {"yourFieldName":1}).pretty();The above field name is set to 1 means it will return only that field. If you set to 0 it will return all fields except the field which ... Read More
Anvi Jain
727 Views
If a directed graph is given, determine if a vertex j is reachable from another vertex i for all vertex pairs (i, j) in the given graph. Reachable mean that there is a path from vertex i to j. This reach-ability matrix is called transitive closure of a graph. Warshall ... Read More
Anvi Jain
268 Views
The CAST() function in MySQL converts a value of any type into a value that has a specified type. Let us first create a table −mysql> create table castFunctionDemo -> ( -> ShippingDate date -> ); Query OK, 0 rows affected (0.74 sec)Following is the query to ... Read More
Anvi Jain
1K+ Views
Here is a C++ Program to Implement Traveling Salesman Problem using Nearest Neighbour Algorithm.Required functions and pseudocodesAlgorithmBegin Initialize c = 0, cost = 1000; Initialize g[][]. function swap() is used to swap two values x and y. function cal_sum() to calculate the cost which take array ... Read More