Saturday, April 6, 2013

Adventures in SQL: Genesis



SQL=Structured Query Language

via thefreedictionary.com...


Structured=Having a well-defined structure or organization; highly organized; arranged in a definite pattern.

Query= A question; an inquiry; to mark an item with a notation in order to question its validity or accuracy.

(Programming) Language= An artificial language used to write instructions that can be translated into machine language and then executed by a computer

I'm going to walkthrough a posting on SQLcourse.com, which was chosen by being one of the first google results.

SQL is used to communicate with a database. 

A database is an organized collection of information where specific entries are accessible via programs. Webopedia calls it an "electronic filing system". SQL is one of those programs that can access a database. About.com claims that databases consist of tables analogous to Excel rows/columns. More importantly, databases allow for large-scale operations in a way that spreadsheets are not conducive towards.

According to ANSI (American National Standards Institute), it is the standard language for relational database management systems.

A useful definition from google for relational database management systems: a database management system designed to manage a relational database. Here's a more useful rundown. A relational database seems to eliminate problems similar to "magic numbers" in programming. If you have code that uses a factor of 5 multiple times, it is usually better to define a variable of 5 once and call the variable. Change the variable, and you've changed all the entries.
Here's a table from the dummies site that I liked.

DeptNoDeptName
10Marketing
20Purchasing
Table 3: A Sample Relational EMP Table
EmpNoENameDeptNo
101Abigail10
102Bob20
103Carolyn10
104Doug20
105Evelyn10

Eliminating employees in the Marketing department would not eliminate the marketing department. The first table is a reference for the second table and centralizes more of the relevant information.


 SQL statements are used to perform tasks such as update data on a database, or retrieve data from a database. Some common relational database management systems that use SQL are: Oracle, Sybase, Microsoft SQL Server, Access, Ingres, etc.

Isn't a ton to this. SQL can do things to databases. A database stores things. Therefore, SQL is useful for modifying databases. There are many types of databases and SQL is often employed to manipulate them.


 Although most database systems use SQL, most of them also have their own additional proprietary extensions that are usually only used on their system. 

SQL is tweakable to specific problems.

However, the standard SQL commands such as "Select", "Insert", "Update", "Delete", "Create", and "Drop" can be used to accomplish almost everything that one needs to do with a database.

Self-explanatory.


Have to start somewhere, huh?

No comments:

Post a Comment