Beginning SQL

Beginning SQL Beginning SQL

marjan.fesb.hr
from marjan.fesb.hr More from this publisher
20.07.2013 Views

The SQL language is actually fairly easy to read. The actual SQL could look like this: SELECT * FROM SalesMade WHERE SaleDate = “July 2005” AND SalesOffice = “New York” The asterisk simply means return the data from all the fields in the record. You learn a lot more about how the SQL SELECT statement works in Chapter 3. Understanding SQL Standards As with databases, IBM did a lot of the original SQL work. However, a lot of other vendors took the IBM standard and developed their own versions of it. Having so many differing dialects causes quite a headache for the developer, and in 1986 it was adopted by the standards body the American National Standards Institute (ANSI) and in 1987 by the International Standards Organization (ISO), who created a standard for SQL. Although this has helped minimize differences between the various SQL dialects, there are still differences between them. The following table gives a brief summary of the various standards and updates to those standards. Year Name Also Known As Changes Introduction to SQL 1986 SQL-86 SQL-87 (date when First publication of the ANSI/ISO adopted by ISO) standard 1989 SQL-89 Only small revision of the original standard 1992 SQL-92 SQL2 Major update of the original standard and still the most widely supported standard 1999 SQL-99 SQL3 Update of the 1992 standard adding new ways of selecting data and new rules on data integrity and introducing object orientation 2003 SQL-2003 Introduced XML support and fields with autogenerated values This book concentrates on SQL-92, SQL-99, and SQL-2003 because most of their features have been implemented by most relational database management systems (RDBMSs). The SQL you write works on most RDBMSs with only minor modifications. There are times when the various RDBMSs do things so differently that compatible code is impossible without big changes; however, these instances are few and far between in this book. Although standards are important to help bring some sort of commonality among the various RDBMSs’ implementation of SQL, at the end of the day what works in practice is what really counts. Instead of endlessly debating standards, this book provides information to help you in the real world of databases. That said, the next section shows you how to create your own SQL database. 13

The <strong>SQL</strong> language is actually fairly easy to read. The actual <strong>SQL</strong> could look like this:<br />

SELECT * FROM SalesMade WHERE SaleDate = “July 2005” AND SalesOffice = “New York”<br />

The asterisk simply means return the data from all the fields in the record.<br />

You learn a lot more about how the <strong>SQL</strong> SELECT statement works in Chapter 3.<br />

Understanding <strong>SQL</strong> Standards<br />

As with databases, IBM did a lot of the original <strong>SQL</strong> work. However, a lot of other vendors took the<br />

IBM standard and developed their own versions of it. Having so many differing dialects causes quite<br />

a headache for the developer, and in 1986 it was adopted by the standards body the American National<br />

Standards Institute (ANSI) and in 1987 by the International Standards Organization (ISO), who created<br />

a standard for <strong>SQL</strong>. Although this has helped minimize differences between the various <strong>SQL</strong> dialects,<br />

there are still differences between them.<br />

The following table gives a brief summary of the various standards and updates to those standards.<br />

Year Name Also Known As Changes<br />

Introduction to <strong>SQL</strong><br />

1986 <strong>SQL</strong>-86 <strong>SQL</strong>-87 (date when First publication of the ANSI/ISO<br />

adopted by ISO) standard<br />

1989 <strong>SQL</strong>-89 Only small revision of the original<br />

standard<br />

1992 <strong>SQL</strong>-92 <strong>SQL</strong>2 Major update of the original standard<br />

and still the most widely supported<br />

standard<br />

1999 <strong>SQL</strong>-99 <strong>SQL</strong>3 Update of the 1992 standard adding<br />

new ways of selecting data and new<br />

rules on data integrity and introducing<br />

object orientation<br />

2003 <strong>SQL</strong>-2003 Introduced XML support and fields<br />

with autogenerated values<br />

This book concentrates on <strong>SQL</strong>-92, <strong>SQL</strong>-99, and <strong>SQL</strong>-2003 because most of their features have been<br />

implemented by most relational database management systems (RDBMSs). The <strong>SQL</strong> you write works on<br />

most RDBMSs with only minor modifications. There are times when the various RDBMSs do things so<br />

differently that compatible code is impossible without big changes; however, these instances are few and<br />

far between in this book.<br />

Although standards are important to help bring some sort of commonality among the various RDBMSs’<br />

implementation of <strong>SQL</strong>, at the end of the day what works in practice is what really counts. Instead of<br />

endlessly debating standards, this book provides information to help you in the real world of databases.<br />

That said, the next section shows you how to create your own <strong>SQL</strong> database.<br />

13

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!