Monday 15 October 2012

MySQL Expressions

MySQL Expressions

Expressions are a common element of SQL statements( statements are select, delete and update).
they often occur in the where clause of select, delete & update.

For Example:
DELETE FROM users WHERE id=5;
Here id=5 are expressions.

Following are the different components of SQL Expression:

  •  Numeric Expressions
    Exact value Literal are: 11,12.33, 44.333
    Approximate Literal are 1233E2, 44333E3
    Operations on decimal value have precision upto 64 digits, currently its 30 character.
    In Approximate, mantissa allows upto 53 bit of precision which is about 15 decimal digits.
  •  String Expressions
    String like 'sql' or mysql
  • Temporal Expressions
    It include dates, times and datetime values like Select ‘2012-01-01’ + interval 10 day
  • Functions like current(), version(), avg(), sum()
  • Regular Express (Regex)