How it is possible to insert a zero or an empty string into a MySQL column which is defined as NOT NULL?

seetha
Published on 22-Feb-2018 06:28:22
Declaring a column ‘NOT NULL’ means that this column would not accept NULL values but zero (0) and an empty string is itself a value. Hence there would be no issue if we want to insert zero or an empty string into a MySQL column which is defined as NOT ... Read More

What is the benefit of MySQL ‘IS NULL’ and ‘IS NOT NULL’?

Nancy Den
Published on 22-Feb-2018 06:28:25
As we know that while using NULL with a comparison operator, we would not get any meaningful result set. To get the meaningful result from such kind of comparisons, we can use ‘IS NULL’ and ‘IS NOT NULL’.Examplemysql> Select 10 IS NULL; +------------+ | 10 IS NULL | +------------+ | ... Read More

Why in MySQL, we cannot use arithmetic operators like ‘=’, ‘<’ or ‘<>’ with NULL?

vanithasree
Published on 22-Feb-2018 06:23:30
The reason behind it is that we will not receive any meaningful results from the comparisons when we use NULL with the comparison operators like ‘=’, ‘<’ or ‘<>’. Consider the following example which demonstrates this concept −mysql> Select 10 = NULL, 10< NULL, 10<>NULL; +-----------+----------+----------+ | 10 = NULL ... Read More

What will happen to the current MySQL transaction if a START TRANSACTION command is executed in the middle of that current transaction?

Jai Janardhan
Published on 22-Feb-2018 06:25:35
The current transaction will be committed and ended if START TRANSACTION is executed in the middle of a current transaction. All the database changes made in the current transaction will be made permanent. This is called an implicit commit by a START TRANSACTION command.ExampleSuppose we have the following values in ... Read More

What will happen to MySQL current transaction, if in the middle of that transaction, the DDL statement is executed?

Chandu yadav
Published on 22-Feb-2018 06:24:07
The current MySQL transaction will be committed and ended when any of the DDL statement such as CREATE or DROP databases, Create, ALTER or DROP tables or stored routines is executed in the middle of the current transaction. All the database changes made in the current transaction will be made ... Read More

What happens to the current MySQL transaction if the session is ended in the middle of a transaction?

Moumita
Published on 22-Feb-2018 06:22:45
Suppose if a session is ended in the middle of a transaction then that current MySQL transaction will be rolled back by MySQL and ended. It means that all the database changes made in the current transaction will be removed. It is called n implicit rollback when the session is ... Read More

What happens to the current MySQL transaction if the session is killed by DBA?

Swarali Sree
Published on 22-Feb-2018 06:24:49
Suppose if a session is killed in the middle of a transaction then that current MySQL transaction will be rolled back by MySQL and ended. It means that all the database changes made in the current transaction will be removed. It is called n implicit rollback when the session is ... Read More

How to use ALTER TABLE statement for changing the size of a column in MySQL?

Daniol Thomas
Published on 22-Feb-2018 06:26:48
It can be understood with the help of the following example using the table named ‘Student’ having the following description −mysql> DESCRIBE Student; +--------+-------------+------+-----+---------+-------+ | Field  | Type        | Null | Key | Default | Extra | +--------+-------------+------+-----+---------+-------+ | Name   | varchar(20) | YES  |   ... Read More

What would be the result if we perform any kind of arithmetic calculations in MySQL having one of the arguments as NULL?

radhakrishna
Published on 22-Feb-2018 06:20:12
MySQL always throws NULL as the result of arithmetic calculations in which one of the arguments is NULL. Consider the following example having NULL as an argument with addition, subtraction, multiplication, and division −mysql> Select 10*NULL; +---------+ | 10*NULL | +---------+ |    NULL | +---------+ 1 row in set ... Read More

How can we use both built-in-commands (\G & \g) and semicolon (;) in a single MySQL statement?

Krantik Chavan
Published on 22-Feb-2018 06:21:53
As we know that built-in-commands (\G and \g) send the command to MySQL server for execution and with the help of Semicolon (;) MySQL determines the end of the statement. For using all three and getting the result without error, we need to write three queries, one query with \G, ... Read More
Advertisements