
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
806 Views
To create an empty view in MySQL, following is the syntax −create or replace view yourViewName as select yourValue AS yourColumnName, yourValue AS yourColumnName2, . . N from dual where false;Let us implement the above syntax in order to create an empty view in MySQL −mysql> create or replace view ... Read More

AmitDiwan
4K+ Views
With the DEFAULT CURRENT_TIMESTAMP and ON UPDATE CURRENT_TIMESTAMP, a column has the current timestamp for its default value and is automatically updated to the current timestamp.Let us see an example and create a table −mysql> create table DemoTable737 ( StudentId int NOT NULL AUTO_INCREMENT PRIMARY KEY, StudentName varchar(100), ... Read More

AmitDiwan
1K+ Views
To update all the entries while ignoring a single value, you need to use IF().Let us first create a table −mysql> create table DemoTable736 ( CustomerId int NOT NULL AUTO_INCREMENT PRIMARY KEY, CustomerName varchar(100), isMarried boolean ); Query OK, 0 rows affected (0.53 sec)Insert some records in ... Read More

AmitDiwan
798 Views
To delete multiple entries from a MySQL table, use JOIN. Let us first create a table −mysql> create table DemoTabl(Id int NOT NULL AUTO_INCREMENT PRIMARY KEY, FirstName varchar(100)); Query OK, 0 rows affected (0.69 sec)Insert some records in the table using insert command −mysql> insert into DemoTable(FirstName) values('Chris'); Query OK, ... Read More

AmitDiwan
5K+ Views
To merge rows in MySQL, use GROUP_CONCAT().Let us first create a table−mysql> create table DemoTable734 ( Id int, Name varchar(100) ); Query OK, 0 rows affected (0.73 sec)Insert some records in the table using insert command−mysql> insert into DemoTable734 values(101, 'John'); Query OK, 1 row affected (0.23 sec) ... Read More

AmitDiwan
161 Views
Let us first create a table -mysql> create table DemoTable732 ( Id int NOT NULL AUTO_INCREMENT PRIMARY KEY, PassengerId int, PassengerName varchar(100), PassengerAge int, PassengerTravelDatetime datetime ); Query OK, 0 rows affected (0.67 sec)Insert some ... Read More

AmitDiwan
2K+ Views
Let us first create a table:mysql> create table DemoTable731 (Value varchar(100)); Query OK, 0 rows affected (0.50 sec)Insert some records in the table using insert command -mysql> insert into DemoTable731 values('4.50'); Query OK, 1 row affected (0.15 sec) mysql> insert into DemoTable731 values('7.83'); Query OK, 1 row affected (0.18 sec) ... Read More

AmitDiwan
2K+ Views
For this, use stored procedure. Let us first create a table −mysql> create table DemoTable(Id int, Name varchar(100)); Query OK, 0 rows affected (1.51 sec)Insert some records in the table using insert command −mysql> insert into DemoTable values(10, 'John'); Query OK, 1 row affected (0.17 sec) mysql> insert into DemoTable ... Read More

AmitDiwan
854 Views
To count days in date range, you need to find the difference between dates using DATEDIFF().Let us first create a table:mysql> create table DemoTable730 ( StartDate date, EndDate date ); Query OK, 0 rows affected (0.45 sec)Insert some records in the table using insert command:mysql> insert into DemoTable730 ... Read More

AmitDiwan
2K+ Views
For this, use UNION ALL.Let us first create a table:mysql> create table DemoTable729 ( StudentId int NOT NULL AUTO_INCREMENT PRIMARY KEY, StudentName varchar(100), MySQLMarks int, CMarks int, JavaMarks int ); Query OK, 0 rows affected (0.40 sec)Insert some records in the table using insert command:mysql> ... Read More