Show
A well-designed relational database will ensure your team's data is accurate, consistent, and reliable. Get the most use out of your database with these four design tips. Perhaps you need to streamline your team’s operations, or ensure that multiple teams are working from a single source of truth. Maybe you’re in charge of your department’s data quality, or you have some other data-related responsibility. Whether you’re new to databases or an old pro at SQL, you can likely benefit from a refresher in relational database design. Big and small organizations alike use relational databases to more efficiently store, manage, and analyze critical information, for purposes as disparate as customer relationship management, content production, product planning, UX research, and many more. Not all relational databases are created equal, however. A poorly designed database might make it more difficult to access the information that you need or jeopardize the accuracy of your data; in contrast, a well-designed database provides several benefits:
You could build a house without first finalizing the blueprints, but in doing so, you might end up with a house of questionable structural integrity; similarly, taking some time to think carefully about the design of your relational database before implementing it can save you a lot of trouble in the long run. All this might seem daunting if you’ve only just begun learning about relational databases, or even if you’ve already built a couple of databases and encountered some challenges. In this tutorial, we’ll cover several design principles that you can follow to help you build better databases. What is a "well-designed" database?So clearly, good database design is important when trying to build a database that works for you. But what does it actually mean for a database to be well-designed? Nerd alert: The first person to devise an abstract model for database management was Edgar Frank Codd, an English computer scientist who joined IBM in the 1940s. A well-designed database enforces data integrityData integrity refers to the overall accuracy, completeness, and consistency of the data in your database; a well-designed database maintains data integrity by implementing the processes and standards proposed during the design phase. Data integrity includes three specific technical aspects of a relational database’s structure:
A well-designed database enforces relevant business rulesEvery organization does its work a little differently, and as such, each organization has its own unique requirements for its data, also known as business rules. If your company is the size of Microsoft, you’ll use databases differently than if you’re a small video operation. Still, even among video companies, business rules are rarely the same. Let’s say your video company requires that timestamps for video files be noted in milliseconds, and each video client is assigned an eight-character alphanumeric code. Ideally your team’s database should be able to enforce your unique business rules; this will ensure that the data coming into your base is both accurate and useful. For example, if the video files in the above example were noted in seconds instead of milliseconds, and then entered into the company database, it could create a major snag in video production—and a mess for a database administrator to clean up later. How to design your relational database, step by stepIf this all sounds unfamiliar or overwhelming, don’t worry—there is a systematic process you can follow that will ensure your relational database management system (or RDBMS) follows good design principles, is well-suited to your organization’s needs, and avoids common pitfalls. Step 1: define your purpose and objectivesBefore beginning your database design journey, it’s worth taking a step back and answering a very important question: “Why am I making this database?” Are you making this database in order to manage business transactions? To store customer IDs? To solve a particular organizational problem? Whatever the case, it’s worth taking the time to identify the intended purpose of the database you’ll be creating. You may even wish to work together with managers, leadership, and end users to jointly write out a mission statement for your database, like: “The purpose of the Mingei International Museum database is to maintain the data for our art collection,” or “Zenbooth’s database will store all of the data for our manufacturing resource planning.” Additionally, you should define the objectives that the end users of the database will have: which specific tasks will the end users need to perform in order to accomplish their work? Developing an explicit list of objectives—like “Know the status and location of each of the pieces of art in our collection at all times,” or “Maintain a complete customer table that shows records for each of our clients.” This will help you determine an appropriate structure, or database schema, for your information as you work through this design process. Step 2: analyze data requirementsBefore you begin designing your database, you’ll need to analyze your organization’s data fundamentals and requirements. This might sound intimidating, but all it means is that you’ll be assessing how your team currently does its work, and identifying what kind of data is most important to that work. You can do this by closely examining existing processes and by interviewing team members—both management and end users. Some questions to ask as you conduct your research:
Step 3: create a list of entities and a list of attributesAfter settling on your organization’s purpose and objectives, and analyzing your data requirements, the next steps are to extract a list of entities and a list of attributes from the body of research you’ve compiled. In the context of relational databases, an entity is an object, person, place, event, or idea—like “clients,” “products,” “projects,” or “sales reps.” Attributes are the defining characteristics of those entities, like “name,” “quantity,” “address,” “phone number,” or “genre.” One way you can think about this is that entities are like nouns, and attributes are like the adjectives that describe those nouns. Start by picking out entities from your research and putting them on a list. These entities will eventually serve as a guide to help you define your tables later on in the design process, but they will also help you identify the attributes necessary to create your list of fields. For example, if you were developing a talent database for a record label, your entities list might look something like this:
Next, create a separate list containing the relevant attributes for each of the entities you’ve identified, as well as any dependencies the attributes might have on one another. These attributes will define the fields for your tables. Again, for the talent database example, your attributes list might look something like this:
Once you’ve collected a preliminary list of attributes, you should go through and refine them to make sure that they accurately represent your organization’s informational needs. Tips:
After refining your lists, it’s a good idea to review these lists that you’ve compiled with some of the team members you interviewed to confirm that you’ve accounted for every necessary type of data. Be sure to take their feedback into consideration and further refine your lists as appropriate. Step 4: model the tables and fieldsAfter creating your lists of entities and attributes, your task is to use those lists to design the structure of your relational database. Your list of entities will become separate tables in your base, and the list of attributes will become the fields for these tables. Take your lists and assign each of the attributes to your tables. For example, after we finish assigning our listed attributes to our new tables, our talent management database-in-planning might look something like this: Next, you need to pick an appropriate primary key field for each table. A primary key is a major component of ensuring data integrity, as it uniquely identifies each record within a table and is used to establish different types of relationships between tables. Each table’s primary key field should meet the following criteria:
It might be possible that your preliminary list of fields for a given table does not contain one single field that meets all these criteria. However, you may be able to combine two or more fields to create a separate, unique field which does meet all these criteria. For example, you could combine the values in a “Given Name” field and a “Surname” field to create a third, calculated “Full Name” field using a concatenation formula. In the event that this strategy still doesn’t work for your purposes, you can always manufacture a new field designated specifically for unique identification codes to serve as your primary key field. Fields like “Product ID” or “Sales Invoice Number” are often created for this purpose. Let’s return to our talent management database example. For the “Artists” table, the “Artist name” field is already a pretty good candidate for the primary key, as it’s pretty unlikely that your record label will sign two artists with the same name. We can also pick “Venue name” as the primary key for the “Venues” table. For the other tables, however, it would probably be better to make new fields that concatenate values from existing fields. In the “Agents” table, we might make a new field—“Agent full name”—that concatenates the values of the “Agent given name” and “Agent surname” fields. For the “Gigs” table, an artist could perform at the same venue on multiple occasions, so we should make a new field that gives a unique name to the specific combination of an artist at a venue on a specific date. You could potentially concatenate the name of the artist, the venue, and the date to create values like “2 Linkz at the Gotham City Metro Club, 02/13/2019,” but that can get long and unwieldy fast. Alternatively, you could try creating a new field—“Gig code”—with unique alphanumeric code values (like “E0023”). Whichever approach you take is up to you and your team’s specific needs. Ready to design a relational database in Airtable? Check out our guide to building a base, where you can use a template as a model or start from scratch. Sign up for Airtable for free Why is it important to define the data type of a field when designing a relational data base?Choosing the right data types for your tables, stored procedures, and variables not only improves performance by ensuring a correct execution plan, but it also improves data integrity by ensuring that the correct data is stored within a database.
Why it is important to properly define the data type of a field?Every table in Access is made up of fields. The properties of a field describe the characteristics and behavior of data added to that field. A field's data type is the most important property because it determines what kind of data the field can store.
Why do we need to properly determine the type of data before entering it into our database?Data type and length are the most fundamental integrity constraints applied to data in a database. Simply by specifying the data type for each column when a table is created, DB2 automatically ensures that only the correct type of data is stored in that column.
What is considered a data type when designing a database?A data type is a description of the kind of data in a table column. Each database system recognises its own set of datatypes, although some are common to many. Typical examples will be Integer or Text.
|