Wednesday, March 11, 2009

Information on SQL

Based on my research on the subject of SQL, here is the information of I have come up with to describe it. As an analogy, SQL is to databases what HTML, or XHTML, is to web design programs. It is the programming language behind the graphical interface that makes up a software program. Although it is not necessary to know
SQL in order to create a decent database, much the same as a knowledge of XHTML is not necessary to create a webpage, it is helpful to known at least a little bit about it in case you need to ever manually edit a project. However, to average user would probably have no need for it.

Here are the basic commands in SQL:

-The SELECT operation is the most common operation in SQL language. It is used to retrieve data from a specific table, or multiple related tables, in a database. An asterisk symbol can be used to indicate that all available columns of a table are to be retrieved.

-The FROM clause. This indicates the source table or tables from which the date for your query is to be retrieved from.

-The WHERE clause. This is used to restrict the number of rows used by a query.

-The GROUP BY clause. This is used to group together rows with related values.

-The HAVING clause. This is used to elmininate rows after the GROUP BY clause has been implemented.

-The ORDER BY. This is used to identify which columns are used to sort the resulting data and in which order they should be sorted.

Here is a simple example of an SQL query that I found on Expedia.com:

SELECT *
FROM Book
WHERE price > 100.00
ORDER BY title;


I don't really see the need for using SQL when such a user-friendly interface is available. But like I said, it is good to know at least a little bit about it in the case that manual editing of queries is necessary.

1 comment:

Bernard Von Poobely said...

Believe me it can come in handy when troubleshooting queries as you get more advanced.