Datasheet
scenario does not apply. If you have a phone number and want to know to whom it belongs, you won’t
find a phone book particularly useful. While it is technically possible, it’s not something you’d want to do
unless you have a lot of time on your hands. And it would be a lot easier to simply dial the number and ask
to whom you were speaking. Even in flat-file storage, searching for a specific entry still means starting at
the beginning and working your way through to the end in some systematic (and arbitrary) way.
Databases store data in a highly structured way, enabling multiple modes of retrieval and editing. With
phone book data in a database, any of a number of tasks would be possible in a relatively simple way,
including the following:
❑ Retrieve a list of phone numbers for people whose first name starts with the letters “Jo.”
❑ Find all the people whose phone numbers contain numbers whose sum is less than 40.
❑ Find all the people whose address contains the phrase “Primrose” and who are listed with full
names rather than initials.
Some of these operations might require a little more effort to set up than others, but they can all be done.
In most cases they can be achieved by querying the database in certain ways, which means asking for
the data in the right way, rather than manipulating data after it has been obtained using, say, C#.
Structure and efficiency aren’t the only benefits offered by a database. With a centralized, persistent data
store you have many more options, including simple data backup, mirroring data in multiple locations,
and exposing data to remote applications via the Internet. You look at these and other possibilities later
in this chapter.
Before I continue, one thing must be made abundantly clear from the outset. The word “database” does
not — repeat, not — refer to the application that stores data. SQL Server, for example, is not a database.
SQL Server is a database management system (DBMS). A DBMS is responsible for storing databases, and
also contains all the tools necessary to access those databases. A good DBMS shields all of the technical
details from you so that it doesn’t matter at all where the data is actually stored. Instead, you just need
to interact with whatever interfaces the DBMS supplies to manipulate the data. This might be through
DBMS-supplied management tools, or programmatically using an application program interface (API)
with C# or another programming language.
In fact, there are different types of DBMS to consider. The two most important and well known are:
❑ Relational database management systems (RDBMSes)
❑ Object-oriented database management systems (OODBMSes)
In the next sections you explore the differences between these types and the key features of both.
Relational Database Management Systems
Relational database management systems (RDBMSes) are what you would typically think of as a DBMS,
and these are the most commonly found and often used systems. SQL Server, for example, is an RDBMS.
Two things are essential for an RDBMS:
❑ Separate tables containing data
❑ Relationships between tables
3
Database Fundamentals
44063c01.qxd:WroxBeg 9/12/06 10:30 PM Page 3