
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
858 Views
Let’s say the current date is 2019-08-03. Now, we will see an example and create a table −mysql> create table DemoTable840(DueDate datetime); Query OK, 0 rows affected (0.66 sec)Insert some records in the table using insert command −mysql> insert into DemoTable840 values('2019-08-9'); Query OK, 1 row affected (0.10 sec) mysql> ... Read More

AmitDiwan
262 Views
To sum, you can use aggregate function SUM(). Let us first create a table −mysql> create table DemoTable850( Id int, Price int ); Query OK, 0 rows affected (0.54 sec)Insert some records in the table using insert command −mysql> insert into DemoTable850 values(1, 90); Query OK, 1 row ... Read More

AmitDiwan
9K+ Views
The current date format is ‘YYYY-mm-dd’. To change current date format, you can use date_format().Let us first display the current date −mysql> select curdate();This will produce the following output −+------------+ | curdate() | +------------+ | 2019-08-08 | +------------+ 1 row in set (0.00 sec)Following is the query to change ... Read More

AmitDiwan
1K+ Views
For this, use aggregate function SUM(). Within this method, multiply the row values. Let us first create a table −mysql> create table DemoTable( ProductQuantity int, ProductPrice int ); Query OK, 0 rows affected (0.48 sec)Insert some records in the table using insert command −mysql> insert into DemoTable values(10, ... Read More

AmitDiwan
978 Views
For this, use GROUP BY clause along with aggregate function SUM(). Let us first create a table −mysql> create table DemoTable( Name varchar(100), Score int ); Query OK, 0 rows affected (0.70 sec)Insert some records in the table using insert command −mysql> insert into DemoTable values('Adam', 50); Query ... Read More

AmitDiwan
171 Views
Let us first create a table −mysql> create table DemoTable( Id int NOT NULL AUTO_INCREMENT PRIMARY KEY, CustomerName varchar(100) ); Query OK, 0 rows affected (0.51 sec)Insert some records in the table using insert command −mysql> insert into DemoTable(CustomerName) values('Adam Smith'); Query OK, 1 row affected (0.17 sec) ... Read More

AmitDiwan
7K+ Views
For this, you can use CASE statement. Let us first create a table −mysql> create table DemoTable( Id int, Value int ); Query OK, 0 rows affected (0.51 sec)Insert some records in the table using insert command −mysql> insert into DemoTable values(10, 100); Query OK, 1 row affected ... Read More

AmitDiwan
467 Views
Let us first create a table −mysql> create table DemoTable( EmployeeId int NOT NULL AUTO_INCREMENT PRIMARY KEY, EmployeeName varchar(100), JoiningDate date ); Query OK, 0 rows affected (0.48 sec)Insert some records in the table using insert command −mysql> insert into DemoTable(EmployeeName, JoiningDate) values('Chris', '2019-01-21'); Query OK, 1 ... Read More

AmitDiwan
5K+ Views
Let us first create a table −mysql> create table DemoTable( Id int NOT NULL AUTO_INCREMENT PRIMARY KEY, Name varchar(100) ); Query OK, 0 rows affected (0.47 sec)Insert some records in the table using insert command −mysql> insert into DemoTable(Name) values('John'); Query OK, 1 row affected (0.10 sec) mysql> ... Read More

AmitDiwan
3K+ Views
The statement SELECT TRUE returns 1 if a row match. Let us first create a table −mysql> create table DemoTable(Name varchar(100)); Query OK, 0 rows affected (0.54 sec)Insert some records in the table using insert command −mysql> insert into DemoTable values('Chris'); Query OK, 1 row affected (0.15 sec) mysql> insert ... Read More