Learning SQL Everyday: Day 1
What is SQL?
SQL is the de facto standard language used to manipulate
and retrieve data from these relational databases. SQL enables a programmer or
database administrator to do the following:
- · Modify a database's structure
- · Change system security settings
- · Add user permissions on databases or tables
- · Query a database for information
- · Update the contents of a database
RDBMS
RDBMS stands for Relational Database Management System.
RDBMS is the basis for SQL, and for all modern database
systems such as MS SQL Server, IBM DB2, Oracle, MySQL, and Microsoft Access.
The data in RDBMS is stored in database objects called
tables.
A table is a collection of related data entries and it
consists of columns and rows.
Popular SQL Implementations
This section introduces some of the more popular
implementations of SQL, each of which has its own strengths and weaknesses.
Where some implementations of SQL have been developed for PC use and easy user
interactivity, others have been developed to accommodate very large databases
(VLDB).
Microsoft Access
We use Microsoft Access, a PC-based DBMS, to illustrate
some of the examples in this text. Access is very easy to use. You can use GUI
tools or manually enter your SQL statements.
Oracle
We use Oracle, which represents the larger corporate
database world, to demonstrate command-line SQL and database management
techniques. (These techniques are important because the days of the standalone
machine are drawing to an end, as are the days when knowing one database or one
operating system was enough.) In command-line RE l, simple stand+[cedilla] one
SQL statements are entered into Oracle's SQL*Plus tool. This tool then returns
data to the screen for the user to see, or it performs the
appropriate action on the database.
Most examples are directed toward the beginning
programmer or first-time user of SQL. We begin with the simplest of SQL
statements and advance to the topics of transaction management and stored
procedure programming. The Oracle RDBMS is distributed with a full complement
of development tools. It includes a C++ and Visual Basic language library
(Oracle Objects for OLE) that can link an application to a Personal Oracle
database. It also comes with graphical tools for database, user, and object
administration, as well as the SQL*Loader utility, which is used to import and
export data to and from Oracle.
MySQL
MySQL, the most popular Open Source SQL database
management system, is developed, distributed, and supported by Oracle
Corporation.
The MySQL Web site (http://www.mysql.com/) provides the
latest information about MySQL software.
And all the examples we will have in each coming posts
will be using MySQL DBMS.
Q&A
Q: Why should I
be concerned about SQL?
A: Until recently, if you weren't
working on a large database system, you probably had only a passing knowledge
of SQL. With the advent of client/server development tools (such as Visual
Basic, Visual C++, ODBC, Borland's Delphi, and Powersoft's PowerBuilder) and
the movement of several large databases (Oracle and Sybase) to the PC platform,
most business applications being developed today require a working knowledge of
SQL.
Q: Why do I need to know anything
about relational database theory to use SQL?
A: SQL was developed to service
relational databases. Without a minimal understanding of relational database
theory, you will not be able to use SQL effectively except in the most trivial
cases.
Q: All the new GUI tools enable me
to click a button to write SQL. Why should I spend time learning to write SQL
manually?
A: GUI tools have their place, and
manually writing SQL has its place. Manually written SQL is generally more
efficient than GUI-written SQL. Also, a GUI SQL statement is not as easy to
read as a manually written SQL statement. Finally, knowing what is going on
behind the scenes when you use GUI tools will help you get the most
out of them.
Q: So, if SQL is standardized,
should I be able to program with SQL on any databases?
A: No, you will be able to program
with SQL only on RDBMS databases that support SQL, such as MS-Access, Oracle,
Sybase, and Informix. Although each vendor's implementation will differ
slightly from the others, you should be able to use SQL with very few
adjustments.
0 comments: