
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
208 Views
Let us first create a table −mysql> create table DemoTable ( StudentId int, StudentFirstName varchar(100) ); Query OK, 0 rows affected (0.88 sec)Insert some records in the table using insert command −mysql> insert into DemoTable values(100, 'John'); Query OK, 1 row affected (0.32 sec) mysql> insert into DemoTable ... Read More

AmitDiwan
367 Views
Let us first create a table. Following is the query to create a table in database ‘web’ −mysql> create table DemoTable ( AdmissionDate date ); Query OK, 0 rows affected (0.53 sec)Here is the Java code to insert empty(NULL) java.sql.Date in MySQL DB −import java.sql.Connection; import java.sql.DriverManager; import java.sql.PreparedStatement; ... Read More

AmitDiwan
186 Views
For this, use trim() along with substring(). Let us first create a table −mysql> create table DemoTable ( Name varchar(100) ); Query OK, 0 rows affected (0.80 sec)Insert some records in the table using insert command −mysql> insert into DemoTable values('1stJohn'); Query OK, 1 row affected (0.10 sec) mysql> ... Read More

AmitDiwan
462 Views
Let us first create a table −mysql> create table DemoTable ( Id int, Name varchar(100) ); Query OK, 0 rows affected (0.64 sec)Insert some records in the table using insert command −mysql> insert into DemoTable values(100, 'Chris'); Query OK, 1 row affected (0.44 sec) mysql> insert into DemoTable ... Read More

AmitDiwan
1K+ Views
Let us first create a table −mysql> create table DemoTable ( Title varchar(100) ); Query OK, 0 rows affected (0.57 sec)Insert some records in the table using insert command −mysql> insert into DemoTable values('\"MySQL'); Query OK, 1 row affected (0.14 sec) mysql> insert into DemoTable values('MongoDB\"'); Query OK, 1 ... Read More

AmitDiwan
2K+ Views
No, it isn’t necessary because without adding DEFAULT NULL, it gives NULL value. For example, let’s say you haven’t added DEFAULT NULL and inserted a record with no value, then the result would display the NULL value as the inserted value.Let us first create a table −mysql> create table DemoTable ... Read More

AmitDiwan
117 Views
Let us first create a table −mysql> create table DemoTable ( Strength text ); Query OK, 0 rows affected (0.51 sec)Insert some records in the table using insert command −mysql> insert into DemoTable values('John is a good programmer'); Query OK, 1 row affected (0.09 sec) mysql> insert into DemoTable ... Read More

AmitDiwan
214 Views
Let us first create a table −mysql> create table DemoTable ( UserId int, UserName varchar(100) ); Query OK, 0 rows affected (0.57 sec)Insert some records in the table using insert command −mysql> insert into DemoTable values(100, 'Chris'); Query OK, 1 row affected (0.13 sec) mysql> insert into DemoTable ... Read More

AmitDiwan
151 Views
Get similar results using MySQL IN(). Let us first create a table −mysql> create table DemoTable ( ClientId int, ClientName varchar(100), ClientAge int ); Query OK, 0 rows affected (0.70 sec)Insert some records in the table using insert command −mysql> insert into DemoTable values(100, 'Chris', 34); Query ... Read More

AmitDiwan
325 Views
For this, you can use the ORDER BY CASE statement. Let us first create a table −mysql> create table DemoTable ( DueDate date ); Query OK, 0 rows affected (0.56 sec)Note − Let’s say the current date is 2019-07-22.Insert some records in the table using insert command −mysql> insert ... Read More