How Work with White Space and Semicolons in Simple SQL Selects
See SQL: Tips and Tricks for similar articles.You must use at least one white space character between each keyword, table or column name in an SQL select. In addition, a semicolon is required as the statement delimiter.
To learn how to add comments in simple SQL select statements, follow these steps:
- You'll need to setup the MySQL database tables. The instructions for the setup can be found in How to add comments in simple SQL selects. Follow steps 1 through 7 in this topic before proceeding to the next step.
- Your database is ready for action! Now we'll explore white space and semicolons in simple select statement.
- When you type in an SQL select statement you must use the semicolon to indicate the end of the statement:
When MySQL encounters the semicolon, the SQL statement will be executed.
- You must place at least one white space as a separator between the keywords, table names and column names on an SQL select.
Arbitrarily many spaces can be used as separators:
One white space between each select keyword, table or column name is sufficient. An excessive number of white space can hinder the readability of your statement.
Related Articles
- Reset Root Password in MySQL on Windows
- How to Create an ER Diagram for a MySQL Database with Free Tools
- How to Round Up in SQL
- How to Concatenate Strings in SQL
- How to Select All Columns in a Row in SQL
- How to Check Multiple Conditions in SQL
- How Work with White Space and Semicolons in Simple SQL Selects (this article)
- How to Sort Records in SQL
- How to Write Subqueries (Simple and Correlated)