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
97 Views
For this can use DATE_FORMAT() in MySQL. Let us first create a table −mysql> create table DemoTable -> ( -> PurchaseDate date, -> Amount int -> ); Query OK, 0 rows affected (0.52 sec)Insert some records in the table using insert command −mysql> insert into DemoTable ... Read More
AmitDiwan
349 Views
For this, use BETWEEN keyword. Let us first create a table −mysql> create table DemoTable1537 -> ( -> StudentId int NOT NULL AUTO_INCREMENT PRIMARY KEY, -> StudentName varchar(20) -> ); Query OK, 0 rows affected (0.72 sec)Insert some records in the table using insert command −mysql> ... Read More
AmitDiwan
2K+ Views
Let us first create a table. We have set one of the columns with type TINYINT −mysql> create table DemoTable -> ( -> EmployeeId int, -> isMarried tinyint -> ); Query OK, 0 rows affected (6.84 sec)Insert some records in the table using insert command −mysql> ... Read More
AmitDiwan
2K+ Views
For this, you can use WHERE clause with multiple LIKE. Let us first create a table −mysql> create table DemoTable1536 -> ( -> Sentence text -> ); Query OK, 0 rows affected (0.51 sec)Insert some records in the table using insert command −mysql> insert into DemoTable1536 values('I ... Read More
AmitDiwan
659 Views
To order by the first letter, use ORDER BY CASE statement. Let us first create a table −mysql> create table DemoTable1535 -> ( -> Value varchar(100) -> ); Query OK, 0 rows affected (2.26 sec)Insert some records in the table using insert command −mysql> insert into DemoTable1535 ... Read More
AmitDiwan
909 Views
To implement multiple LIKE clauses, the syntax is as follows −select * from yourTableName where yourColumnName1 LIKE ('%yourValue1%' or yourColumnName2 LIKE '%yourValue2%') or (yourColumnName3 LIKE '%yourValue3');Let us first create a table −mysql> create table DemoTable1534 -> ( -> ClientId int NOT NULL AUTO_INCREMENT PRIMARY KEY, -> ClientName ... Read More
AmitDiwan
1K+ Views
To count rows from multiple tables in MySQL, the syntax is as follows −Select (select count(*) from yourTableName1) as anyAliasName1, (select count(*) from yourTableName2) as anyAliasName2 from dual;Let us first create a table −mysql> create table DemoTable1 -> ( -> Id int ... Read More
AmitDiwan
735 Views
For this, use INET_ATON() in MySQL. The INET_ATON() method would allow a user to convert IP Address records to a number and then we can use ORDER BY to order them.Let us first create a table −mysql> create table DemoTable -> ( -> IpAddress varchar(50) -> ); ... Read More
AmitDiwan
238 Views
The MySQL equivalent to sybase ASE command is EXPLAIN keyword. Let us first create a table −mysql> create table DemoTable1531 -> ( -> StudentId int NOT NULL AUTO_INCREMENT PRIMARY KEY, -> StudentName varchar(20) -> ); Query OK, 0 rows affected (2.92 sec) mysql> create index Name_index1 ... Read More
AmitDiwan
896 Views
For this, use sub query along with MIN() and MAX(). To display both the maximum and minimum value, use UNION ALL. Let us first create a table −mysql> create table DemoTable -> ( -> EmployeeName varchar(20), -> EmployeeSalary int -> ); Query OK, 0 rows affected ... Read More