Welcome to the world of SQL and the huge, growing database technologies of today's business all over the SQL world. By reading this article, we have begun accepting the knowledge that will soon be required for survival in today's world of relational database and data management. Alas, for the reason that it is first necessary to provide a background of SQL and cover some preliminary concepts that we need to know, the majority of this article is text in paragraph format.
The highlights of this article include
The highlights of this article include
- An introduction to and brief history of SQL
- An overview of some basic terms and concepts
- An introduction to database management systems
After we have enough information ANSI SQL, we will focus on T-SQL, Jet SQL, and Oracle SQL.
SQL Classification and History
Every business has data, which requires some organized method, or mechanism, for maintaining the data. This mechanism is referred to as a database management system (DBMS). Database management systems have been around for years, many of which started out as flat-file systems on a mainframe. With today's technologies, the accepted use of database management systems has begun to flow in other directions, driven by the demands of growing business, increased volumes of corporate data, and of course Internet technologies.
Today two important technologies are very favorites. First one is Relational Database and second one is Object Database technology. Object Database's capability to allocate and store objects is the most obvious difference between a Relational Database and Object Database. Objects are fussy instances or occurrences of a class. We can straight accumulate an object without first converting the object's member variables into columns in a relational table when using an object database A more accurate model of the real world is provided by the object database approach. We can keep away from the artificial concept of mapping class member variables to database columns by directly storing objects in the database. An object identifier identifies every object stored in an object database. Object identifier is equivalent to a primary identifier in the relational world.
There are some advantages against each other but whatever if we use one of them this technologies, we will need to use SQL.
What is SQL really?
Structured Query Language is the standard language used to communicate with a relational database or object database. The prototype was originally developed by IBM using Dr. E.F. Codd's theory as a model. In 1979, not long after IBM's prototype, the first SQL product, ORACLE, was released by Relational Software, Inc. (now Oracle Corporation). SQL is pronounced either of two ways as the letters S-Q-L (esquel), or "sequel"; both pronounced are acceptable. SQL is the language that we use to express our needs to the database. We may request specific information from within a database in the form of a query, using SQL.
The American National Standards Institute (ANSI) is an organization that approves certain standards in many different industries. SQL has been deemed the standard language is relational database communication, originally approved in 1986 based on IBM's implementation. The current standard is referred to as SQL/92, much revised since 1986.
The American National Standards Institute (ANSI) is an organization that approves certain standards in many different industries. SQL has been deemed the standard language is relational database communication, originally approved in 1986 based on IBM's implementation. The current standard is referred to as SQL/92, much revised since 1986.
What is a Data?
Data is a collection of information stored in a database as one of several different data types. Data includes names, numbers, dollar amounts, text, graphics, decimals, figures, calculations, summarization, and anything else we can possibly imagine. Data can be stored in uppercase, lowercase, or mixed case. Also data can stored as an object with object database technology. Data can be manipulated or changed; most data does not remain static for its lifetime.
An Explanation to Database Objects
Database objects are the underlying backbone of the relational database and they are fundamentals of object database technology. These objects are logical units within the database that are used to store information, and are referred to as the back end database. The majority of the instruction during this article revolves around the table, but keep in mind that there are other database objects, many of which are discussed in later articles. A database object is any defined object in a database that is used to store or reference data. Some examples of database objects include tables, views, clusters, sequences, indexes, and synonyms. Also we can keep a record as an object in database.
An Introduction to SQL Statements
Before retrieve data from a table we need create a table if it is not exist already. The CREATE TABLE statement is obviously used to create a table. Although the very act of creating a table is quite simple, much time and effort should be put into planning table structures before the actual execution of the create table statement. Here is the syntax of create table,
- CREATE TABLE table_name
- ( field1 datatype [ not null ],
- field1 datatype [ not null ],
- field1 datatype [ not null ],
- field1 datatype [ not null ],
- field1 datatype [ not null ]
- )
In this article we will use the popular data types CHAR, VARCHAR, NUMBER, and DATE. Here is we create a table called EMPLOYEE_TABLE in the following code piece,
- CREATE TABLE EMPLOYEE_TABLE
- ( EMPLOYEE_ID CHAR(10) NOT NULL,
- EMPLOYEE_NAME VARCHAR(35) NOT NULL,
- EMPLOYEE_ADDR VARCHAR(30) NOT NULL,
- EMPLOYEE_CITY VARCHAR(15) NOT NULL,
- EMPLOYEE_STATE VARCHAR(2) NOT NULL,
- EMPLOYEE_ZIP VARCHAR(5) NOT NULL,
- EMPLOYEE_PHONE VARCHAR(11) NULL,
- EMPLOYEE_NOTES VARCHAR(40) NOT NULL
- );

peterPosted Mar 16, 2006, 3:47 AM
Hi, I liked your article... do you happen to know how to work with serverside cursors? I need to have the database return 10 or 20 rows at a time from the result set (a select/join of two tables). Then the user should pres "next 10", and the database should return the next rows from its result. I cannot let the database return the entire resultset to a DataSet, as the result consists of thousands of rows, taking several minutes to build. My database is an IBM AS400