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
155 Views
Use the MySQL LIKE operator to match even when punctuation is present. Let us first create a table−mysql> create table DemoTable -> ( -> Comments varchar(20) -> ); Query OK, 0 rows affected (1.10 sec)Insert some records in the table using insert command −mysql> insert into DemoTable ... Read More
AmitDiwan
2K+ Views
For this, you can use STR_TO_DATE(). Let us first create a table −mysql> create table DemoTable1565 -> ( -> ArrivalDatetime varchar(40) -> ); Query OK, 0 rows affected (0.82 sec)Insert some records in the table using insert command −mysql> insert into DemoTable1565 values('10/01/2019 21:29:35'); Query OK, 1 ... Read More
AmitDiwan
2K+ Views
For this, you can use the CASE statement. Let us first create a table−mysql> create table DemoTable -> ( -> Name varchar(20), -> Marks1 int, -> Marks2 int -> ); Query OK, 0 rows affected (0.72 sec)Insert some records in the table using insert command−mysql> ... Read More
AmitDiwan
156 Views
For this, use MySQL FIND_IN_SET(). Let us first create a table −mysql> create table DemoTable1563 -> ( -> StudentId int, -> StudentName varchar(20) -> ); Query OK, 0 rows affected (0.52 sec)Insert some records in the table using insert command −mysql> insert into DemoTable1563 values(1001, 'Chris'); ... Read More
AmitDiwan
875 Views
To sort from max to min value, use ORDER BY length(). Let us first create a table −mysql> create table DemoTable -> ( -> Price varchar(20) -> ); Query OK, 0 rows affected (0.92 sec)Insert some records in the table using insert command −mysql> insert into DemoTable ... Read More
AmitDiwan
479 Views
Do not prefix table name with field name like user_name. Instead, use user or username.If you prefix table name, then there may be a chance of ambiguity, so avoid prefixing table name.Let us first create a table −mysql> create table user -> ( -> username varchar(20), -> ... Read More
AmitDiwan
180 Views
For this, use MySQL MONTH() and YEAR() methods. Let us first create a table −mysql> create table DemoTable1562 -> ( -> VoucherValue int, -> RechargeDate date -> ); Query OK, 0 rows affected (1.40 sec)Insert some records in the table using insert command −mysql> insert into ... Read More
AmitDiwan
209 Views
For this, you can use a sub query along with MIN(). Let us first create a table−mysql> create table DemoTable -> ( -> Name varchar(20), -> Score int -> ); Query OK, 0 rows affected (0.56 sec)Insert some records in the table using insert command −mysql> ... Read More
AmitDiwan
151 Views
For this, you can use GROUP_CONCAT(). Let us first create a table −mysql> create table DemoTable1561 -> ( -> StudentName varchar(20), -> Title text -> ); Query OK, 0 rows affected (0.60 sec)Insert some records in the table using insert command −mysql> insert into DemoTable1561 values('Adam', ... Read More
AmitDiwan
886 Views
You can’t use the index as a column name because it is a reserved word. For this, you need to use backticks around the column name.If you will use a reserved word as the column name, you can see the following error−mysql> create table DemoTable -> ( -> ... Read More