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

  Knowledge and data warehousing

Design a dimensional model for analysing Purchases for Adventure Works Cycles and implement it as cubes using SQL Server Analysis Services. The AdventureWorks OLTP sample database is the data source for you BI analysis.

  Design a database schema

Design a Database schema

  Entity-relationship diagram

Create an entity-relationship diagram and design accompanying table layout using sound relational modeling practices and concepts.

  Implement a database of courses and students for a school

Implement a database of courses and students for a school.

  Prepare the e-r diagram for the movie database

Energy in the home, personal energy use and home energy efficiency and Efficient use of ‘waste' heat and renewable heat sources

  Design relation schemas for the entire database

Design relation schemas for the entire database.

  Prepare the relational schema for database

Prepare the relational schema for database

  Data modeling and normalization

Data Modeling and Normalization

  Use cases perform a requirements analysis for the case study

Use Cases Perform a requirements analysis for the Case Study

  Knowledge and data warehousing

Knowledge and Data Warehousing

  Stack and queue data structure

Identify and explain the differences between a stack and a queue data structure

  Practice on topic of normalization

Practice on topic of Normalization

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