What is SQL (2)
SQL is an ANSI (American National Standards Institute) standard, but there are different versions of the SQL languages, such as MySQL, Oracle, MS SQL Server. The major commands will be very similar, but there will still be some differences. The example I provide will be based on MySQL.
This is a table containing all the cities in US. To select all the records in this table, this is a very simple SQL statement:
SELECT * FROM US City;
SELECTis a SQL commands.
*means ‘everything’ in SQL.
FROMtells the database which table you are looking for
US Cityis the table name.
;shows this statement has ended.
Keep in mind that SQL keywords are NOT case sensitive, so
SELECT is the same with
select. Also remember to add a semicolon(;) after a SQL statement. This is a standard way to separate each SQL statement.