![]() ![]() ![]() For composite attributes, create columns only for the component attributes, not the composite itself. Do not create columns for multivalued attributes we will address these later. Do not create columns for derived attributes, as these values are not intended to be stored. Most attributes for the entity should be converted to columns in the new table. In our examples below, we will use singular nouns and underscores. For example, the entity assembly line could become a table named assemblyline or assembly_line. Another naming issue arises with table names containing multiple words some databases choose to run these together, while others employ underscore characters. In our data model from Chapter 2.2, the entity employee might become a table named employee or employees. For example, some databases use plural nouns for tables, while others use singular nouns. Otherwise, choose a basic approach and be consistent. If you are building a database for a company or organization that has naming standards, you will of course want to follow those. Regular entities ¶įirst, decide on a name for the table - this does not have to be the same as the entity name! There are many naming schemes for tables. Weak entities need slightly different handling than regular entities, so we will address them separately, starting with regular entities. The first step in building a relational database from an ERD is creating a table from each entity in the data model. The full set of tables resulting from our conversion is given at the end of the chapter. We start with the basic conversion rules, converting pieces of our example data model as we go. In this chapter, we will provide simple text descriptions in tabular format. ![]() Which you use will depend on your development process and needs. There are many ways to represent the relational database: logical or physical data models ( Chapter 2.4), text or tabular descriptions, or SQL code. The necessary foundations are covered in either Part I (Chapters 1.1 and 1.7) or Part III ( Chapter 3.1). This chapter assumes you are familiar with the basics of the relational model of the database, including tables and primary and foreign key constraints. We will use the computer manufacturer data model from Chapter 2.2 as our example. We will explore the trade-offs for each decision. While many steps are largely mechanical, a number of decisions need to be made along the way. In this chapter we explain the process of creating a relational database from an entity-relationship model. ![]()
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |