SQL

Structured Query Language, or SQL, is a declarative programming language for use in quasi-relational databases. Many of the original SQL features were inspired by, but in violation of, tuple calculus, but recent extensions to SQL include a more relational algebra flavour.

SQL was originally created by IBM, but many vendors developed dialects of it. It was adopted as a standard by the American National Standards Institute(ANSI) in 1986 and ISO in 1987. In their SQL standard, the ANSI declared that the official pronunciation for SQL is "es queue el". However, many database professionals have taken to the "slang" pronunciation sequel, that reflects the language's original name, Sequel, before trademark conflicts caused IBM to perpetrate the current moniker.

SQL was revised in 1992, and that version is known as SQL-92. It was again revised in 1999 to become SQL:1999 (AKA SQL3). SQL:1999 supports objects, which weren't previously supported in other versions, but as of late 2001, few database management systems implement SQL:1999.

SQL, although defined by both ANSI and ISO, has many variations and extensions, most of which are of a proprietary nature, such as Oracle Corporation's PL/SQL or Sybase and Microsoft's Transact-SQL. It is also not uncommon for commercial implementations to omit support for basic features of the standard, such as the DATE or TIME data types, preferring some variant of their own. As a result in contrast to ANSI C or ANSI Fortran which can usually be ported from platform to platform without major structural changes, SQL code can rarely be ported between database systems without major modifications. Most people in the field believe that this lack of compatibility is intentional in order to ensure vendor lock-in for proprietary database systems.

As the name implies, SQL is designed for a specific, limited purpose -- querying data contained in a relational database. As such, it is a set-based programming language rather than a procedural language such as C or BASIC, which are designed to solve a much broader set of problems. Language extensions such as PL/SQL are designed to address this by adding procedural elements to SQL while maintaining SQL's advantages. Another approach is to allow procedural language code to be embedded in and interact with the database. For example, Oracle and others include Java in the database, while PostgreSQL allows functions to be written in Perl, Tcl, or C, among other languages.

One joke about SQL is that "SQL is neither Structured, nor a Language." This is (in part) founded on the notion that SQL isn't a Turing complete language.

Table of contents
1 Examples
2 SQL keywords
3 Database systems using SQL
4 External links

Examples

Table 'T' Query Result
 
C1 C2
1 a
2 b
Select * from T
 
C1 C2
1 a
2 b
 
C1 C2
1 a
2 b
Select C1 from T
 
C1
1
2
 
C1 C2
1 a
2 b
Select * from T where C1=1
 
C1 C2
1 a
Given a table T, the query Select * from T will result in all the elements of all the rows of the table being shown.

With the same table, the query Select C1 from T will result in the elements from the column C1 of all the rows of the table being shown.

With the same table, the query Select * from T where C1=1 will result in all the elements of all the rows where the value of column C1 is '1' being shown.

SQL keywords

SQL keywords fall into a number of groups.

First there are the standard Data Manipulation Language elements. DML is the subset of the language used to query a database, add, update and delete data.

  • SELECT is the most commonly used DML command and allows the user to specify a query as a description of the desired result set. The query does not specify how the results should be located - turning a query into a form which can be executed is the job of the database system, more specifically of the Query Optimiser.

  • INSERT is used to add a row (formally a tuple) to an existing table.

  • UPDATE is used to change the data values in an existing table row.

  • DELETE permits existing rows to be removed from a table.

Three other keywords could be said to fall into DML:

COMMIT and ROLLBACK interact with areas such as transaction control and locking. Strictly, both terminate any open transaction and release any locks held on data. In the absence of a BEGIN WORK or similar statement, the semantics of SQL are implementation-dependent.

The second group of keywords is the Data Definition Language. DDL allows the user to define new tables and associated elements. Most commercial SQL databases have proprietary extensions in their DDL, which allow control over proprietary and nonstandard, but usually operationally vital, elements of the specific system.

The most basic items of DDL are the CREATE and DROP commands.

  • CREATE causes an object (a table, for example) to be created within the database.

  • DROP causes an existing object within the database to be deleted, usually irretrievably.

Some database systems also have an ALTER command, which permits the user to modify an existing object in various ways - for example, adding a column to an existing table.

The third group of SQL keywords is the Data Control Language. DCL handles the authorisation aspects of data and permits the user to control who has access to see or manipulate data within the database.

Its two main keywords are

  • GRANT - authorises a user to perform an operation, and

  • REVOKE - removes or restricts the capability of a user to perform an operation.

Database systems using SQL

External links



In the News

The Fresh Face of King Tut: Famous Pharaoh's Features Reconstructed Us
The scientific breakthrough: Some 1,700 high-resolution Siemens CT-scanner images of the world's most famous mummy -- King Tutankhamun. The opportunity: Besides providing boundless information on the health and possible cause of death of the legendary young king, the data could paint a fresh portrait of Tut's face -- the first bust of Tut ever created from 3-D CT scans.

Plastics Chemical, Bisphenol A, Retards Growth, Function Of Adult Repr
Bisphenol A, a chemical widely used in plastics and known to cause reproductive problems in the offspring of pregnant mice exposed to it, also has been found to retard the growth of follicles of adult mice and hinder their production of steroid hormones, researchers report. Their study is the first to show that chronic exposure to low doses of BPA can impair the growth and function of adult reproductive cells.

Rogue Wave Detection
Giant waves, also known as monster waves, have been talked about by sailors for centuries, often related to unexplained disappearances at sea, but no one quite believed them. They have been considered merely a myth until recently, when new studies using technological developments like buoys, radars and satellites have scientifically proven the existence of rouge waves, and that they exist in much higher numbers than it was ever expected.

Certain Nutrients Associated With Reduced Risk For Age-related Eye Dis
Consuming higher levels of the yellow plant pigments lutein and zeaxanthin may be associated with a lower risk for age-related macular degeneration, according to a new article. Age-related macular degeneration (AMD) occurs when the macula, the area at the back of the retina that produces the sharpest vision, deteriorates over time. It is a leading cause of irreversible blindness among elderly people of European descent, according to background information in the article.

Clinical Study On Heart Failure To Use Cholesterol-lowering Statin
An advanced study launched at Yale School of Medicine is evaluating the role of statin therapy in patients with heart failure, one of the leading causes of hospitalization in people over age 65.

Scrooge Or Samaritan: Personality Type Is Key To Donations
Peoples'personality types predicts their donations to charities and noble causes. In a sample of almost 1000 participants researchers found that people with a pro-social personality gave more money to charities and other noble causes. For instance, with donations to 'third world organisations', 52% of people with a pro-social personality gave money, compared to 42% of people with an individualistic personality and only 21% of people with a competitive personality.

Wildfire Zone
This website provides general information about what to do before, during, and after a fire, and resources for San Diego County (California) residents, such as vegetation and fire risk in specific areas of the county and contacts related to fire recovery. Some documents available in Spanish. A partnership of several California agencies; developed by University of California Cooperative Extension, County of San Diego.

Australian Indigenous People: Aboriginal and Torres Strait Islander In
Extensive collection of links to websites related to indigenous populations in Australia. Topics include biographies, art and artists, writers, community leaders, music, politicians, athletes, culture, history, language, reconciliation, land rights, sacred sites, and more. From the P.L. Duffy Resource Centre, Trinity College, Western Australia.

Intact Tonsils Triple Risk Of Recurrent Strep Throat
Children with recurrent strep throat whose tonsils have not been removed are over three times more likely to develop subsequent episodes of strep throat than children who undergo tonsillectomy, according to a Mayo Clinic study published in the Nov. 2 issue of Laryngoscope.

Leading Lampreys To Slaughter: Pheromone For Scourge Of Great Lakes Id
Researchers have identified the pheromone that attracts lampreys to spawning streams. The attractant could be used to attract lamprey to traps, replacing the expensive and environmentally damaging lampricides now used to control lamprey numbers.




MP3 Music Downloads

Preview songs, Download Free Music,Burn CDs at ITunes.com
iTunes_RGB_9mm

 


Google




InformationQuickFind.com - Find Information Fast

Links | Privacy Policy | News |