Literals (Constants)

In MySQL, literals are the constant. Following are the types of literal:-

1. String Literal

In MySQL, string literals are in single quotes (') or double quotes (").

Example 1

snippet
Select class from table1 where name='Dolly';
MySQL Programming Literals

Example 2

snippet
Select class from table1 where name="Dolly";
MySQL Programming Literals

2. Number Literals

In MySQL, number literals are positive or negative numbers.

Example 1

snippet
Select class from table1 where id = 6;
MySQL Programming Literals

Example 2

snippet
Select class from table1 where marks = +65;
MySQL Programming Literals
Related Tutorial
Follow Us
https://www.facebook.com/Rookie-Nerd-638990322793530 https://twitter.com/RookieNerdTutor https://plus.google.com/b/117136517396468545840 #
Contents