Anda di halaman 1dari 9

What is a Database?

Wondering what a database is? Well, this is the right place to be. Basically, a database is a collection of data organized for easy storage and access. Data is a single piece of information, and can include, but is not limited to, text, images, numbers, and media clips! Databases help to organize data in a coherent way to help us in our everyday lives. Every single day, we can accumulate tons of data. Without a way to organize all of this, the world would be a complete mess of little pieces of scattered information! You might not know it, but you frequently use databases in your everyday lives. Have you ever checked a dictionary for the spelling of some unknown word? Well, dictionaries are large databases of words! They organize words and their definitions in such a way to make it easy for us to use! Your local library is also an example of a database. They store hundreds upon hundreds of books in a logical order. There's the children's section and the adult's section, the nonfiction and fiction sections, the paperback and hardcover sections, and so on. Within these sections, books are placed in alphabetical order or in the order denoted by the Dewey Decimal System. All of this is a coherent way to organize books! Libraries and dictionaries are both paper-based databases. This means that these databases are not computerized, but instead are written down on paper. Paper-based databases have often presented dozens of problems. They are cumbersome and hard to transport from one place to another. It is also quite easy to misplace a page or a portion of the database! That is why some brilliant scientists have introduced computerized databases. These are databases that rely on computers to organize and store data. They are fast, compact, durable, and extremely reliable! Ever since computerized databases have been introduced, they have played an integral part in record keeping and in the storage of data. These databases are often used by the government, by universities and colleges, and by businesses to keep track of data. Most of these databases are private and of no interest to the general public. However, there is also a variety of databases, both commercial and non-profit, for the public. Anybody could access these databases, providing that they had the proper software and hardware. As the years have progressed, databases have begun to play an important role in the Internet. They are vital components of many websites, especially on-line stores, like Amazon or Barnes and Noble. Databases are also vital components of search engines like Yahoo and Google. They enable the search engines to keep track of the millions of websites so that you can access them quickly and efficiently. Also, there is what is called an on-line database. These are databases that are available to anybody that has a modem, computer, and a telephone line- basically, anybody with Internet access! The user merely connects to the database, type in the data it wants to access, and voila, the data is displayed on the computer screen!

Parts of a Database
Now that you know what a database is, you might be wondering how exactly these things work. Databases are divided into three main parts:

1. Data: Of course, as databases are specially designed to organize data, data is one of the key parts of a database! As you probably already know, data is a small bit of information. It could be in the form of pictures, text, numeric values, media, or audio samples. Any information that you gather can be considered data. For example, pretend that you are growing sunflowers in science class. Your teacher has told you to measure the plant to see how much it has grown. Your measurements are a type of data! The data is the information that is placed in a database. Here is a database that we are all familiar with- an address book. Pretend that you have an address book that is set up to resemble a table: Name John Cook Matthew Smith Emily Coffey Mary France Address 255 Main St. 43 First Ave. 2 Meadow Ln. 43 Strawberry Rd. Phone Number 543-7885 423-4567 978-2346 231-5926 E-mail jcook@aol.com matt@yahoo.com emilyc@hotmail.com mfrance@aol.com

All of the names, addresses, phone numbers, and e-mail addresses are called data.

2. Field: Fields are where the data goes when it is entered into a database. Recall the address book that we mentioned above. Each of the columns would be called a field. The words in bold are called Field Names, because they describe the information that is to be contained in the field. All fields can contain different types of information. For example, the "Name" field above contains the names of the people, while the "Address" field contains the people's addresses. Some fields can contain text, some numeric values, some images, some a short movie clip, some an audio filethe list goes on and on.

Sometimes, you can control the type of data that can be placed in a certain field. For example, say you want to limit the "Name" field in the above address book to only letters. There are "attribute" tags you can add to each field that restrict the kind of data that is to be placed in the field. For example, there are "attribute" tags that might say that you can only place letters in a field and other "attribute" tags that might say you can only place numbers in the field. There is also another type of attribute tag that can limit the number of characters that you can place in a field. For example, a certain attribute tag might say that you can only type in a maximum of 10 letters in a certain field. Finally, there is a type of attribute tag that is called "required, optional, or calculated." These attribute tags control the amount of data to be placed in a certain field. If a field is given the "required" attribute tag, that means that the field is mandatory- meaning that you must put data in the field. You cannot leave it empty. On the other hand, a field with an "optional" attribute tag does not have to be filled in. Finally, the "calculated" attribute tag means that the user is not supposed to fill it in. The computer will later fill in this field after it has performed the necessary calculations. 3. Records Just as fields would be the columns in the address book above, the records would be the rows. If you take a look at the address book that we mentioned above, a record would be a row of data. However, keep in mind that the first row is NOT called a record because it contains the field names. Thus, records begin with the second row.

Database Files: As you might know, computer files are collections of data. For example, the word document I typed this article on would be a text file. The picture of my cat that I scanned onto my computer would be saved as a graphic file, while the MP3 that I downloaded off the Internet would be stored in an MP3 file. There are also special types of files that are used to store the data in databases. These are called database files. Database files are composed of all of the fields, records, and data that are found in a typical database. The more files that are found in a single database, the larger the database will be!

Types of Databases

As with just about everything else in the world, there are many different types of databases. There are also different ways to classify these types of databases. Two popular ways to differentiate between databases is by the function of the database and by the data model of the database.

Function: First, we shall take a look at classifying by the function of the database. There are different databases that are used for different tasks and jobs. The two categories here are analytic databases and operational databases: Analytic Databases: Analytic databases, also called On Line Analytical Processing (OLAP), are databases that are primarily used to keep track of statistics. Usually, they are read-only, meaning that you can only retrieve data, but you can't modify the data in any way. They are often used by stores as inventory catalogs. They keep track of the company's sales, and then can be read and analyzed to determine how and when more products are sold. These databases can hold all sorts of descriptive information about the goods stored in a company's inventory.

Operational Databases: Operational databases, also called On Line Transaction Processing (OLTP), are databases that have a completely different job. These databases, unlike the analytic databases, let you actually change and manipulate the data. While analytic databases only let you view the data, these databases let you modify the data in any way you would like- you can add data, delete data, or even change the data.

Data Model: Another way of classifying databases is by their data model. So, what's a data model? A data model is the intangible form in which data is stored. It is kind of like the structure of a database, but data models are only a theoretical idea; they are abstract concepts that you cannot touch. Data models are used to describe how the data is stored and retrieved in a database. Now, we will discuss a few of the types of data models.

Flat-file Database Model: The flat-file data model is generally used by the old paper-based databases. In this system, data was stored in numerous files. However, the files were not linked, so often, data might be repeated in more than one file. This caused everything to be quite redundant. The original "database," flat-file databases inspired scientists to find a way to link files so that they would not be repetitive.

Hierarchical Database Model: The hierarchical database model took steps to get rid of the repetitiveness of the flat-file database model, but although it was somewhat successful, it did not completely succeed. There is still a level of redundant data in hierarchical databases. A hierarchical database consists of a series of databases that are grouped together to resemble a family tree:

Each of the boxes in the diagram represents one database. The top database in the hierarchical model is called the "parent" database. The databases under it are called "child" databases. One "parent" can have many "children," but a "child" can only have one "parent." The child databases are all connected to the parent database via links called "pointers." To get to a child database in the hierarchical database model, you must first go through the parent database, and then through the levels above it. If you have Microsoft Windows, you might realize that this is how Windows Explorer works. First, you open up a file- usually it's "My Computer." Under "My Computer," you can then choose from a list of drives. Pretend you clicked on the "Disk Drive C" icon. Then, under this, you can choose from a series of folders. After opening one folder, you can open another folder, and another, until you reach the file that you want. Notice in the diagram above how the child databases on the same level are not connected. This presents a problem in the hierarchical database model and makes searching for data extremely difficult. Another problem is that data cannot be entered into the child databases until that field has been added to

the parent database. This method was quite inefficient. Thus, although the hierarchical database model reduced some repetitiveness of data, it also presented many new problems.

Network Database Model: The network database model was designed to help resolve some of the hierarchical database model's problems. For one thing, it allowed for links between the child databases. This no only reduces the chance of redundant data, but also makes searching for data much easier! Another improvement of the network database model over the hierarchical model is that while in the hierarchical model a child database can only have one parent, in the network model, a child database can have more than one parent! However, the network database model still had its share of problems. For one thing, it was difficult to execute and maintain the parent database. This method was quite inefficient. Thus, although the hierarchical database model reduced some repetitiveness of data, it also presented many new problems.

Network Database Model: The network database model was designed to help resolve some of the hierarchical database model's problems. For one thing, it allowed for links between the child databases. This no only reduces the chance of redundant data, but also makes searching for data much easier! Another improvement of the network database model over the hierarchical model is that while in the hierarchical model a child database can only have one parent, in the network model, a child database can have more than one parent! However, the network database model still had its share of problems. For one thing, it was difficult to execute and maintain Only database experts could successfully use these databases. It was difficult for the general public to use network databases for real-life applications.

Relational Database Model: The relational database model came in at full swing during the 1980s. Modeled after the work of Dr. E. F. Codd of IBM, the relational database model is extremely

popular because it solved many of the problems displayed in the hierarchical and network database models. The relational database model is different from the hierarchical and network database models in that there are no "parent" and "child" databases. Rather, all of the databases in the relational database model are equal. Data can be stored in any number of separate databases. Then, these databases are connected by a "key" field. A key field is a field (in case you don't remember, a field is the columns in the database where the data is stored- see "Parts of a Database" for more details) that is found in all of the databases that are being linked together. All of the databases can be used to hold different types of data. For example, let's pretend that we have an address book, which is a paper-based database. If we were to use the relational database model, then we would store all of the data in separate databases. One database could hold a person's address; another could hold the person's phone number, etc. However, all of the databases might have one field that is the same, like, for example, the person's name. This makes it easy to search for and extract data from the databases. It is also very efficient and easy to use. No wonder why this database model is so popular!

Object-oriented Databases: You might realize that databases can not only store text and numeric values, but that there are special databases that can also store photos, sounds, videos, and all sorts of graphics. How is this possible? Well, I can tell you one thing, the old hierarchical, network, and relational databases couldn't store all of these types of data! As a matter of fact, this is where the object-oriented database models come in. Object-oriented database models let databases store and manipulate not only text, but also sounds, images, and all sorts of media clips! They are extremely useful, but unfortunately, they are large in size and are extremely expensive. Thus, they are only found in large commercial or governmental organizations.

Client/Server Databases As you probably know, the Internet is one of the most popular usages of a computer. Client/server databases are the databases that you will use for the Internet and for the World Wide Web. The database is left on 24 hours a day, 7 days a week. This is so that users, or clients, can access the web sites or whatever other data is contained in the database at any time they want. This is

especially necessary if you want to make the applications available to anybody, anywhere in the world. There is a special type of interface that lets the clients submit certain data requests from the database. Then, the database will handle and process the requests!

How Databases Work


In previous sections, we have described what databases are, what the parts of a database are, and what the types of databases are. But how do you interact with a database? How do you add, change, or delete data? There are two ways to connect to a database. 1. Command Shell: The first way to connect to a database is by using a command shell. These are devices that gives you access to the data in a database. First, you need to log on, after which you will be able manipulate data and receive the output of your actions. Command-shells come in many different forms. Some can be quite simple, while others are quite fancy, complete with graphics and icons!

2. Network Sockets: The second way to connect to a database is through sockets over a network, like the Internet. This way lets you connect to a database by using a local-area network (LAN) or a wide-area network (WAN). Thus, you can access a database in Seattle, Washington while at a business conference across the country in Philadelphia, Pennsylvania!

Anda mungkin juga menyukai