Why and When to Use a Database

by Goran Tomida.

Share
|
Homepage | Submit your article | Contact | TOS
More articles on databases  

You are here: Categories » Computers and technology » Databases

When there are a huge number of alternative ways to store data, why should you trouble yourself creating a database? What advantages does a database hold? The main advantage is fast and efficient data retrieval. A database helps you to organize your data in alogical manner. Database management systems are fine-tuned to rapidly retrieve the data you want in the way you want it. Databases also enable you to break data into specific parts. Retrieving data from a database is called querying. You’ll often see the term SQL query, which briefly means any SQL code that extracts data from the database. Relational databases have the further advantage of allowing you to specify how different data relates to each other, as you saw in the car sales database example. If you store sales details and salesperson data in related databases, the question “How many cars has salesperson X sold in January?” becomes very easy to answer. If you just shoved all the information into a large text file, you’d find it one enormous task to question, or query, the data and find out specific answers.

Databases also allow you to set up rules that ensure that data remains consistent when you add, update, or delete data. Imagine that your imaginary car sales company has two salespeople named Julie Smith. You can set up a database to ensure that each salesperson has a unique ID, called a unique identifier (so that the Julies don’t get mixed up); otherwise, telling who sold which cars would prove impossible. Other data storage systems, such as text files or spreadsheets, don’t have these sorts of checks and quite happily allow you to store erroneous data. For example, you might specify that an employee’s social security number must be unique in the database. Or if a car is sold and it’s listed as being sold by the employee with an ID of 123, you might add a check to see that full details of employee 123 are held in one of the database tables.

A properly set-up database minimizes data redundancy. Again using the car sales example, you can store all the details of a salesperson just once in the database and then use a unique ID to identify each salesperson. When you have other data that relates to a particular salesperson (for example, which cars they’ve sold), you can use the unique ID to search for the data. The unique ID is often a number that takes up less storage space than the person’s full name. Databases store raw data—just the facts, so to speak, and no intelligence. A car sales database might contain the make, model, and price of each car, but you wouldn’t normally store the average number of cars sold in a month, because you can calculate that from the car sales information, the raw data.

A spreadsheet, however, may contain processed data, such as averages and statistical analysis. A database simply stores the data and generally leaves data processing to a front-end program, or the interface the user sees. Examples of front-end programs include a Web page that draws its data from a database or a program that hooks into the database’s data and allows the user to view it. Sharing data is also much easier using a database. You can share data among a number of users on the same computer or among users on different computers linked via a network or the Internet. If the example car sales company has branches in New York, Washington, and Boston, you could set up a computer containing a database in one location that is accessible by all of the offices via a network. This is not only possible but also safe because databases have a clearly defined structure and also enforce rules that protect the data contained. They also allow more than one person to access the database at the same time and change the data stored; the database management system handles simultaneous changes. Imagine the potential chaos if you used an Excel spreadsheet, and two salespeople change data simultaneously. You want to keep both sets of changes, but whoever saves the spreadsheet last is the person whose changes are stored, overwriting any earlier changes.

Databases also make sharing data between different systems much easier than using proprietary data formats—that is, a format specific to a particular program, manufacturer, or operating system. An Excel spreadsheet, for example, is easily read on a Windows machine with MS Office, but it is more of a challenge to read on a UNIX, Macintosh, or Linux machine because those computers handle data in a different way. Even on a Windows machine, you need to have MS Office installed. You can house a database on a central computer, put the database management system on there, and then enable access via a local network or the Internet.

As an alternative to databases, text files and spreadsheets have one big advantage, which is also their weakness: flexibility. Text files have no real rules. You can insert whatever text data you like wherever you like. To a large extent, spreadsheets are the same. You can ask users to add data in a predefined structure, but you have no real way to enforce such a request. Using databases limits user access to just the data and does not allow users to change the structure.

One final significant advantage of databases is security. Most database management systems allow you to create users in order to specify various levels of security. Before someone accesses the database, he or she must log on as a specific user. Each user has various rights and limits. Someone who maintains the database has full ability to edit data, change the database’s structure, add and delete users, and so on. Other users may only have the ability to view data but not change it, or you may even want to limit what data they can view. Many database management systems provide a granular level of security, that is, they are very specific as to what a user can do. They are not just an all-or-nothing approach in which the user either has access or has no access.

Databases are used pretty much everywhere. Data processing played a big part in the development of computers, and even today it is one of their main roles. Nearly every walk of life or business requires a database somewhere along the way. Databases are commonly used on personal computers to store data used locally, and on company networks databases store and share company-wide information. The Internet has seen a big rise in databases used to share information; most online shops of a reasonable size use databases. When you visit online stores of any significant size, a database usually provides all the information on the goods being sold. Rather than every page being created by hand, large merchants use a template for book or CD details, and SQL retrieves the book information from the database. Imagine how much work it’d be if Amazon created every single page by hand!

Databases are great at dealing with large amounts of data that need to be searched, sorted, or regularly updated. Databases combined with SQL allow you to get the answers you want in the order you want.

Leave a comment or ask a question
Total comments: 0

Databases Disclaimer

  • The e-articles directory is not responsible for any and all copyright infringements by writers and authors. If you suspect the information contained by this page for any copyright infringements, please contact us to investigate the issue
Managing and Monitoring SQL Server 2000 Security - Authentication There are two methods of authentication offered SQL Server 2000, Windows authentication and SQL Server authentication. Windows authentication allows the SQL server (more...)
Basic Terms of Structured Query Language (SQL) - The first questions to ask are what is SQL and how do you use it with databases? SQL has three main roles: 1. Creating a database and defining its structure 2. Querying the d (more...)
Extracting and Transforming Data in SQL Server 2000 - SQL Server 2000 has several components that support the import and export of data. Data Transformation Services (DTS) is used to import and export data between like OLE DB (more...)
Introduction to SQL - SQL is an acronym for Structured Query Language and is the standard language for interaction with databases. SQL is both an ISO (International Organization for Standardization) and ANSI (Americ (more...)
What Is a Database - A database is simply an organized collection of information. It allows many different types of data to be stored and retrieved in a highly efficient manner. Information within a database (more...)
Installing MySQL Server - Installing MySQL is relatively painless. First, you need the installation program for MySQL, which is available on the companion CD. You can also download the latest version from (more...)
Basic SQL syntax: Creating and Modifying tables and databases - This tutorial shows basic syntax and commands and of the SQL language. Creating and Dropping Databases First, let's see what databases already exist in the MySQL server. We (more...)
Joining SQL Tables - When accessing information within database tables, we may sometimes need to look at data from two or more different tables, as we saw in the previous example. There is another useful way to acc (more...)
Relational SQL Databases - Think of a database that related the players in a game to one another (for example, to determine who was a friend of each player and who was an enemy of each player). First let's create (more...)
SQL Data Import Methods - This article presents the most common ways of importing data to MySQL. Importing from a Text File To create a text file that contains several records to be added to ou (more...)

 
free content
    Copyright © 2006 - 2012 e-articles.info.
The texts, articles and tutorials in the directory are property of their respective owners and authors.