Designing Databases
Because databases contain so much data, good design is essential. Before creating the database, you should plan carefully. Good database designers will follow these steps:
- Needs analysis: What will the database be used for? Will you be managing inventory, controlling payroll, or using the database to process orders from a Web site?
- User analysis: Who will use the database? If the database will be used primarily by programmers or other database developers, you don't need to create too many fancy forms. However, if your primary user is a computer novice, you'll need to make sure that data entry is easy with a user-friendly form.
- Data analysis: What information do you need to store? You don't want the database cluttered with unnecessary data.
- Determine fields: Now that you know what data you need, what fields are appropriate for storing that data? For example, you know you want to store customer's names, but you should probably store names in two or three fields (first name, middle initial, and last name).
- Initial table design: What is the most logical way to group the fields into tables? Keep related information together in records, and don't duplicate information between tables. If one set of fields contains information that will be needed by a variety of tables, keep those fields together in their own table. Ensure that each table has at least one field that contains data unique for each record (the primary or key field).
- Relationship design: Now that you have a preliminary idea of how you want your data organized into fields and tables, look at the relationships between tables. Link tables together by defining relationships between their common fields.
Finally, when you are satisfied with the database design, it's time to create the tables and populate them with data. Create the queries you need to retrieve data from different tables, then create forms for data entry and reports for output.
Take the time to plan your database before jumping in and creating the tables. It is much easier to change the design of tables and relationships in the planning stage than once the tables are populated with data.