
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 10744 Articles

AmitDiwan
331 Views
Let us first create a table −mysql> create table DemoTable ( AdmissionDate varchar(50) ); Query OK, 0 rows affected (0.63 sec)Note − Let’s say the current date is 14-Sep-2019.Insert some records in the table using insert command. Following is the query −mysql> insert into DemoTable values('15-Sep-2019'); Query OK, 1 ... Read More

AmitDiwan
657 Views
Yes, we can implement nested insert with select in MySQL as shown in the below syntax −insert into yourTableName2(yourColumnName1, yourColumnName2, .....N) select yourColumnName1, yourColumnName2, ....N from yourTableName1 where yourCondition;Let us first see an example and create a table −mysql> create table DemoTable1 ( Id int NOT NULL AUTO_INCREMENT PRIMARY ... Read More

AmitDiwan
2K+ Views
Let us first create a table −mysql> create table DemoTable ( PageId int ); Query OK, 0 rows affected (0.85 sec)Insert some records in the table using insert command −mysql> insert into DemoTable values(233); Query OK, 1 row affected (0.36 sec) mysql> insert into DemoTable values(34); Query OK, 1 ... Read More

AmitDiwan
207 Views
For this, you can use DELETE command. Let us first create a table −mysql> create table DemoTable1 ( Id int, Name varchar(20) ); Query OK, 0 rows affected (0.63 sec)Insert some records in the table using insert command −mysql> insert into DemoTable1 values(1, 'Chris'); Query OK, 1 row ... Read More

AmitDiwan
110 Views
Let us first create a table −mysql> create table DemoTable ( StudentId int, StudentName varchar(20), StudentSubject varchar(20) ); Query OK, 0 rows affected (0.62 sec)Insert some records in the table using insert command −mysql> insert into DemoTable values(10, 'Chris', 'MongoDB'); Query OK, 1 row affected (0.21 sec) ... Read More

AmitDiwan
182 Views
Let us first create a table −mysql> create table DemoTable ( Name varchar(40) ) ; Query OK, 0 rows affected (0.63 sec)Insert some records in the table using insert command −mysql> insert into DemoTable values('John.Smith'); Query OK, 1 row affected (0.30 sec) mysql> insert into DemoTable values('Chris Brown'); Query ... Read More

AmitDiwan
172 Views
Fir this, you can concatenate 0 with string field with the help of + operator. The scenario here is like we need to fetch numeric “9844” from a string field “9844Bob”.Let us first create a table −mysql> create table DemoTable ( StudentId varchar(100) ); Query OK, 0 rows affected ... Read More

AmitDiwan
533 Views
Let us first create a table −mysql> create table DemoTable ( Value float ); Query OK, 0 rows affected (0.95 sec)Insert some records in the table using insert command −mysql> insert into DemoTable values(12.4567); Query OK, 1 row affected (0.12 sec) mysql> insert into DemoTable values(124.7884); Query OK, 1 ... Read More

AmitDiwan
225 Views
For this, the syntax is as follows −DELIMITER // create trigger yourTriggerName before insert on yourTableName1 for each row begin insert into yourTableName2 values (yourValue1, yourValue2, ...N); end ; // DELIMITER ;Let us first create a table −mysql> create table DemoTable1 ( StudentId ... Read More

AmitDiwan
372 Views
Let’s say the current date is 2019-09-14 8 :50 :10. Now, we want records from 00 :00 to 2019-09-14 8 :50 :10. Let us now see an example and create a table −mysql> create table DemoTable ( DueDate datetime ); Query OK, 0 rows affected (0.66 sec)Insert some records ... Read More