Modern Database Panorama

Computing technology has designed a perpetualrecommends a core group of data manipulation
modification in the style of professional exertionfunctions. As we will find out, many database
circuitously of the world. Information that was atsystems also have tools for ensuring data
one time emporium in storehouse safeguardingintegrity and enforcing security (see Day 11,
management can now be entranced without delay"Controlling Transactions") that enable
at the small noise of mouse identification.programmers to stop the execution of a group
Instruction placed by customers in foreignof commands if a certain condition occurs.
countries can now be forthwith prepared on thePopular STRUCTURED QUERY LANGUAGE
bottom surface of any room of a fabricationImplementations
facility. Although 15 years ago much of thisThis section introduces some of the more popular
information had been enchanted onto corporateimplementations of STRUCTURED QUERY
mainframe databases, offices still worked in aLANGUAGE, each of which has its own strengths
batch-processing environment. If a query isand weaknesses. Where some implementations of
needed to be accomplished, someone maySTRUCTURED QUERY LANGUAGE have been
apprise the management information systemsdeveloped for PC use and easy user interactivity,
department; the requested data are delivered asothers have been developed to accommodate
soon as possible nevertheless often not speedyvery large databases (VLDB). This section
and sufficient in normal manner.introduces selected key features of some
In summing up to the outgrowth of the relationalimplementations.
database archetype, two technologies led to theMicrosoft Access
rapid growth of what are now called client/serverWe use Microsoft Access, a PC-based DBMS, to
database assemblage. The important momentousillustrate some of the examples in this text.
technology was the personal computer.Access is very easy to use. We can use GUI
Reasonable, easy-to-use applications such astools or manually enter our STRUCTURED QUERY
Spreadsheet and Word Perfect enabledLANGUAGE statements.
employees to create documents and accomplishPersonal Oracle7
data dashing and decently. The people, who areWe use Personal Oracle7, which represents the
chain used to consecutively modernising systems,larger corporate database world, to demonstrate
as the rate of modification was so expeditious,command-line STRUCTURED QUERY LANGUAGE
even as the price of the more highly evolvedand database management techniques. (These
systems protracted to decline. The nexttechniques are important because the days of the
substantial technology was the local area networkstandalone machine are drawing to an end, as are
(LAN) and its solidarity into offices across thethe days when knowing one database or one
world. Although users our established to endoperating system was enough. This tool then
connections to a corporate mainframe, now wordreturns data to the screen for the user to see,
processing files could be stored locally within anor it performs the appropriate action on the
office and accessed from any computer attacheddatabase.
to the network. After the Apple MacintoshMost examples are directed toward the beginning
introduced a friendly graphical user interface,programmer or first-time user of STRUCTURED
computers our not only economical and powerfulQUERY LANGUAGE. We begin with the simplest
but also easy to use. In addition, they could beof STRUCTURED QUERY LANGUAGE statements
accessed from remote sites, and large amountsand advance to the topics of transaction
of data could be off-loaded to departmental datamanagement and stored procedure programming.
servers.The Oracle RDBMS is distributed with a full
In the course of rapid change and betterment, acomplement of development tools. It includes a
new sort of system has appeared known asC++ and Visual Basic language library (Oracle
client/server development because processing isObjects for OLE) that can link an application to a
split between client computers and a databasePersonal Oracle database. It also comes with
server; this new breed of application was a radicalgraphical tools for database, user, and object
change from mainframe-based applicationadministration, as well as the STRUCTURED
programming. Among the many advantages ofQUERY LANGUAGE Loader utility, which is used
this type of the system are:to import and export data to and from Oracle.
•Simplified supporting costsWe select the Personal Oracle7 RDBMS for
•Uncomplicated network load (processingseveral reasons that are vitally important for
occurs on database server or client computer)creating object oriented database customised
•Manifold functioning systems that cansoftware
inordinate as long as they share a common•It includes nearly all the tools needed to
network etiquettedemonstrate the topics discussed in this book.
•Improved data integrity owing to•It is available on virtually every platform
centralized data locationin use today and is one of the most popular
In developing Client/Server Computing, Bernard H.RDBMS products worldwide.
Boar defines client/server computing as follows:•A 90-day trial copy can be downloaded
"Client/server computing is a processing model infrom Oracle Corporation's World Wide Web
which a single application is partitioned betweenserver.
multiple processors (front-end and back-end) andMicrosoft Query is a useful query tool that comes
the processors cooperate (transparent to the endpackaged with Microsoft's Windows development
user) to complete the processing as a singletools, Visual C++, and Visual Basic. It uses the
unified task. Implementing Client/ServerODBC standard to communicate with underlying
Computing a client/server bond product ties thedatabases. Microsoft Query passes STRUCTURED
processors together to provide a single systemQUERY LANGUAGE statements to a driver, which
image (illusion). Shareable resources are positionedprocesses the statements before passing them
as requestor clients that access authorizedto a database system. ODBC is a functional library
services. The architecture is endlessly recursive; indesigned to provide a common Application
turn, servers can become clients and requestProgramming Interface (API) to underlying
services of other servers on the network, and sodatabase systems. It communicates with the
on and so on. "This type of applicationdatabase through a library driver, just as
development requires an entirely new set ofWindows communicates with a printer via a
programming skills. User interface programming isprinter driver. Depending on the database being
now written for graphical user interfaces, whetherused, a networking driver may be required to
it is MS Windows, IBM OS/2, Apple Macintosh, orconnect to a remote database.
the UNIX X-Window system. Using STRUCTUREDThe unique feature of ODBC as compared to the
QUERY LANGUAGE and a network connection,Oracle or Sybase libraries is that none of its
the application can interface to a database residingfunctions are database-vendor specific. For
on a remote server. The increased power ofinstance, we can use the same code to perform
personal computer hardware enables criticalqueries against a Microsoft Access table or an
database information to be stored on a relativelyInformix database with little or no modification.
inexpensive standalone server. In addition, thisOnce again, it should be noted that most vendors
server can be replaced later with little or noadd some proprietary extensions to the
change to the client applications. We can apply theSTRUCTURED QUERY LANGUAGE standard, such
basic concepts introduced in this book in manyas Microsoft's and Sybase's
environments--for example, Microsoft AccessTransact-STRUCTURED QUERY LANGUAGE and
running on a single-user Windows application orOracle's PL/STRUCTURED QUERY LANGUAGE.
STRUCTURED QUERY LANGUAGE Server runningWe should always consult the documentation
with 100 user connections. One of STRUCTUREDbefore beginning to work with a new data source.
QUERY Language's greatest benefits is that it isODBC has developed into a standard adopted into
truly a cross-platform language and amany products, including Visual Basic, Visual C++,
cross-product language. Because it is also whatFoxPro, Borland Delphi, and Power Builder. As
programmers refer to as a high-level oralways, application developers need to meditate
fourth-generation language (4GL), a large amounton the advantage of using the emerging ODBC
of work can be done higher-level language 4GLstandard, which enables we to design code
(fourth-generation) language fourth-generationwithout regard for a specific database, versus the
(4GL) language in fewer lines of code.speed gained by using a database specific function
Oracle Corporation unconstrained the firstlibrary. In other words, using ODBC will be more
mercantile RDBMS that promulgatedportable but slower than using the Oracle7 or
STRUCTURED QUERY LANGUAGE. Although theSybase libraries.
original versions our developed for VAX/VMSSTRUCTURED QUERY LANGUAGE in Application
systems, Oracle was one of the first vendors toProgramming including Object linking and
release a DOS version of its RDBMS. (Oracle isembedding
now available on more than 70 platforms.) In theSTRUCTURED QUERY LANGUAGE was in the
mid-1980s Sybase released its RDBMS,beginning created an ANSI criterion in 1986. The
STRUCTURED QUERY LANGUAGE Server. WithANSI 1989 standard (often called STRUCTURED
client libraries for database access, support forQUERY LANGUAGE-89) defines three types of
stored procedures (discussed on Day 14,interfacing to STRUCTURED QUERY LANGUAGE
"Self-motivated Uses of STRUCTURED QUERYwithin an application program:
LANGUAGE"), and interoperability with various•Module Language-- Uses procedures
networks, STRUCTURED QUERY LANGUAGEwithin programs. These procedures can be called
Server became a successful product, particularlyby the application program and can return values
in client/server environments. One of theto the program via parameter passing.
strongest points for both of these STRUCTURED•Embedded STRUCTURED QUERY
QUERY LANGUAGE Server powerful databaseLANGUAGE--Uses STRUCTURED QUERY
systems is their scalability across platforms. CLANGUAGE statements embedded with actual
language code (combined with STRUCTUREDprogram code. This method often requires the
QUERY LANGUAGE) written for Oracle on a PC isuse of a precompiled to process the
virtually identical to its counterpart written for anSTRUCTURED QUERY LANGUAGE statements.
Oracle database running on a VAX system.The standard defines statements for Pascal,
STRUCTURED QUERY LANGUAGE and ClientFORTRAN, COBOL, and PL/1.
Server Application Development•Direct Invocation--Left up to the
The common thread that runs throughout clientimplementers.
server application development is the use clientBefore the concept of dynamic STRUCTURED
server computing of STRUCTURED QUERYQUERY LANGUAGE evolved, embedded
LANGUAGE and relational databases. Also, usingSTRUCTURED QUERY LANGUAGE was the most
this database technology in a single-user businesspopular way to use STRUCTURED QUERY
application positions the application for futureLANGUAGE within a program. Embedded
growth.STRUCTURED QUERY LANGUAGE, which is still
An Overview of STRUCTURED QUERYused, uses static STRUCTURED QUERY
LANGUAGELANGUAGE--meaning that the STRUCTURED
STRUCTURED QUERY LANGUAGE is the deQUERY LANGUAGE statement is compiled into
facto standard language used to manipulate andthe application and cannot be changed at runtime.
retrieve data from these relational databases.The principle is much the same as a compiler
STRUCTURED QUERY LANGUAGE enables aversus an interpreter. The performance for this
programmer or database administrator to do thetype of STRUCTURED QUERY LANGUAGE is
following:good; however, it is not flexible--and cannot
•Modify a database's structurealways meet the needs of today's changing
•Change system security settingsbusiness environments. Dynamic STRUCTURED
•Add user permissions on databases orQUERY LANGUAGE is discussed shortly.
tablesThe ANSI 1992 standard (STRUCTURED QUERY
•Query a database for informationLANGUAGE-92) extended the language and
•Update the contents of a databasebecame an international standard. It defines three
NOTE: The term STRUCTURED QUERYlevels of STRUCTURED QUERY LANGUAGE
LANGUAGE can be confusing. The S, forcompliance: entry, intermediate, and full. The new
Structured, and the L, for Language, isfeatures introduced include the following:
straightforward enough, but the Q is a little•Connections to databases
misleading. Q, of course, stands for "Query,"•Scrollable cursors
which--if taken literally--would restrict we to asking•Dynamic STRUCTURED QUERY
the database questions. But STRUCTUREDLANGUAGE
QUERY LANGUAGE does much more than asksThis obsession covers not only all these
questions. With STRUCTURED QUERYextensions but also some proprietary extensions
LANGUAGE we can also create tables, add data,used by RDBMS vendors. Dynamic STRUCTURED
delete data, splice data together, trigger actionsQUERY LANGUAGE allows we to prepare the
based on changes to the database, and store ourSTRUCTURED QUERY LANGUAGE statement at
queries within our program or database.runtime. Although the performance for this type
Unfortunately, there is no good substitute forof STRUCTURED QUERY LANGUAGE is not as
Query. Obviously, Structured Add Modify Deletegood as that of embedded STRUCTURED QUERY
Join Store Trigger and Query LanguageLANGUAGE, it provides the application developer
(SAMDJSTQL) are a bit burdensome. In the(and user) with a great degree of flexibility. A
interest of agreement, we will stay withcall-level interface, such as ODBC or Sybase's
STRUCTURED QUERY LANGUAGE. However, weDB-Library, is an example of dynamic
now know that its function is larger than its name.STRUCTURED QUERY LANGUAGE. Call-level
The most commonly used statement ininterfaces should not be a new concept to
STRUCTURED QUERY LANGUAGE is the SELECTapplication programmers. When using ODBC, for
statement that retrieves data from the databaseinstance, we simply fill a variable with our
and returns the data to the user. The EMPLOYEESTRUCTURED QUERY LANGUAGE statement
table example illustrates a typical illustration of aand call the function to send the STRUCTURED
SELECT statement situation. In addition to theQUERY LANGUAGE statement to the database.
SELECT statement, STRUCTURED QUERYErrors or results can be returned to the program
LANGUAGE provides statements for creating newthrough the use of other function calls designed
databases, tables, fields, and indexes, as well asfor those purposes. Results are returned through
statements for inserting and deleting records.a process known as the binding of variables.
ANSI STRUCTURED QUERY LANGUAGE also