What is a foreign key constraint

Assignment Help Database Management System
Reference no: EM13507650

1.Answer each of the following questions brie?y. The questions are based on the following relational schema:

Emp(eid: integer, ename: string, age: integer, salary: real) Works(eid: integer, did: integer, pcttime: integer)

Dept(did: integer, dname: string, budget: real, managerid: integer)

1. Give an example of a foreign key constraint that involves the Dept relation. What are the options for enforcing this constraint when a user attempts to delete a Dept tuple? 

2. Write the SQL statements required to create the preceding relations, including appropriate versions of all primary and foreign key integrity constraints.

3. De?ne the Dept relation in SQL so that every department is guaranteed to have a manager.

4. Write an SQL statement to add John Doe as an employee with eid = 101, age = 32 and salary = 15,000.

5. Write an SQL statement to give every employee a 10 percent raise.

6. Write an SQL statement to delete the Toy department. Given the referential integrity constraints you chose for this schema, explain what happens when this statement is executed.

2.What is a foreign key constraint? Why are such constraints important? What is referential integrity?

3.Examples of non-candidate keys include the following: {name}, {age}. (Note that {gpa} can not be declared as a non-candidate key from this evidence alone even though common sense tells us that clearly more than one student could have the same grade point average.)

You cannot determine a key of a relation given only one instance of the relation. The fact that the instance is “legal” is immaterial. A candidate key, as de?ned here, is a key, not something that only might be a key. The instance shown is just one possible “snapshot” of the relation. At other times, the same relation may have an instance (or snapshot) that contains a totally di?erent set of tuples, and we cannot make predictions about those instances based only upon the instance that we are given.

4.many distinct tuples are in a relation instance with cardinality 22?

5.What is the di?erence between a candidate key and the primary key for a given relation? What is a superkey?

Reference no: EM13507650

Questions Cloud

Supply chain management is the integration of activities : Supply chain management is the integration of activities
Explain what is the morality of the solution : A 2 liter bottle contains a solution of sugar in water. there are 2 moles of sugar in the bottle. what is the morality of the solution. show your calculations.
The global pharmaceutical industry : The global pharmaceutical industry: swallowing a bitter pill
Explain acetone and potassium permanganate : Write equations using 1 butene to illustrate the reactions with br2 in dichloromethane, acetone and potassium permanganate, and sulfuric acid
What is a foreign key constraint : Examples of non-candidate keys include the following: {name}, {age}. (Note that {gpa} can not be declared as a non-candidate key from this evidence alone even though common sense tells us that clearly more than one student could have the same grade p..
The senior management : The senior management of your company has already made the strategic decision to allocate annual funding to each of the strategic business units (SBUs) within the company. A new executive (your Instructor) has been hired to head up your strategic bus..
State a balanced equation for the reaction : Write a balanced equation for the reaction involved in the synthesis of aspirin from salicylic acid.
Define the reactants reagents and products for the reactions : Give equations showing the structures of all the reactants, reagents and products for the reactions of salicylic acid with the following.
Suppose that we have a ternary relationship r between entity : Suppose that we have a ternary relationship R between entity sets A, B, and C such that A has a key constraint and total participation andB has a key constraint

Reviews

Write a Review

Database Management System Questions & Answers

  List the requirements for this eer diagram

Given the following EER diagram of the Museum Database.

  Design tables in 3nf various codes for at least three fields

Create tables in 3NF. As you create the database, include different codes for at least three of the fields. Use sample data to populate fields for at least three records in each table.

  Create a set of dependency diagrams for the abs database

Consider a case that is not described above, but could happen in the business of the ABS. Please explain the case and why it might occur and based on the case you proposed, modify your design of the ABS database accordingly.

  Create state transition diagram to describes student states

Create a state transition diagram that describes typical student states and how they change based on specific actions and events.

  Do a requirements analysis for the case study

To apply and consolidate skills acquired in the requirement and analysis disciplines through analysis of a simple case study, and to express the results through the relevant UML diagrams. ITC203

  Your database has been a hit you have been called back to

your database has been a hit. you have been called back to the customers headquarters and they want a detailed report

  What problems could be caused by not having indexes

What problems could be caused by not having appropriate indexes and what problems could be cause by having too many indexes?

  Diagram and determine the possible iterative steps

Determine the steps in the development of an effective Entity Relationship Model (ERM) Diagram and determine the possible iterative steps / factors that one must consider in this process with consideration of the HR core functions and responsibili..

  How could those redundancies lead to anomalies

What problem would you encounter if you wanted to produce a listing by city? How would you solve this problem by altering the file structure?

  Explain implementing its erp system

As an external consultant, you have been hired by Overstock.com to evaluate the effectiveness of the processes they undertook in implementing its ERP system and to present your evaluation in report format to the CEO Patrick Byrne

  Mark the words as index entries behavior and favorable

Mark the following words in the document as index entries: behavior (four instances), favorable (five instances), and impression (eight instances).

  Create database to keep information of movies

Create a database for Ray. He is interested in movies and wants to keep information on movies, actors, and directors in a database. The only user is Ray, and he needs to produce reports.

Free Assignment Quote

Assured A++ Grade

Get guaranteed satisfaction & time on delivery in every assignment order you paid with us! We ensure premium quality solution document along with free turntin report!

All rights reserved! Copyrights ©2019-2020 ExpertsMind IT Educational Pvt Ltd