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
620 Views
For this, you can use GROUP BY HAVING clause along with IN(). Let us first create a table −mysql> create table DemoTable1885 ( FirstName varchar(20), Subject varchar(50) ); Query OK, 0 rows affected (0.00 sec)Insert some records in the table using insert command −mysql> insert into ... Read More
AmitDiwan
279 Views
Let us first create a table −mysql> create table DemoTable1884 ( Marks int ); Query OK, 0 rows affected (0.00 sec)Insert some records in the table using insert command −mysql> insert into DemoTable1884 values(55); Query OK, 1 row affected (0.00 sec) mysql> insert into DemoTable1884 values(97); Query ... Read More
AmitDiwan
264 Views
Yes, we can do that. The syntaxes are as follows −Syntax1: select * from yourTableName1, yourTableName2; Syntax2: select * from yourTableName1 cross join yourTableName2;Both the above syntaxes give the same result.Let us first create a table −mysql> create table DemoTable1882 ( Id int ); Query OK, 0 ... Read More
AmitDiwan
4K+ Views
For this, use INSERT INTO SELECT statement. Let us first create a table −mysql> create table DemoTable1879 ( Id int, Name varchar(20) ); Query OK, 0 rows affected (0.00 sec)Insert some records in the table using insert command −mysql> insert into DemoTable1879 values(101, 'Chris Brown'); Query ... Read More
AmitDiwan
235 Views
Use IFNULL() to find and place a specific value for NULL values. Let us first create a table −mysql> create table DemoTable1878 ( FirstName varchar(20) ); Query OK, 0 rows affected (0.00 sec)Insert some records in the table using insert command −mysql> insert into DemoTable1878 values('Chris'); Query ... Read More
AmitDiwan
5K+ Views
Let us first create a table −mysql> create table DemoTable1877 ( DueDate datetime ); Query OK, 0 rows affected (0.00 sec)Insert some records in the table using insert command −mysql> insert into DemoTable1877 values('2019-12-10'); Query OK, 1 row affected (0.00 sec) ... Read More
AmitDiwan
632 Views
Let us first create a table −mysql> create table DemoTable1875 ( Id int NOT NULL AUTO_INCREMENT PRIMARY KEY, Class varchar(20), Amount int ); Query OK, 0 rows affected (0.00 sec)Insert some records in the table using insert command −mysql> insert into DemoTable1875(Class, Amount) ... Read More
AmitDiwan
1K+ Views
For this, use CASE statement with UPDATE command. Let us first create a table −mysql> create table DemoTable1874 ( Id int NOT NULL AUTO_INCREMENT PRIMARY KEY, Amount varchar(100) ); Query OK, 0 rows affected (0.00 sec)Insert some records in the table using insert command ... Read More
AmitDiwan
426 Views
To update a single column, use UPDATE and SET as in the below syntax −update yourTableName set yourColumnName=yourValue;Let us first create a table −mysql> create table DemoTable1873 ( Id int NOT NULL AUTO_INCREMENT PRIMARY KEY, FirstName varchar(20) ); Query OK, 0 rows ... Read More
AmitDiwan
309 Views
For this, use SUBSTRING(). Let us first create a table −mysql> create table DemoTable1872 ( Name varchar(20) ); Query OK, 0 rows affected (0.00 sec)Insert some records in the table using insert command −mysql> insert into DemoTable1872 values('John Doe'); Query OK, 1 row affected (0.00 sec) mysql> ... Read More