Preview

StudyModeUpload

Powerful Essays
Open Document
Open Document
2671 Words
Grammar
Grammar
Plagiarism
Plagiarism
Writing
Writing
Score
Score
StudyModeUpload
Homework Assignment #4

Problems #65 - #94 from page 311. Please provide your answer after each problem and submit the file with your answers through Blackboard.

EliteVideo is a startup company providing concierge DVD kiosk service in upscale neighborhoods. EliteVideo can own several copies (VIDEO) of each movie (MOVIE). For example, the store may have 10 copies of the movie “Twist in the Wind”. “Twist in the Wind” would be one MOVIE and each copy would be a VIDEO. A rental transaction (RENTAL) involves one or more videos being rented to a member (MEMBERSHIP). A video can be rented many times over its lifetime, therefore, there is a M:N relationship between RENTAL and VIDEO. DETAILRENTAL is the bridge table to resolve this relationship. The complete ERD is provided in Figure P7.65.
Figure P7.65 EliteVideo ERD

65. Write the SQL code to create the table structures for the entities shown in Figure P7.65. The structures should contain the attributes specified in the ERD. Use data types that would be appropriate for the data that will need to be stored in each attribute. Enforce primary key and foreign key constraints as indicated by the ERD.
CREATE TABLE PRICE ( PRICE_CODE INTEGER NOT NULL UNIQUE, PRICE_DESCRIPTION CHAR(15) NOT NULL, PRICE_RENTFEE VARCHAR(3) NOT NULL, PRICE_DAILYLATEFEE VARCHAR(3) NOT NULL, PRIMARY KEY (PRICE_CODE)); CREATE TABLE MOVIE ( MOVIE_NUM INTEGER NOT NULL UNIQUE, MOVIE_TITLE VARCHAR(35) NOT NULL, MOVIE_YEAR INTEGER NOT NULL, MOVIE_COST NUMBER NOT NULL, MOVIE_GENRE CHAR(6) NOT NULL, PRICE_CODE INTEGER, PRIMARY KEY (MOVIE_NUM), FOREIGN KEY (PRICE_CODE)); CREATE TABLE VIDEO ( VID_NUM INTEGER NOT NULL UNIQUE, VID_INDATE DATE NOT NULL, MOVIE_NUM INTEGER NOT NULL, PRIMARY KEY (VID_NUM), FOREIGN KEY (MOVIE_NUM));

CREATE TABLE DETAILRENTAL ( RENT_NUM INTEGER NOT NULL,

You May Also Find These Documents Helpful

  • Satisfactory Essays

    Ch. 9: Continuing Problems 1–6, found at the beginning of the Problems section at the end of the chapter. For this assignment, use the CAFR your team selected in Week Two.…

    • 471 Words
    • 2 Pages
    Satisfactory Essays
  • Satisfactory Essays

    This paperwork ACC 455 Week 2 Individual Assignment Problem Set includes solution of these exercises:…

    • 449 Words
    • 3 Pages
    Satisfactory Essays
  • Satisfactory Essays

    3. (2 pts) Draw the ERD for the following scenario. Include all the attributes. Note that one of your tables will have a composite identifier.…

    • 298 Words
    • 2 Pages
    Satisfactory Essays
  • Good Essays

    Mat 222 week 2 paper

    • 735 Words
    • 3 Pages

    The problem I am going to work on is #68 on page 539 . The…

    • 735 Words
    • 3 Pages
    Good Essays
  • Satisfactory Essays

    CRJ 201 Week 5 Final Exam

    • 667 Words
    • 3 Pages

    This document of CRJ 201 Week 5 Final Exam shows the solutions to the following problems:…

    • 667 Words
    • 3 Pages
    Satisfactory Essays
  • Satisfactory Essays

    03

    • 4187 Words
    • 33 Pages

    If the CREATE TABLE is being used to create a table from existing data, the SUBQUERY keyword must be used.…

    • 4187 Words
    • 33 Pages
    Satisfactory Essays
  • Satisfactory Essays

    My Team Portion

    • 436 Words
    • 2 Pages

    The most important step when creating a database are detecting the table elements. While analyzing the form entitled “Entities and Attributes for Fleet Truck Maintenance,” the database table elements can be clearly determined. The structure of a database can be defined based on the Entities and Attributes within a table or a relation. Entities may be used to allow the same rule to be applied multiple times to make a determination ("Define an Entity", n.d.). An attribute basically describes what the entity is. The entity-relationship model (or ER model) is a way of graphically representing the logical relationships of entities (or objects) in order to create a database. The ER model was first proposed by Peter Pin-Shan Chen of Massachusetts Institute of Technology (MIT) in the 1970s (TechTarget, 2005-2015).…

    • 436 Words
    • 2 Pages
    Satisfactory Essays
  • Powerful Essays

    Tutorial of Visio

    • 1749 Words
    • 7 Pages

    Microsoft Visio 2010 is a flexible software tool that allows users to create some diagrams and charts, providing an alternative to using traditional drawing software such as MS Paint. Entity – Relationship diagrams (ERDs) provides a more visual way to represent the design of database tables and the relationships between them. The most popular notation used in textbooks is the Crow’s Foot notation that makes identifying those relationships much easier.…

    • 1749 Words
    • 7 Pages
    Powerful Essays
  • Satisfactory Essays

    Sql Cheat Sheet

    • 594 Words
    • 3 Pages

    * For example, the following SQL creates a new table called CUSTOMERS and adds five columns, three of which, ID and NAME and AGE, specify not to accept NULLs:…

    • 594 Words
    • 3 Pages
    Satisfactory Essays
  • Satisfactory Essays

    BSHS 355 Week 3 DQ 2

    • 413 Words
    • 2 Pages

    Complete the Problem 1-3B on page 37, 1-4B on page 37 (Chapter 1) and Problem 2-7B on page 89 (Chapter 2) of your text. Please show your work.…

    • 413 Words
    • 2 Pages
    Satisfactory Essays
  • Satisfactory Essays

    Complete the following problems from Ch. 1 of the text. Be sure to show your work for each problem.…

    • 403 Words
    • 2 Pages
    Satisfactory Essays
  • Satisfactory Essays

    ACC 440 Week 3 DQs

    • 472 Words
    • 3 Pages

    This paperwork of ACC 440 Week 3 Discussion Questions shows the solutions to the following problems:…

    • 472 Words
    • 3 Pages
    Satisfactory Essays
  • Satisfactory Essays

    MGMT 54400 Fall 2013 Relational Schema 1. CUSTOMER (C_Name, C_Phone, Dr_Lic_No, C_Street, C_City, C_State, C_Zip) 2. CAR (Vehicle_ID, Lic_Plate_No, Make, Model, Price, Mileage, Car_Type, D_Name) FK D_Name  DEALER 3. COMPACT_CAR (C_Vehicle_ID, No_of_Doors) FK C_Vehicle_ID…

    • 182 Words
    • 2 Pages
    Satisfactory Essays
  • Satisfactory Essays

    **Use the 2nd table; look at the one with a composite primary key (two primary keys)…

    • 473 Words
    • 2 Pages
    Satisfactory Essays
  • Satisfactory Essays

    Hotel Assignment

    • 732 Words
    • 3 Pages

    For this assignment, draw a detailed ER diagram using UML notation. Write all attributes in the ERD using the format -> attribute: type. Make reasonable assumptions about data types. For the Registration table, explain all constraints that are necessary on the table.…

    • 732 Words
    • 3 Pages
    Satisfactory Essays