
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
784 Views
Let us first create a table. Here. We have set UserId column with ZEROFILL and AUTO_INCREMENTmysql> create table DemoTable1831 ( UserId int(7) zerofill auto_increment, PRIMARY KEY(UserId) ); Query OK, 0 rows affected (0.00 sec)Insert some records in the table using insert command ... Read More

AmitDiwan
457 Views
To delete only specific rows, use MySQL NOT IN(). Let us first create a table −mysql> create table DemoTable1830 ( StudentId int NOT NULL AUTO_INCREMENT PRIMARY KEY, StudentName varchar(20) )AUTO_INCREMENT=101; Query OK, 0 rows affected (0.00 sec)Insert some records in the table ... Read More

AmitDiwan
143 Views
Let us first create a table −mysql> create table DemoTable1829 ( Name varchar(20), isTopper ENUM('YES', 'NO') ); Query OK, 0 rows affected (0.00 sec)Insert some records in the table using insert command −mysql> insert into DemoTable1829 values('Chris', 'yes'); Query OK, 1 row ... Read More

AmitDiwan
77 Views
To add a set of elements in a single cell, use the concept of JSON. Let us first create a table −mysql> create table DemoTable1828 ( EmployeeId int, EmployeeRecords JSON ); Query OK, 0 rows affected (0.00 sec)Insert some records in the ... Read More

AmitDiwan
828 Views
Let us create a stored procedure. Here, we are calculating amount*quantity i.e. implementing mathematical operations −mysql> delimiter // mysql> create procedure calculation_proc(amount int, quantity int) begin select amount, quantity, (amount*quantity) as Total; end // Query OK, 0 rows affected (0.00 sec) mysql> ... Read More

AmitDiwan
503 Views
To search for ^ character, use the LIKE operator as in the below syntax −select table_schema, table_name, column_name from information_schema.columns where column_name like '%^%';Let us first create a table −mysql> create table DemoTable1826 ( `^` varchar(20), Name varchar(20), `^Age` int ... Read More

AmitDiwan
521 Views
For this, you can use IS NOT NULL property. Let us first create a table −mysql> create table DemoTable1 ( DueDate date ); Query OK, 0 rows affected (0.00 sec)Insert some records in the table using insert command −mysql> insert into DemoTable1 values('2019-09-10'); Query ... Read More

AmitDiwan
395 Views
To implement if-else, the syntax is as follows −if yourCondition then yourStatement1; else yourStatement2; end if ;To understand the above concept for if-else in a stored procedure, let us create a stored procedure −mysql> delimiter // mysql> create procedure If_else_stored_demo(value int) ... Read More

AmitDiwan
744 Views
To increase precision with division, use MySQL CAST(). Let us first create a table −mysql> create table DemoTable1823 ( Value int ); Query OK, 0 rows affected (0.00 sec)Insert some records in the table using insert command −mysql> insert into DemoTable1823 values(1); Query OK, ... Read More

AmitDiwan
722 Views
Let us first create a table −mysql> create table DemoTable1822 ( Amount int, DueDate date ); Query OK, 0 rows affected (0.00 sec)Insert some records in the table using insert command −mysql> insert into DemoTable1822 values(1000, '2019-10-11'); Query OK, 1 row affected ... Read More