
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
3K+ Views
Let us first create a table −mysql> create table DemoTable -> ( -> Id int, -> Name varchar(20) -> ); Query OK, 0 rows affected (1.37 sec)Insert some records in the table using insert command −mysql> insert into DemoTable values(101, 'Chris'); Query OK, 1 row affected ... Read More

AmitDiwan
583 Views
Use INSERT INTO statement in the Java-MySQL connection code to insert a column.Let us first create a table −mysql> create table DemoTable -> ( -> Name varchar(20) -> ); Query OK, 0 rows affected (0.54 sec)Here is the Java code to insert only a single column into ... Read More

AmitDiwan
303 Views
Let us first create a table −mysql> create table DemoTable -> ( -> Value longtext -> ); Query OK, 0 rows affected (0.94 sec)Insert some records in the table using insert command −mysql> insert into DemoTable values('778437437447488487476464644433334'); Query OK, 1 row affected (0.18 sec) mysql> insert into ... Read More

AmitDiwan
115 Views
The following syntax will fetch all the values from the column −select * from yourTableName where yourColumnName=0;Let us first create a table −mysql> create table DemoTable1791 ( FirstName varchar(20) ); Query OK, 0 rows affected (0.00 sec)Insert some records in the table using insert ... Read More

AmitDiwan
188 Views
Let us first create a table −mysql> create table DemoTable1795 ( Name varchar(20), DueDate date ); Query OK, 0 rows affected (0.00 sec)Insert some records in the table using insert command −mysql> insert into DemoTable1795 values('John', '2018-07-21'); Query OK, 1 row affected ... Read More

AmitDiwan
749 Views
For this, you can use TRUNCATE TABLE command. Let us first create a table −mysql> create table DemoTable1796 ( StudentId int NOT NULL AUTO_INCREMENT PRIMARY KEY, StudentName varchar(20) ); Query OK, 0 rows affected (0.00 sec)Insert some records in the table using ... Read More

AmitDiwan
316 Views
For this, you can use STR_TO_DATE(), since we have date records in the following format: 21/11/2019.Let us first create a table −mysql> create table DemoTable1808 ( AdmissionDate varchar(20) ); Query OK, 0 rows affected (0.00 sec)Insert some records in the table using insert command ... Read More

AmitDiwan
492 Views
Following is the syntax to match date with date() function and updating a column −update yourTableName set yourColumnName=yourValue where date(yourColumnName)=curdate();Let us first create a table −mysql> create table DemoTable1816 ( Name varchar(20), JoiningDate datetime ); Query OK, 0 rows affected (0.00 sec)Insert ... Read More

AmitDiwan
169 Views
For this, you can use COUNT() along with GROUP BY MONTH(). To match with the current date, use CURRENT_DATE(). The current date is as follows −mysql> select curdate() ; +------------+ | curdate() | +------------+ | 2019-11-30 | +------------+ 1 row in set (0.00 sec)Let us first create a table −mysql> ... Read More

AmitDiwan
6K+ Views
To check for NULL or empty variable, use the IF condition. Let us create a stored procedure −mysql> delimiter // mysql> create procedure checkingForNullDemo(Name varchar(20)) begin if Name is NULL OR Name='' then select 'Adam Smith'; else select Name; ... Read More