MySQL: Handling empty string

This entry is part 12 of 26 in the series Learn MySQL

At times, we might come across a data that has an empty record or an empty string.

As in the screenshot below, this is inserted by:

insert into artist (artiste, album, price) values ('Bruce Springsteen','',9.60)



If you are new to SQL, you could have wrongly interpreted this as a NULL string.

It is actually an empty string and it can be queried by =” as in:

select * from artist where album=''
Series Navigation<< MySQL: Handling null value
MySQL: Giving column as alias name >>

Leave a comment

Leave a Reply