In: Computer Science
I need the specific answers for these questions, and clear vision diagram
thanks
Consider the following tables:
GENRE(GEN_CODE, GEN_DESCRIPTION)
BOOK(BOOK_ISBN, BOOK_TITLE, BOOK_PRICE, GEN_CODE)
For the tables given above, work on the problems below:
1. For each table, identify the primary key.
2. For each table, identify the foreign key(s).
3. Identify at least one candidate key. If there are no candidate keys, give an example of an attribute that could be used as a candidate key.
4. For one of the tables, give examples of a superkey and a secondary key.
5. For the given tables, explain how entity integrity and referential integrity could be violated. Give specific examples.
6. Use Visio to create a detailed Crow's Foot ERD. The diagram must include all entities, attributes, and relationships. Primary keys and foreign keys must be clearly identified on the diagram.
1)in genre table primary key is Gen_code (because it is not null and unique characterstics it has)
2)in book table foreign key is Gen-code(it is one to many relation ship tables).in Genre table no foreign key
3)Genre table there is no candidate key.the suggested attributed is gen_type
in book table Book_title is the candidate key.because it is unique key
4)A superkey is a combination of columns that uniquely identifies any row within a relational database management system (RDBMS) table. A candidate key is a closely related concept where the superkey is reduced to the minimum number of columns required to uniquely identify each row.
GEN-CODE GEN_TYPE
ISBN Book_TItle
DEFINITION: A secondary key is made on a field that you would like to be indexed for faster searches. A table can have more than one secondary key. The main purpose of a database is to store and search for data. When databases become large, possibly with hundreds of thousands of records, they can take a while to search ...
GEN_CODE
ISBN
5)The basis of Referential Integrity is foreign keys. A foreign key in one table references a primary key in another table. The primary key for a table uniquely identifies entities (rows) in the table. Primary keys are maintained with Entity Integrity, foreign keys with Referential Integrity.