Easy SQL Queries Are in Reach
There are different versions of SQL; for example, a query written for Microsoft Access is different then a query written for Oracle, even though they produce identical results. To meet American National Standards Institute guidelines, all SQL queries include the SELECT, FROM and WHERE clauses.
There are several SQL editing and reporting packages available including Microsoft Access and Crystal Reports; however, for this tutorial, the query will be written for Oracle SQL Plus. SQL Plus is a command line interface that is bundled with the Oracle Database Client and Server. It is interactive or script driven and is used by database administrators and developers to access Oracle databases.
A table, the basic unit for a relational database, is a set of related information. Tables are then further separated into columns that hold a specific data type within the table. For example a data table of employee information would have data in columns of employee number, first name, last name and telephone number.
The first step to understanding how to use SQL to get information is to know what is available in a database. A schema is a listing of all of the data that is in a database and includes the table layout and a diagram that shows the relationship between the data.
In Oracle SQL plus, a user can see what columns are available by typing the command 'desc' and the name of a specific table. In this tutorial, one of the tables used is the 'employee_information table which has five columns. In the example below, entering DESC employee_information at the command line produces the following result.
SQL> DESC employee_information
EMP_NB
FIRST_NAME
LAST_NAME
TELEPHONE_NB
HOME_TOWN
There are three clauses that make up a SQL query: the 'SELECT'clause; the 'FROM' clause; and the 'WHERE' clause. Each clause provides the query with specific information on the data that is to be pulled.
Easy SQL Queries Are in Reach
You may also like...
- How to Backup a Database in SQL Server 2000
- How to Download Oracle Database 10 G Express Edition
- Orale XE: The Free Database from Oracle
- Microsoft Access 2003 Tutorial: How To Create SQL Queries
- PHP: Getting Text to Display from ODBC Database
- How to Write a Query for Your Screenplay that Will Make Producers Drool
- Finding Time for You: Easy Ways to Add a Little Exercise to Your Life
- Easy Lighted Pine Branch Centerpiece
- 5 Easy Tips for the Ultimate Haunted House
- Easy and Healthy Diet Tips
Takeaways
- Structured Query Language is used to access and manipulate data
- The three important clauses in SQL are 'SELECT', 'FROM', and 'WHERE'
Did You Know?
There are many different versions of the SQL language and most SQL database programs have their own proprietary extensions in addition to the SQL standard. All SQL variations must support the same major keywords in a similar manner.
Comments
Type in Your Comments Below - (1000 characters left)
Most Commented On



