SQL keywords are
case-insensitive, meaning that
select are treated
exactly the same. Depending on your database, however, table and
column names may or may not be case-insensitive. In addition, the
space between words in a SQL statement is unimportant. You can have a
newline after each word, several spaces, or just a single space.
Throughout this book I use the convention of placing SQL keywords in
all capitals and separating single SQL statements across multiple
lines for readability.
How do you get the data into the database? And how do you get it out once it is in there? All major databases support a standard query language called Structured Query Language (SQL). SQL is not much like any programming language you might be familiar with. Instead, it is more of a structured English for talking to a database. A SQL query to the album titles from your database would look like this:
SELECT title FROM albums
In fact, much of the simplest database access comes in the form of
equally simple SQL statements. Most of what you will do in SQL boils
down to four SQL commands:
DELETE. You can issue SQL statements in several
ways. The simplest, quickest way is through a SQL command-line tool.
Each database engine comes with its own. Throughout most of this
book, however, you will send your SQL as Java strings to JDBC
I should also make a couple of other syntactic notes. First, the single quotation mark (') is used ...