Chemistry Reference
In-Depth Information
6
5
4
3
2
1
0
0
1
2
3
4
5
6
logP
Figure 5.5
Plot using R of computed versus experimental logP values.
over another, but to show examples of how an SQL interface is accom-
plished in several common computer languages. In each of these exam-
ples, it is assumed that there is an existing PostgreSQL database available
on a server named
rigel
. This database contains a schema named
nci
that
contains a table named
structure
. The table has at least the columns
smiles
and
cas
, which are used in these examples. The database in these exam-
ples is named
topic
and the user is named
reader
. In each of the examples,
a database connection is established. This requires the name of the host
database server, the database name, and the user name and password.
The exact syntax of the statement creating the connection is different in
each computer language.
In each example, a simple SQL statement is used to select rows that match
a particular substructure. The rows are then simply fetched and printed.
These examples should serve as a starting point to understand how client
programs communicate with an RDBMS server using SQL. The examples
can also server as a basis for other more complex client programs.
Selecting rows from a table is only one common operation needed
for a client program to work with an RDBMS. In addition to a simple SQL
select statement, other more complex select statements will become neces-
sary as more complex client programs are developed. It is also important
to see how to properly use the SQL Insert statement. Rather than showing
examples in several computer languages, the use of more complex SQL
statements is discussed in Chapter 12.
Search WWH ::
Custom Search