|
Basics of the SELECT Statement In a relational database, data is stored in tables. An example table would relate Inland Revenue Number, Name, and Address:
If you want to see the address of each employee. Use the SELECT statement: SELECT FirstName, LastName, Address, City, Country The following is the results of your query of the database:
Specifically, you asked for the columns called FirstName, LastName, Address, City, and Country. Note that column names and table names do not have spaces...following Reddicks naming conventions; and that the statement ends with a semicolon (;). The general form for a SELECT statement, retrieving all of the rows in the table is: SELECT ColumnName, ColumnName, ... To get all columns of a table without typing all column names, use: SELECT * FROM TableName; The star representing the common wildcard for everything! Unfortunately each database management system (DBMS) and database software has different methods for logging in to the database and entering SQL commands.
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||