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

  How database systems support enterprise and web-based app

Summarize the difference between on-line transaction processing (OLTP) and online analytic processing (OLAP), and their relationship among business intelligence, data warehousing and data mining.

  Fresh-mart grocery is a regional grocery chain that is

fresh-mart grocery is a regional grocery chain that is developing an information system to monitor inventory levels

  Design a case for other student to investigate

You need to design a CASE for other student to investigate. As an example; at the end of this week you should generate the following materials: A case description.

  Why would you choose a database system instead of simply

Why would you choose a database system instead of simply storing data in operating system files? When would it make sense not to use a database system?

  Create a database design specification

Create a database design specification (Enhanced Entity Relationship Diagram (EERD) and Relational Data Model (RDM)) from the given business description. The RDM must be in 3rd Normal Form.

  Use embedded sql and c or any programming language

Convert the example of GEOMETRY_OBJECTS given in section 11.1.5 from the functional notation to the notation given in Figure 11.2 that distinguishes between attributes and operations. Use the keyword INHERIT to show that one class inherits from an..

  Explain what is the purpose of database

Explain what is the purpose of Database? The purpose of a database is to store information about certain types of objects. Give an example of two related TABLES.

  How to use spool command

How to interactively query a database by using SQL statements and SQL*PLUS commands and how to use spool command to save an interactive session within SQL*PLUS.

  You must have at least these entities region factory

you must have at least these entities region factory employee department training class. you should use the attributes

  Design a database schema1 patient-patientid name dob2

design a database schema1 patient-patientid name dob2 doctor-doctorid name medlicensenumber phone3

  Create mock-up report to make the monthly claim

He wishes you to group data by insurance company number, with subtotals by company and grand totals for each numeric field.

  Write the application for university admissions office

Write the application for university admissions office. Prompt user for a student's High School Grade Point and an admission test score.

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