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 10740 Articles
AmitDiwan
214 Views
MySQL AND is used in WHERE to fetch a record by filtering using multiple conditions. Let us first create a table−mysql> create table DemoTable -> ( -> Id int, -> Name varchar(20) -> ); Query OK, 0 rows affected (0.70 sec)Insert some records in the table ... Read More
AmitDiwan
191 Views
To sort, use ORDER BY SUBSTRING(). Let us first create a table −mysql> create table DemoTable -> ( -> Value varchar(40) -> ); Query OK, 0 rows affected (0.59 sec)Insert some records in the table using insert command −mysql> insert into DemoTable values('2321/78/54-6') -> ; Query ... Read More
AmitDiwan
565 Views
For this, use ORDER BY clause. Let us first create a table −mysql> create table DemoTable -> ( -> StudentCode varchar(20) -> ); Query OK, 0 rows affected (0.57 sec)Insert some records in the table using insert command −mysql> insert into DemoTable values('101J'); Query OK, 1 row ... Read More
AmitDiwan
354 Views
Let us first create a table −mysql> create table DemoTable -> ( -> UserName varchar(20), -> UserType ENUM('New User', 'Registered User') -> ); Query OK, 0 rows affected (0.60 sec)Insert some records in the table using insert command −mysql> insert into DemoTable values('Chris', 'New User'); Query ... Read More
AmitDiwan
235 Views
To round number, use MySQL ROUND(). Let us first create a table −mysql> create table DemoTable -> ( -> Amount DECIMAL(10, 4) -> ); Query OK, 0 rows affected (1.18 sec)Insert some records in the table using insert command −mysql> insert into DemoTable values(100.578); Query OK, 1 ... Read More
AmitDiwan
240 Views
You can use ORDER BY STR_TO_DATE(). Let us first create a table −mysql> create table DemoTable -> ( -> DueTime varchar(20) -> ); Query OK, 0 rows affected (0.87 sec)Insert some records in the table using insert command −mysql> insert into DemoTable values('7:30AM'); Query OK, 1 row ... Read More
AmitDiwan
1K+ Views
The group is a reserved keyword, you can’t use it as table name. Therefore, on using it as table name would lead to an error. To avoid such error, you need to use enclosed backticks symbol around the table name ‘group’.Let us now see an example and create a table ... Read More
AmitDiwan
388 Views
To set conditions while adding column values, use MySQL IF(). Let us first create a table −mysql> create table DemoTable -> ( -> Value1 int, -> Value2 int, -> Value3 int -> ); Query OK, 0 rows affected (0.64 sec)Insert some records in the table ... Read More
AmitDiwan
777 Views
To set conditions, use CASE WHEN statement in MySQL. Let us first create a table −mysql> create table DemoTable -> ( -> Value1 int, -> Value2 int, -> Value3 int, -> Value4 int -> ); Query OK, 0 rows affected (0.98 sec)Insert some records ... Read More
AmitDiwan
219 Views
To change the MySQL ending statement, you can use DELIMITER −DELIMITER anySymbolAbove, anySymbol is the symbol you can set. The default is DELIMITER ;Let us first create a table −mysql> DELIMITER // mysql> create table DemoTable -> ( -> Id int, -> Name varchar(20) -> )// ... Read More