Results 1 to 5 of 5

Thread: need help!

  1. #1
    Join Date
    Oct 2012
    Posts
    5

    Wink need help!

    HELLO PEOPLE, is this database relation correct for a video rent database:


    table: partner
    Idpartner primary key.
    name
    lastname
    phone
    Email

    movies table
    movieid primary key
    name
    stock

    rent table
    rentid primary key
    idpartner
    movieid
    rentdate
    returned bit

    thanks for helping.

  2. #2
    Join Date
    Feb 2012
    Posts
    63
    One problem I see is that customers won't be able to just drop off returned videos, since rentals aren't uniquely identified by the disk or copy.

  3. #3
    Join Date
    Oct 2012
    Posts
    5
    What would you do in this case, I am somewhat confused since i am not very savvy in databases.

  4. #4
    Join Date
    Feb 2012
    Posts
    63
    Right now your Movies table just records the number of copies, and your Rent table records the customer's and movie's identities, not which copy they rented. To indicate that a movie was returned, you'd need the customer's id, which could be inconvenient in many cases.

    One way to do it is to number or label each physical copy of a movie, and include the copy number in the Rent table.

    A more thorough solution is to add another table - let's call it Copies. It would have at least its own identity, as well as the movie's identity, though you could later include other things like physical condition. In the rent table, record the copy's identity rather than the movie's. When a disk is returned, you could find the current rent record for that copy, e.g. by looking for the copyid in conjunction with a false returned bit, or based on the rentdate.

  5. #5
    Join Date
    Oct 2012
    Posts
    5
    thank you.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •