What Is A Relational
What Is A Relational
Commercial Databases
Oracle
IBM DB 2
Microsoft SQL Server
Ingres. The first commercial RDBMS.
MySQL
PostgresSQL
SQLite
Strictly these are not relational databases but RDBMS. They provide security, encryption,
user access and can process SQL queries.
What is Normalization?:
Consider a spreadsheet of client records that is to be put into a relational database. Some
clients have the same information, say different branches of the same company with the
same billing address. In a spreadsheet this address is on multiple rows.
In turning the spreadsheet into a table, all the client's text addresses must be moved into
another table and each assigned a unique ID- say the values 0,1,2. These values are stored
in the main client table so all rows use the ID not the text. A SQL statement can extract
the text for a given ID.
What is a Table?:
Think of it as being like a rectangular spreadsheet made up of rows and columns. Each
column specifies the type of data stored (numbers, strings or binary data - such as
images).
Unlike a spreadsheet where the user is free to have different data on each row, in a
database table, every row can only contain the types of data that were specified.
In C and C++, this is like an array of structs, where one struct holds the data for one row.
For more information see Normalizing a database in the Database Design part of
databases.about.com.
Using a database file is the older method, more suited to desktop applications. E.G.
Microsoft Access, though that is being phased out in favour of Microsoft SQL Server.
SQLite is an excellent public domain database written in C that holds data in one file.
There are wrappers for C, C++, C# and other languages.
Database Server
A database server is a server application running locally or on a networked PC. Most of
the big databases are server based. These take more administration but are usually faster
and more robust.
There are many client applications that can talk to a database server. Microsoft SQL
Server has Enterprise Manager to create databases, set security, run maintenance jobs,
queries and of course design and modify database tables.
What is SQL?:
SQL is short for Structured Query Language and is a simple language that provides
instructions for building and modifying the structure of databases and for modifying the
data stored in the tables. The main commands used to modify and retrieve data are:
There are several ANSI/ISO standards such as ANSI 92, one of the most popular. This
defines a minimum subset of supported statements. Most compiler vendors support these
standards.
Conclusion:
Any non trivial application can use a database and a SQL based database is a good place
to start. Once you have mastered the configuration and administering of the database then
you have to learn SQL to make it work well.
The speed at which a database can retrieve data is astonishing and modern RDBMS are
complex and highly optimized applications.
Open source databases like MySQL are fast approaching the power and usability of the
commercial rivals and drive many databases on websites.
Try the following. It should work on Windows XP, and on Windows 2000 if you've ever
installed MDAC. If you haven't and want to try this, visit Microsoft.com, do a search for
"MDAC Download" and download any version, 2.6 or higher.
Create an empty file called test.udl. Right click in Windows Explorer on the file and do
"open with", you should see Microsoft Data Access - OLE DB Core Services". This
dialog lets you connect to any database with an installed provider, even excel
spreadsheets!
Select the first tab (Provider) as opens by default at the the Connection tab. Select a
provider then click Next. The data source name shows the different types of device
available. After filling in user name and password, click the "Test Connection" button.
After you press the ok button, you can open the test.udl with file with Wordpad. It should
contain text like this.
[oledb]
; Everything after this line is an OLE DB initstring
Provider=SQLOLEDB.1;Persist Security Info=False;User ID=sa;Initial
Catalog=dhbtest;Data Source=127.0.0.1
The third line is the important one, it contains the configuration details. If your database
has a password, it will be shown here, so this is not a secure method! This string can be
built into applications that use ADO and will let them connect to the specified database.
For more see
About ADO.
What is SQL?
Using ODBC
ODBC (Open Database Connectivity) provides an API based interface to databases.
There are ODBC drivers available for just about every database in existence. However
ODBC provides another layer of communication between an application and the database
and this can cause performance penalties.