- 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
808 Views
Indexes in a table are pointers to the data, these speed up the data retrieval from a table. If we use indexes, the INSERT and UPDATE statements get executed in a slower phase. Whereas SELECT and WHERE get executed with in lesser time.Creating an indexCTREATE INDEX index_name on table_name (column_name);Displaying ... Read More
Anvi Jain
562 Views
You can change the MySQL date format with a specific format using DATE_FORMAT(). Following is the syntax −select date_format(yourColumnName, yourFormatSpecifier) from yourTableName;Let us first create a table −mysql> create table DemoTable ( ShippingDate date ); Query OK, 0 rows affected (0.48 sec)Insert some records in the table ... Read More
Anvi Jain
173 Views
To get the list of notifications which are active on your status bar tray we are going to use getdeliverednotifications, you can read more about it here.https://developer.apple.com/documentation/usernotifications/unusernotificationcenterhttps://developer.apple.com/documentation/usernotifications/unusernotificationcenter/1649520-getdeliverednotificationsWhile it is know that we cannot get the notifications from all apps as that would be a privacy violation, but we can get ... Read More
Anvi Jain
436 Views
To add components with relative X and Y coordinates, you need to set both the gridx and gridy components −GridBagConstraints constraints = new GridBagConstraints(); constraints.gridy = GridBagConstraints.RELATIVE; constraints.gridx = GridBagConstraints.RELATIVE;The following is an example to add components with relative X and Y Coordinates −Examplepackage my; import java.awt.GridBagConstraints; import java.awt.GridBagLayout; import ... Read More
Anvi Jain
64 Views
Yes, to display a database in the list, first create a database and add collection(s), else it won’t be visible in the list. After that, use the SHOW dbs command to display the database name in the list of databases.Following is the query to create a database −> use webcustomertracker; ... Read More
Anvi Jain
96 Views
Use aggregate function SUM() along with OVER. Let us first create a table −mysql> create table DemoTable ( CustomerId int NOT NULL AUTO_INCREMENT PRIMARY KEY, CustomerValue int ); Query OK, 0 rows affected (0.64 sec)Insert some records in the table using insert command −mysql> insert into ... Read More
Anvi Jain
1K+ Views
Let’s say we have lots of content in our JTextPane component −textPane.setText("This is demo text1. This is demo text2. This is demo text3." + "This is demo text4.This is demo text5. This is demo text6. " + "This is demo text7. This is demo text8. This is demo ... Read More
Anvi Jain
613 Views
For sorting and grouping in a single query, use the $group operator along with aggregate framework. Let us first create a collection with documents −> db.sortAndGroupDemo.insertOne({ Price :40, Product: 10 }); { "acknowledged" : true, "insertedId" : ObjectId("5ce8f2bc78f00858fb12e907") } > db.sortAndGroupDemo.insertOne({ Price :100, Product: ... Read More
Anvi Jain
107 Views
Use SET to decrease the value and WHERE to set the condition for a specific record to be 0. Let us first create a table −mysql> create table DemoTable ( Id int NOT NULL AUTO_INCREMENT PRIMARY KEY, Number int ); Query ... Read More
Anvi Jain
2K+ Views
Let us first create a collection with documents −> db.querySelectDemo.insertOne({UserId:100, UserName:"Chris", UserAge:25}); { "acknowledged" : true, "insertedId" : ObjectId("5ce90eb478f00858fb12e90e") } > db.querySelectDemo.insertOne({UserId:101, UserName:"Robert", UserAge:26}); { "acknowledged" : true, "insertedId" : ObjectId("5ce90ec578f00858fb12e90f") } > db.querySelectDemo.insertOne({UserId:103, UserName:"David", UserAge:27}); { "acknowledged" : true, "insertedId" : ObjectId("5ce90ed478f00858fb12e910") }Following ... Read More