![Trending Articles on Technical and Non Technical topics](/images/trending_categories.jpeg)
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](https://www.tutorialspoint.com/assets/profiles/123055/profile/60_187394-1565938756.jpg)
AmitDiwan
133 Views
Let us first create a table −mysql> create table DemoTable( Id int NOT NULL AUTO_INCREMENT PRIMARY KEY, Name varchar(100), AdmissionDate date ); Query OK, 0 rows affected (0.42 sec)Insert some records in the table using insert command −mysql> insert into DemoTable(Name, AdmissionDate) values('Chris', '2019-11-21'); Query OK, 1 ... Read More
![AmitDiwan](https://www.tutorialspoint.com/assets/profiles/123055/profile/60_187394-1565938756.jpg)
AmitDiwan
204 Views
Let us first create a table −mysql> create table DemoTable ( Name varchar(100), Age int ); Query OK, 0 rows affected (0.46 sec)Insert some records in the table using insert command −mysql> insert into DemoTable values('Chris', 23); Query OK, 1 row affected (0.20 sec) mysql> insert into DemoTable ... Read More
![AmitDiwan](https://www.tutorialspoint.com/assets/profiles/123055/profile/60_187394-1565938756.jpg)
AmitDiwan
88 Views
For this, you can use COUNT(). Let us first create a table −mysql> create table DemoTable ( Value int ); Query OK, 0 rows affected (0.69 sec)Insert some records in the table using insert command −mysql> insert into DemoTable values(10); Query OK, 1 row affected (0.14 sec) mysql> insert ... Read More
![AmitDiwan](https://www.tutorialspoint.com/assets/profiles/123055/profile/60_187394-1565938756.jpg)
AmitDiwan
500 Views
Let us first create a table −mysql> create table DemoTable ( Id int NOT NULL AUTO_INCREMENT PRIMARY KEY, FirstName varchar(100) ); Query OK, 0 rows affected (0.46 sec)Insert some records in the table using insert command −mysql> insert into DemoTable(FirstName) values('Chris'); Query OK, 1 row affected (0.18 sec) ... Read More
![AmitDiwan](https://www.tutorialspoint.com/assets/profiles/123055/profile/60_187394-1565938756.jpg)
AmitDiwan
96 Views
Let us first create a table −mysql> create table DemoTable ( FirstName varchar(100), LastName varchar(100) ); Query OK, 0 rows affected (0.76 sec)Insert some records in the table using insert command −mysql> insert into DemoTable values('Chris', 'Brown'); Query OK, 1 row affected (0.12 sec) mysql> insert into DemoTable ... Read More
![AmitDiwan](https://www.tutorialspoint.com/assets/profiles/123055/profile/60_187394-1565938756.jpg)
AmitDiwan
1K+ Views
To update a field if it is null, use IS NULL property along with the UPDATE command. Let us first create a table −mysql> create table DemoTable ( StudentScore int ); Query OK, 0 rows affected (0.47 sec)Insert some records in the table using insert command −mysql> insert into ... Read More
![AmitDiwan](https://www.tutorialspoint.com/assets/profiles/123055/profile/60_187394-1565938756.jpg)
AmitDiwan
223 Views
To insert values from the first table to another table using two SELECT statements, use SUBQUERY. This will allow you to use only a single MySQL query to get the result in the second table. Let us first create a table −mysql> create table DemoTable1 ( Name varchar(100), ... Read More
![AmitDiwan](https://www.tutorialspoint.com/assets/profiles/123055/profile/60_187394-1565938756.jpg)
AmitDiwan
248 Views
For this, let us first create a table −mysql> create table DemoTable ( Message text ); Query OK, 0 rows affected (1.15 sec)Insert some records in the table using insert command −mysql> insert into DemoTable values('Good'); Query OK, 1 row affected (0.43 sec) mysql> insert into DemoTable values('Bye'); Query ... Read More
![AmitDiwan](https://www.tutorialspoint.com/assets/profiles/123055/profile/60_187394-1565938756.jpg)
AmitDiwan
584 Views
To set the default value in MySQL, you need to use the DEFAULT keyword. Let us first create a table −mysql> create table DemoTable ( ClientCountryName varchar(100) DEFAULT 'NONE' ); Query OK, 0 rows affected (0.65 sec)We have set DEFAULT above for values not entered while insertion. Now, let ... Read More
![AmitDiwan](https://www.tutorialspoint.com/assets/profiles/123055/profile/60_187394-1565938756.jpg)
AmitDiwan
199 Views
To fetch number of characters from the left of the string, use the LEFT method in MySQL. Let us first create a table −mysql> create table DemoTable ( Name varchar(100) ); Query OK, 0 rows affected (6.58 sec)Insert some records in the table using insert command −mysql> insert into ... Read More