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
132 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
196 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
190 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
562 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
239 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
401 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
AmitDiwan
830 Views
To exclude records, use MySQL NOT IN(). Let us first create a table −mysql> create table DemoTable ( Id int ); Query OK, 0 rows affected (0.64 sec)Insert some records in the table using insert command −mysql> insert into DemoTable values(1); Query OK, 1 row affected (0.16 sec) mysql> ... Read More
AmitDiwan
206 Views
Let us first create a table −mysql> create table DemoTable ( Name varchar(40), Position int ); Query OK, 0 rows affected (1.17 sec)Insert some records in the table using insert command −mysql> insert into DemoTable values('Chris', 90); Query OK, 1 row affected (0.20 sec) mysql> insert into DemoTable ... Read More
AmitDiwan
176 Views
For this, use aggregate function COUNT() and GROUP BY to group those specific records for occurrences. Let us first create a table −mysql> create table DemoTable ( StudentId int NOT NULL AUTO_INCREMENT PRIMARY KEY, StudentSubject varchar(40) ); Query OK, 0 rows affected (5.03 sec)Insert some records in the ... Read More
AmitDiwan
470 Views
To find a match from records, use MySQL IN(). Let us first create a table −mysql> create table DemoTable ( Id int, FirstName varchar(20), Gender ENUM('Male', 'Female') ); Query OK, 0 rows affected (1.73 sec)Insert some records in the table using insert command −mysql> insert into DemoTable ... Read More