- 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
AmitDiwan has Published 11365 Articles
AmitDiwan
68 Views
The EXPLAIN keyword tells how MySQL executes the query. Let us first create a table −mysql> create table DemoTable1375 -> ( -> Id int NOT NULL AUTO_INCREMENT PRIMARY KEY, -> FirstName varchar(20), -> INDEX FIRST_INDEX(FirstName) -> ); Query OK, 0 rows affected (0.73 sec)Insert some ... Read More
AmitDiwan
3K+ Views
Use CASE WHEN for this in MySQL and set CASE condition inside the COUNT() method to count. Let us first create a table −mysql> create table DemoTable1374 -> ( -> Id int NOT NULL AUTO_INCREMENT PRIMARY KEY, -> Name varchar(20), -> Score int -> ); ... Read More
AmitDiwan
867 Views
To display records like JSON format, use MySQL concat(). Let us first create a table −mysql> create table DemoTable1373 -> ( -> StudentId int NOT NULL AUTO_INCREMENT PRIMARY KEY, -> StudentDetails text -> ); Query OK, 0 rows affected (0.86 sec)Insert some records in the table ... Read More
AmitDiwan
654 Views
For this, just update the table and subtract. Let us first create a table −mysql> create table DemoTable1372 -> ( -> Value int -> ); Query OK, 0 rows affected (0.77 sec)Insert some records in the table using insert command −mysql> insert into DemoTable1372 values(500); Query OK, ... Read More
AmitDiwan
1K+ Views
For this, use GROUP_CONCAT(). Do not use GROUP BY clause, since GROUP_CONTACT() is a better and quick solution.Let us first create a table −mysql> create table DemoTable1371 -> ( -> Id int, -> CountryName varchar(40) -> ); Query OK, 0 rows affected (0.89 sec)Insert some records ... Read More
AmitDiwan
92 Views
For only specific cells, set a condition with WHERE and use aggregate function SUM() to add. Let us first create a table −mysql> create table DemoTable1370 -> ( -> StudentName varchar(20), -> Marks int -> ); Query OK, 0 rows affected (0.87 sec)Insert some records in ... Read More
AmitDiwan
183 Views
The DateTimeOffset.AddMonths() method in C# is used to add a specified number of months to the value of this instance.SyntaxFollowing is the syntax −public DateTimeOffset AddMonths (int val);Above, Val is the number of months to be added. For subtracting months, set a negative value.ExampleLet us now see an example to ... Read More
AmitDiwan
280 Views
The DateTimeOffset.AddMinutes() method in C# is used to adds a specified number of whole and fractional minutes to the value of this instance.SyntaxFollowing is the syntax −public DateTimeOffset AddMinutes (double val);Above, Val is the number of minutes to be added. To subtract, set a negative value for minutes.ExampleLet us now ... Read More
AmitDiwan
264 Views
The Byte.Equals(Byte) method in C# returns a value indicating whether this instance and a specified Byte object represent the same value.SyntaxFollowing is the syntax −public bool Equals (byte ob);Above, ob is an object to compare to this instance.ExampleLet us now see an example to implement the Byte.Equals(Byte) method −using System; ... Read More
AmitDiwan
43 Views
The Byte.CompareTo(Object) method in C# is used to compare this instance to a specified object and returns an indication of their relative values.SyntaxFollowing is the syntax −public int CompareTo (object val);Above, Val is an object to compare or null.The return value is less than zero if the current instance is ... Read More