
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
AmitDiwan has Published 10744 Articles

AmitDiwan
123 Views
For this, you can use sub query along with aggregate function MAX(). Let us first create a table −mysql> create table DemoTable -> ( -> ProductId int, -> ProductAmount int -> ); Query OK, 0 rows affected (0.78 sec)Insert some records in the table using insert ... Read More

AmitDiwan
1K+ Views
To add a new column to an already created table, use ALTER TABLE and ADD COLUMN. Use AUTO_INCREMENT to set auto increment custom value.Let us first create a table −mysql> create table DemoTable -> ( -> StudentName varchar(20) -> ); Query OK, 0 rows affected (0.63 sec)Insert ... Read More

AmitDiwan
445 Views
The order is a reserved word. To still use a reserved word, you need to use backticks around the column name. Let us first create a table −mysql> create table `order` -> ( -> StudentId int -> ); Query OK, 0 rows affected (1.78 sec)Insert some records ... Read More

AmitDiwan
160 Views
For this, you can use an aggregate function SUM() along with the condition. Let us first create a table −mysql> create table DemoTable -> ( -> Status varchar(20) -> ); Query OK, 0 rows affected (1.22 sec)Insert some records in the table using insert command −mysql> insert ... Read More

AmitDiwan
495 Views
To find a match, use regular expressions in MySQL. Let us first create a table −mysql> create table DemoTable -> ( -> Value varchar(60) -> ); Query OK, 0 rows affected (0.48 sec)Insert some records in the table using insert command −mysql> insert into DemoTable values('8|56|78|45'); Query ... Read More

AmitDiwan
522 Views
To insert records with double quotes, use a backslash (\) as in the below syntax −Syntaxinsert into yourTableName values('\"yourValue\"');Let us first create a table −mysql> create table DemoTable -> ( -> Name varchar(20) -> ); Query OK, 0 rows affected (0.63 sec)Insert some records in the table ... Read More

AmitDiwan
138 Views
Let us first create a table −mysql> create table DemoTable -> ( -> ListOfName text -> ); Query OK, 0 rows affected (0.66 sec)Insert some records in the table using insert command −mysql> insert into DemoTable values('Carol, Sam, John, David, Bob, Mike, Robert, John, Chris, James, Jace'); ... Read More

AmitDiwan
707 Views
To extract date from the string in MySQL, use SUBSTRING_INDEX(). Let us first create a table −mysql> create table DemoTable -> ( -> Title text -> ); Query OK, 0 rows affected (0.58 sec)Insert some records in the table using insert command −mysql> insert into DemoTable values('John ... Read More

AmitDiwan
475 Views
Use MySQL GROUP_BY to find the number of occurrences from two columns. Let us first create a table −mysql> create table DemoTable -> ( -> Name1 varchar(20), -> Name2 varchar(20) -> ); Query OK, 0 rows affected (0.61 sec)Insert some records in the table using insert ... Read More

AmitDiwan
2K+ Views
Let us first create a table −mysql> create table DemoTable -> ( -> Date1 date, -> Date2 date -> ); Query OK, 0 rows affected (1.04 sec)Insert some records in the table using insert command &miuns;mysql> insert into DemoTable values('2017-01-10', '2017-12-10'); Query OK, 1 row affected ... Read More