![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 11367 Articles
![AmitDiwan](https://www.tutorialspoint.com/assets/profiles/123055/profile/60_187394-1565938756.jpg)
AmitDiwan
139 Views
Let us first create a table −mysql> create table DemoTable707 ( StudentId int NOT NULL AUTO_INCREMENT PRIMARY KEY, StudentFirstName varchar(100), StudentMarks int ); Query OK, 0 rows affected (0.59 sec)Insert some records in the table using insert command −mysql> insert into DemoTable707(StudentFirstName, StudentMarks) values('John', 45); Query OK, ... Read More
![AmitDiwan](https://www.tutorialspoint.com/assets/profiles/123055/profile/60_187394-1565938756.jpg)
AmitDiwan
171 Views
To achieve this, following is the syntax wherein we have used DATE(NOW()) −select *from yourTableName where DATE(yourColumnName)=DATE(NOW());Let us first create a table −mysql> create table DemoTable706 ( UserId varchar(100), UserName varchar(100), UserSignupDate datetime ); Query OK, 0 rows affected (0.57 sec)Insert some records in the table using ... Read More
![AmitDiwan](https://www.tutorialspoint.com/assets/profiles/123055/profile/60_187394-1565938756.jpg)
AmitDiwan
201 Views
Let’s say the current date is −2019-07-22Let us first create a table −mysql> create table DemoTable705 (ShippingDate datetime); Query OK, 0 rows affected (0.67 sec)Insert some records in the table using insert command −mysql> insert into DemoTable705 values('2019-01-21 23:59:00'); Query OK, 1 row affected (0.17 sec) mysql> insert into DemoTable705 ... Read More
![AmitDiwan](https://www.tutorialspoint.com/assets/profiles/123055/profile/60_187394-1565938756.jpg)
AmitDiwan
281 Views
Let us first create a table −mysql> create table DemoTable704 (SubjectName text); Query OK, 0 rows affected (0.58 sec)Insert some records in the table using insert command −mysql> insert into DemoTable704 values('Introduction to MySQL'); Query OK, 1 row affected (0.15 sec) mysql> insert into DemoTable704 values('Introduction to MongoDB'); Query OK, ... Read More
![AmitDiwan](https://www.tutorialspoint.com/assets/profiles/123055/profile/60_187394-1565938756.jpg)
AmitDiwan
170 Views
For this, you can use CASE statement. Let us first create a table −mysql> create table DemoTable703 (Price int); Query OK, 0 rows affected (0.46 sec)Insert some records in the table using insert command −mysql> insert into DemoTable703 values(102); Query OK, 1 row affected (0.27 sec) mysql> insert into DemoTable703 ... Read More
![AmitDiwan](https://www.tutorialspoint.com/assets/profiles/123055/profile/60_187394-1565938756.jpg)
AmitDiwan
87 Views
You cannot give table name references because it is a reserved keyword. Wrap it using backticks, for example, `references`.Let us first create a table −mysql> create table `references`(Subject text); Query OK, 0 rows affected (0.44 sec)Insert some records in the table using insert command −mysql> insert into `references` values('Introduction To ... Read More
![AmitDiwan](https://www.tutorialspoint.com/assets/profiles/123055/profile/60_187394-1565938756.jpg)
AmitDiwan
63 Views
Let us first create a table −mysql> create table DemoTable702 ( StudentId int NOT NULL AUTO_INCREMENT PRIMARY KEY, StudentName varchar(100), StudentScore int ); Query OK, 0 rows affected (0.56 sec)Insert some records in the table using insert command −mysql> insert into DemoTable702(StudentName, StudentScore) values('Chris', 56); Query OK, ... Read More
![AmitDiwan](https://www.tutorialspoint.com/assets/profiles/123055/profile/60_187394-1565938756.jpg)
AmitDiwan
111 Views
Here, we will see an example wherein we are inserting datetime and updating them while using INSERT query.Let us first create a table −mysql> create table DemoTable816 (DueDate datetime); Query OK, 0 rows affected (0.45 sec)Insert some records in the table using insert command. Here is the query to add ... Read More
![AmitDiwan](https://www.tutorialspoint.com/assets/profiles/123055/profile/60_187394-1565938756.jpg)
AmitDiwan
5K+ Views
To copy from one column to another, you can use INSERT INTO SELECT statement.Let us first create a table −mysql> create table DemoTable1 (PlayerScore int); Query OK, 0 rows affected (0.46 sec)Insert some records in the table using insert command −mysql> insert into DemoTable1 values(98); Query OK, 1 row affected ... Read More
![AmitDiwan](https://www.tutorialspoint.com/assets/profiles/123055/profile/60_187394-1565938756.jpg)
AmitDiwan
2K+ Views
Use ALTER table to set the auto_increment column to 0 or reset with another valueALTER TABLE yourTableName AUTO_INCREMENT=0;The above syntax will begin from 1.Let us first create a table −mysql> create table DemoTable698 ( ClientId int NOT NULL AUTO_INCREMENT PRIMARY KEY ) auto_increment=109; Query OK, 0 rows affected (0.88 ... Read More