Database System Concepts is the highly recommended book for the people interested in databases. Free version of this book can be downloaded from HERE.
Practice Exercises
2.1 Consider the employee database in below Figure. What are the appropriate primary keys?
Primary key is an attribute in a table which can uniquely identify that table. In employee table the person_name, in works table person_name and in company table company_name are the primary keys.
2.2 Consider the foreign-key constraint from the dept name attribute of instructor to the department relation. Give examples of inserts and deletes to these relations that can cause a violation of the foreign-key constraint.
Insertion:
As Instructor is child table of department for attribute dept_name, then adding something in instructor table which is not in department table will cause error. For example if we add economics as dept_name in instructor table but department table don’t contain it then it is a violation of foreign key constraint.
Deletion:
As department is parent table of instructor for attribute dept_name, then deleting something in department table which is present in instructor table will cause error. For example if we delete economics as dept_name in department table but instructor table do contain it then it is a violation of foreign key constraint.
2.3 Consider the time slot relation. Given that a particular time slot can meet more than once in a week, explain why day and start time are part of the primary key of this relation, while end time is not.
To read more visit https://hecodesit.com/database-system-concepts-7th-edition-solutions-chapter-2/
Top comments (0)