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.


‘US City’:

US City

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 is a SQL commands.
  • * means ‘everything’ in SQL.
  • FROM tells the database which table you are looking for
  • US City is 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.

One clap, two clap, three clap, forty?

By clapping more or less, you can signal to us which stories really stand out.