ASA Getting Started
Databases and Applications
When a client application wants to carry out a database task, such as retrieving information using a query or inserting a new row into a table, it does so using Structured Query Language (SQL) statements. SQL is a relational database language that has been standardized by the ANSI and ISO standards bodies.
Depending on how you develop a client application, SQL statements could be supplied in function calls from the programming language. Some application development tools provide user interfaces for building and generating SQL statements.
The programming interface delivers the SQL statement to the database server. The database server receives the statement and executes it, returning the required information (such as query results) back to the application.
Client/server communication protocols carry information between the client application and the database server, and programming interfaces define how an application sends the information. No matter what interface you use, and what network protocol you use, it is SQL statements that are sent to a server, and the results of SQL statements that are returned to the client application.
This SQL statement extracts the last names of all employees from the employee table in the sample database:
SELECT emp_lname FROM employee
You can send queries like this to the database server using Interactive SQL or you can build the query into your own application.
This SQL statement creates a table called food that lists types of food and the amount in stock in the employee cafeteria:
CREATE TABLE food ( food_id integer primary key, food_type char(20), quantity integer )
For an introduction to SQL, see the chapters beginning with Selecting Data from Database Tables.
Queries
Other SQL statements
The system tables