Explain the role of primary and foreign keys in databases

Assignment Help Database Management System
Reference no: EM131258013

Database Systems for Website Applications Assignment:

In this assignment, you will review the below schema then answer the three questions listed afterwards.

Assume and review the following Internet movie database schema:

Database:

Table: movie
id - int, primary key

title - char

year - int

rating - float
Table: person
id - int, primary key

name - char

sex - char

age - int
Table: role
personid - foreign key references person - int

movieid - foreign key references movie -- int

character - char

Based on your review of the Internet movie database schema above, respond to the following:

• Explain the role of primary and foreign keys in databases. Explain why we need them and whether we can extract information from tables without having primary or foreign keys.

• Write and execute a SQL for each of the following scenarios:

o An SQL with a nested subquery.
o A select query that uses GROUP BY
o A select query that uses ORDER BY
o A select query that uses Inner JOIN
o A select query that uses an Outer JOIN
o A select query that uses UNION
o A select query that uses EXCEPT

• Make sure you give a screenshot of the output from executing your queries.

Reference no: EM131258013

Questions Cloud

How should the truck be routed to minimize total breakage : How should the truck be routed to minimize the total breakage? How would you formulate this problem as a shortest path problem.
What is the total weight : Six items purchased at a grocery store weigh 17 kilograms. One of the items is detergent weighing 925 grams. What is the total weight, in kilograms, of the other five items?
Distinguish between effective capacity and actual output : Distinguish between effective capacity and actual output ? Explain why doubling the capacity of a bottleneck may not double the system capacity.
Nonlinear system of equations : Give all solutions of each nonlinear system of equations, including those nonreal complex components. -5xy+2=0 x-15y=5
Explain the role of primary and foreign keys in databases : Explain the role of primary and foreign keys in databases. Explain why we need them and whether we can extract information from tables without having primary or foreign keys.
What is the total weight : Six items purchased at a grocery store weigh 14 kilograms. One of the items is detergent weighing 805 grams. What is the total weight, in kilograms, of the other five items?
Determine what you think would be a common complaint : According to the material in Chapter 9, most employee complaints related to performance evaluations are based on alleged violations of employment law. Determine what you think would be a common complaint that could have legal consequences. Propose..
Find the population density of the country : a. Find the population density of the country, to the nearest tenth, in 1900 and in 1980. b. Find the percent increase in population density, to the nearest tenth of a percent, from 1900 to 1980.
What funding supports most agencies serving this population : What do you believe a typical day might look like in this position? What funding supports most agencies serving this population? What resources are available to clients, as well as those serving this population? What is your conclusion regarding jo..

Reviews

Write a Review

Database Management System Questions & Answers

  Discuss likely data integrity constraints on attributes

Write an SQL query to find out how many Computer Science departments are not in Victoria. Return the number -  Discuss likely data integrity constraints on attributes and specify all candidate keys and the primary key for each relation based on the..

  Write the sql ddl to create the database

The appropriate SQL commands, which should be copied from your source code in MySQL, and pasted into your submission file; and The resultant tables, which must be screenshots to show the change due to the execution of commands

  Describe the six default referential integrity actions.

How are N:M relationships implemented?

  What are functional dependencies

Multi-level index is guaranteed to have the search cost proportional to the number of levels inmulti-level index.

  Create spreadsheet that contains three separate data sets

Identify your dream vehicle (plane, automobile, boat, etc.) and estimate its cost and the interest rate if you financed its purchase. Enter data (loan amount, interest rate, term, etc.) onto spreadsheet and use the PMT function and cell references..

  Designing and documenting your system

Create a document named: surnameStudentIDAssign1.doc .  In your document, you must include the following section headings:  System Overview, Class Diagram, Class Descriptions, Testing.

  Which region accounted for the most expenditures

Which age bracket accounted for the MOST expenditures in 2013-2014? ?Which region accounted for the MOST expenditures in 2013-2014?? Highlight the age bracket in BLUE and the region in RED on your sheet.

  Sketch object-oriented model for private airport database

Sketch an object-oriented model for a small private airport database that is used to keep track of airplanes, their owners, airport employees, and pilots.

  Draw inheritance hierarchy to represent shoe object

Draw an inheritance hierarchy to represent a shoe object. The base class should have derived classes of Dress Shoes, Tennis Shoes and Boots.

  The packing list describes the ideal contents

The packing list describes the ideal contents of each package, but it is not always possible to include the ideal number of each item. Therefore, the actual items included in each package should be tracked. A package can contain many different ite..

  Describe a general company security policy for database

Describe a general company security policy for the database "layer" of security only (avoid getting into network security protocols or application level security for this exercise, and assume that there are security mechanisms in place that allow ..

  Explain the different oracle data dictionary views

Explain the different Oracle data dictionary views

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