You are modeling an emergency communication system used to contact teachers in c
ID: 3873587 • Letter: Y
Question
You are modeling an emergency communication system used to contact teachers in case inclement weather emergencies cause delayed openings or closures of the school. You may reach teachers by phone and/or email. The school must have at least one means of contact (phone or email) for each teacher. Each teacher may have more than one of each contact type. Which type of entity would you use in conjunction with the TEACHER entity to model a teacher’s contact information? You decide to model a CONTACT table with primary key of Teacher-ID and Contact-Info, which is the contact information itself. The school principal, a major stakeholder, tells you she wants to track the area code for each teacher’s phone number(s): Will your original modeling concept work? If not, how would you change the model to reflect the principal’s request? How many entities would you need to represent the unique attributes of telephone numbers and email addresses so that no entity contained null values? The principal reminds you that every teacher must have at least one phone number, but having an email address is not a requirement. Where would you reflect the phone number constraint in your model? Assignment: Include your models and your responses to the questions.
Explanation / Answer
Teacher id should be primary key the above concept is true. But the model needs certain changes to give a good design. The telephone number must be done by
1)Composite key concept
composite key basically allows you to create two primary keys
CREATE TABLE SAMPLE_TABLE
(COL1 integer,
COL2 varchar(30),
COL3 varchar(50),
PRIMARY KEY (COL1, COL2));
so it would be following Teacher table with the teacher and contact number as primary key and rest column can be left without any constraint or if required do as above mentioned points.
Related Questions
drjack9650@gmail.com
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.