Table of Contents
SQL standards for Structured Query Language and provides a command line interface to the majority of database packages available on the market today. It supposedly uses plain English language phrases but in reality is so tightly structured that you have to know the precise style and format of the requests you wish to pass to it.
Each database package provides a command line SQL interpreter which can be used to interact with the database directly. Most of the time you will not need to use it, but having some basic familiarity with it can help in solving some fairly intractible problems, so it is worth getting an idea as to how to use it.
Table 16.1. SQL Command line interpreters
Database | Command | Typical Usage |
---|---|---|
Oracle | sqlplus | sqlplus wacs/password |
MySQL | mysql | mysql -u wacs -p |
In general they will give you a prompt something like
SQL>
and will expect each query to be completed with a
semi-colon (:
) at which point they will execute
what you have given them. At the end of the session, typing
quit;
to the SQL>
prompt will usually
log you out again. There are a lot of differences in the way you edit
and recall existing queries, but these basic steps are the same for all
major database packages.