Automation, Control & Plant Intelligence - Articles, Analysis, Reviews, Interviews & Views
MySQL Syntax & Strategies
Code is not Very Difficult
The MySQL code is very human readable, as opposed to hard programming languages like C or C++. There are very little special characters and symbols that are required to create a MySQL query and most queries consist entirely of English words.
The best way to learn is through direct examples.
There are many keywords in MySQL and a good programming habit when using ANY of these words is to capitalize them. This helps draw them out from the rest of the code and makes the codes much easier to read. Below is an example MySQL query written in ASP or PHP that retrieves all the data from a MySQL table named "alarms".
$result = mysql_query("SELECT * FROM alarms")
sqlQRY = "SELECT * FROM alarms"
You can see easily that "SELECT" and "FROM" are the MySQL keywords that were used in this query.
Don't memorize Reserved MySQL Words
You don't need to memorize Reserved MySQL Words. Just check out the List of Reserved MySQL Words. You could probably program relentlessly in MySQL for years without ever using all of the MySQL keywords.