0 like 0 dislike
65 views
in Computer Science by (1.0m points)
What is physical database design?

1 Answer

0 like 0 dislike
by (1.0m points)
Physical database design translates the logical data model into a set of SQL statements that define the database. For relational database systems, it is relatively easy to translate from a logical data model into a physical database.

Rules for translation:

Entities become tables in the physical database.

Attributes become columns in the physical database. Choose an appropriate data type for each of the columns.

Unique identifiers become columns that are not allowed to have NULL values. These are referred to as primary keys in the physical database. Consider creating a unique index on the identifiers to enforce uniqueness.

Relationships are modeled as foreign keys.

Spaces are not allowed in entity names in a physical schema because these names must translate into SQL calls to create the tables. Table names should therefore conform to SQL naming rules.

Because primary key attributes are complete inventions, they can be of any indexable data type. (Each database engine has different rules about which data types can be indexable.) Making primary keys of type INT is almost purely arbitrary.

It is almost arbitrary because it is actually faster to search on numeric fields in many database engines. However, one could just have well have chosen CHAR as the type for the primary key fields. The bottom line is that this choice should be driven by the criteria for choosing identifiers.

Model relationships by adding a foreign key to one of the tables involved in the relationship. A foreign key is the unique identifier or primary key of the table on the other side of the relationship.

The most common relationship is the 1-to-M relationship. This relationship is mapped by placing the primary key on the "one" side of the relationship into the table on the "many" side.

1-to-1 relationships should be mapped by picking one of the tables and giving it a foreign key column that matches the primary key from the other table. In theory, it does not matter which table is chosen, but practical considerations may dictate which column makes the most sense as a foreign key.

Related questions

0 like 0 dislike
1 answer 77 views
0 like 0 dislike
1 answer 150 views
0 like 0 dislike
0 answers 48 views
asked Feb 13, 2019 in Computer Science by danish (1.0m points)
0 like 0 dislike
1 answer 17 views
0 like 0 dislike
0 answers 52 views
0 like 0 dislike
1 answer 59 views
asked Feb 13, 2019 in Computer Science by danish (1.0m points)
0 like 0 dislike
1 answer 149 views
asked Feb 11, 2019 in Computer Science by danish (1.0m points)
0 like 0 dislike
1 answer 32 views
asked Feb 11, 2019 in Computer Science by danish (1.0m points)
0 like 0 dislike
1 answer 28 views
0 like 0 dislike
1 answer 23 views
asked Feb 13, 2019 in Computer Science by danish (1.0m points)
Welcome to Free Homework Help, where you can ask questions and receive answers from other members of the community. Anybody can ask a question. Anybody can answer. The best answers are voted up and rise to the top. Join them; it only takes a minute: School, College, University, Academy Free Homework Help

19.4k questions

18.3k answers

8.7k comments

3.3k users

Free Hit Counters
...