- 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
311 Views
To add characters to an existing int column values, use MySQL CONCAT(). Let us first create a table −mysql> create table DemoTable ( Amount int ); Query OK, 0 rows affected (1.44 sec)Insert some records in the table using insert command −mysql> insert into DemoTable values(709); Query OK, 1 ... Read More
AmitDiwan
593 Views
To pull records for the last 60 minutes, use MySQL INTERVAL as shown in the below syntax −select *from yourTableName where yourColumnName > now() - interval 60 minute;Let us first create a table −mysql> create table DemoTable ( ArrivalTime datetime ); Query OK, 0 rows affected (0.61 sec)Let us ... Read More
AmitDiwan
3K+ Views
The optimal solution to select records beginning with certain numbers, use MySQL LIKE operator. Let us first create a table −mysql> create table DemoTable ( ClientId bigint, ClientName varchar(40) ); Query OK, 0 rows affected (0.82 sec)Insert some records in the table using insert command −mysql> insert into ... Read More
AmitDiwan
396 Views
For selective multiple records, use MySQL IN(). To delete them, use MySQL DELETE. Let us first create a table −mysql> create table DemoTable ( ClientId varchar(40), ClientName varchar(50) ); Query OK, 0 rows affected (0.62 sec)Insert some records in the table using insert command −mysql> insert into DemoTable ... Read More
AmitDiwan
1K+ Views
For this, use CONCAT() along with LIKE operator. Let us first create a table −mysql> create table DemoTable ( Name varchar(40) ); Query OK, 0 rows affected (0.56 sec)Insert some records in the table using insert command −mysql> insert into DemoTable values('John'); Query OK, 1 row affected (0.33 sec) ... Read More
AmitDiwan
761 Views
Let us first see how we can perform NAND/NOR operations in MySQL. The concept is as follows −NAND= NOT( yourColumnName1 AND yourColumnName2) NOR=NOT( yourColumnName1 OR yourColumnName2)Let us first create a table −mysql> create table DemoTable ( Value1 boolean , Value2 boolean ); Query OK, 0 rows affected (0.72 ... Read More
AmitDiwan
82 Views
Let us first create a table −mysql> create table DemoTable ( BookingDate date ); Query OK, 0 rows affected (0.67 sec)Insert some records in the table using insert command −mysql> insert into DemoTable values('2019-09-21'); Query OK, 1 row affected (0.16 sec) mysql> insert into DemoTable values('2018-09-10'); Query OK, 1 ... Read More
AmitDiwan
637 Views
Use GROUP BY with the COUNT() method. Group the names with GROUP BY and count using the COUNT() method. Let us first create a table −mysql> create table DemoTable ( Name varchar(30) ); Query OK, 0 rows affected (0.63 sec)Insert some records in the table using insert command −mysql> ... Read More
AmitDiwan
58 Views
To populate autocomplete, use the LIKE clause in MySQL. Let us first create a table −mysql> create table DemoTable ( SchoolName varchar(100) ); Query OK, 0 rows affected (0.56 sec)Insert some records in the table using insert command −mysql> insert into DemoTable values('Horce Greeley'); Query OK, 1 row affected ... Read More
AmitDiwan
1K+ Views
For this, use GROUP_CONCAT() along with GROUP BY. Here, the GROUP_CONCAT() is used to concatenate data from multiple rows into one field.Let us first create a table −mysql> create table DemoTable ( PlayerId int, ListOfPlayerName varchar(30) ); Query OK, 0 rows affected (0.52 sec)Insert some records in the ... Read More