Introduction

 

This chapter is designed to introduce you to the SQL syntax and grammar recognized by ODBC. It is not intended to be a complete tutorial to SQL and will only cover the most basic set of instructions. If you are new to SQL, you should consult one of the many excellent books on SQL (see the preface for a list of some of these books).

 

SQL provides a data definition language (DDL), a data manipulation language (DML) and a set of Data Control commands. Although there are some areas of overlap, the DDL commands allow you to create and define new databases, fields, and indexes. The DML commands let you build queries to sort, filter, and extract data from the database. Data control statements control the execution of DML and DDL SQL statements to ensure that data stored in a relational database remains consistent and secure in a multi-user environment. Most applications that call the ODBC-API  almost exclusively use DML commands, of which the SELECT statement is the most frequently used. Thus, this chapter will have an emphasis on explaining the SELECT statement. Detailed descriptions if other DML statements should be investigated from other sources at the reader's discretion.