The First Incarnation of SQL Appeared in 1974, When a Group in IBM Developed the First Prototype of...

10

Click here to load reader

Transcript of The First Incarnation of SQL Appeared in 1974, When a Group in IBM Developed the First Prototype of...

Page 1: The First Incarnation of SQL Appeared in 1974, When a Group in IBM Developed the First Prototype of a Relational Database. the First

8/9/2019 The First Incarnation of SQL Appeared in 1974, When a Group in IBM Developed the First Prototype of a Relational …

http://slidepdf.com/reader/full/the-first-incarnation-of-sql-appeared-in-1974-when-a-group-in-ibm-developed 1/10

SQL (Structured Query Language) is a computer language aimed to store, manipulate, andquery data stored in relational databases. The first incarnation of SQL appeared in 1974,when a group in IBM developed the first prototype of a relational database. The firstcommercial relational database was released by Relational Software (later becoming Oracle).

Standards for SQL exist. However, the SQL that can be used on each one of the major RDBMS

today is in different flavors. This is due to two reasons: 1) the SQL command standard isfairly complex, and it is not practical to implement the entire standard, and 2) each databasevendor needs a way to differentiate its product from others. In this tutorial, such differencesare noted where appropriate.

This SQL programming help site lists commonly-used SQL statements, and is divided into thefollowing sections:

* SQL Commands: Basic SQL statements for storing, retrieving, and manipulating data in arelational database.

* Table Manipulation: How SQL statements are used to manage tables inside the database.* Advanced SQL: Advanced SQL commands.* SQL Syntax: A single page that lists the syntax for all the SQL commands in this tutorial.

For each command, the SQL syntax will first be presented and explained, followed by anexample. By the end of this tutorial, you should have a good general understanding of theSQL syntax, and be able to write SQL queries using the correct syntax. My experience is thatunderstanding the basics of SQL is much easier than mastering all the intricacies of thisdatabase language, and I hope you will reach the same conclusion as well.

If you are interested in how to retrieve data using SQL, we recommend that you start with

the SQL Commands section. If you are interested in understanding how SQL can be used tomanipulate database tables, we recommend that you start with the Table Manipulationsection. If you are looking for help on a specific SQL command, you can use the Site Map tofind the command you are looking for.

Okay, enough introduction. Bookmark this site now and start now to learn SQL!

Link to this page: If you find this page useful, we encourage you to link to this page. Simplycopy and paste the code below to your website, blog, or profile.

<a href="http://www.1keydata.com/sql/sql.html">SQL Tutorial</a> In this page, we list the

SQL syntax for each of the SQL commands in this tutorial, making this an easy reference forsomeone to learn SQL. For detailed explanations of each SQL syntax, please go to theindividual section by clicking on the keyword.

The purpose of this page is to have a quick reference page for SQL syntax, so you can learnSQL more quickly. Bookmark this page now by pressing Control-D so you can have this syntaxpage handy.

Page 2: The First Incarnation of SQL Appeared in 1974, When a Group in IBM Developed the First Prototype of a Relational Database. the First

8/9/2019 The First Incarnation of SQL Appeared in 1974, When a Group in IBM Developed the First Prototype of a Relational …

http://slidepdf.com/reader/full/the-first-incarnation-of-sql-appeared-in-1974-when-a-group-in-ibm-developed 2/10

Select StatementSELECT "column_name" FROM "table_name"

DistinctSELECT DISTINCT "column_name"FROM "table_name"

WhereSELECT "column_name"FROM "table_name"WHERE "condition"

 And/OrSELECT "column_name"FROM "table_name"WHERE "simple condition"

{[AND|OR] "simple condition"}+

InSELECT "column_name"FROM "table_name"WHERE "column_name" IN ('value1', 'value2', ...)

BetweenSELECT "column_name"

Page 3: The First Incarnation of SQL Appeared in 1974, When a Group in IBM Developed the First Prototype of a Relational Database. the First

8/9/2019 The First Incarnation of SQL Appeared in 1974, When a Group in IBM Developed the First Prototype of a Relational …

http://slidepdf.com/reader/full/the-first-incarnation-of-sql-appeared-in-1974-when-a-group-in-ibm-developed 3/10

FROM "table_name"WHERE "column_name" BETWEEN 'value1' AND 'value2'

LikeSELECT "column_name"FROM "table_name"WHERE "column_name" LIKE {PATTERN}

Order By

SELECT "column_name"FROM "table_name"[WHERE "condition"]ORDER BY "column_name" [ASC, DESC]

CountSELECT COUNT("column_name")

FROM "table_name"

Group By

Page 4: The First Incarnation of SQL Appeared in 1974, When a Group in IBM Developed the First Prototype of a Relational Database. the First

8/9/2019 The First Incarnation of SQL Appeared in 1974, When a Group in IBM Developed the First Prototype of a Relational …

http://slidepdf.com/reader/full/the-first-incarnation-of-sql-appeared-in-1974-when-a-group-in-ibm-developed 4/10

Page 5: The First Incarnation of SQL Appeared in 1974, When a Group in IBM Developed the First Prototype of a Relational Database. the First

8/9/2019 The First Incarnation of SQL Appeared in 1974, When a Group in IBM Developed the First Prototype of a Relational …

http://slidepdf.com/reader/full/the-first-incarnation-of-sql-appeared-in-1974-when-a-group-in-ibm-developed 5/10

 VALUES ("value1", "value2", ...)

Update StatementUPDATE "table_name"SET "column_1" = [new value]WHERE {condition}

Delete From Statement

DELETE FROM "table_name"WHERE {condition}

Link to this page: If you find this page useful, we encourage you to link to this page. Simplycopy and paste the code below to your website, blog, or profile.

<a href="http://www.1keydata.com/sql/sql-syntax.html">SQL Syntax</a>

Page 6: The First Incarnation of SQL Appeared in 1974, When a Group in IBM Developed the First Prototype of a Relational Database. the First

8/9/2019 The First Incarnation of SQL Appeared in 1974, When a Group in IBM Developed the First Prototype of a Relational …

http://slidepdf.com/reader/full/the-first-incarnation-of-sql-appeared-in-1974-when-a-group-in-ibm-developed 6/10

Page 7: The First Incarnation of SQL Appeared in 1974, When a Group in IBM Developed the First Prototype of a Relational Database. the First

8/9/2019 The First Incarnation of SQL Appeared in 1974, When a Group in IBM Developed the First Prototype of a Relational …

http://slidepdf.com/reader/full/the-first-incarnation-of-sql-appeared-in-1974-when-a-group-in-ibm-developed 7/10

Page 8: The First Incarnation of SQL Appeared in 1974, When a Group in IBM Developed the First Prototype of a Relational Database. the First

8/9/2019 The First Incarnation of SQL Appeared in 1974, When a Group in IBM Developed the First Prototype of a Relational …

http://slidepdf.com/reader/full/the-first-incarnation-of-sql-appeared-in-1974-when-a-group-in-ibm-developed 8/10

Page 9: The First Incarnation of SQL Appeared in 1974, When a Group in IBM Developed the First Prototype of a Relational Database. the First

8/9/2019 The First Incarnation of SQL Appeared in 1974, When a Group in IBM Developed the First Prototype of a Relational …

http://slidepdf.com/reader/full/the-first-incarnation-of-sql-appeared-in-1974-when-a-group-in-ibm-developed 9/10

adi come take a look at the movement of the hand robert robert adhi anywhere

Kusuma's son would like to open an email continue to participate100000000000000000000000000 adhi traders eye view along Thamrin streetsudirman married robert adhi Kebayoran Lama when entering the room to eat anddrink with his wife to marry rw matnuh Ilyas vegetable traders married robertrobert adhi adhi

Page 10: The First Incarnation of SQL Appeared in 1974, When a Group in IBM Developed the First Prototype of a Relational Database. the First

8/9/2019 The First Incarnation of SQL Appeared in 1974, When a Group in IBM Developed the First Prototype of a Relational …

http://slidepdf.com/reader/full/the-first-incarnation-of-sql-appeared-in-1974-when-a-group-in-ibm-developed 10/10

adi come take a look at the movement of the hand robert robert adhi anywhereKusuma's son would like to open an email continue to participate100000000000000000000000000 adhi traders eye view along Thamrin streetsudirman married robert adhi Kebayoran Lama when entering the room to eat and

drink with his wife to marry rw matnuh Ilyas vegetable traders married robertrobert adhi adhi