If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

 
Go Back  dBforums > General > Database Concepts & Design > need help!

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old
Registered User
 
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.
Reply With Quote
  #2 (permalink)  
Old
Registered User
 
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.
Reply With Quote
  #3 (permalink)  
Old
Registered User
 
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.
Reply With Quote
  #4 (permalink)  
Old
Registered User
 
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.
Reply With Quote
  #5 (permalink)  
Old
Registered User
 
Join Date: Oct 2012
Posts: 5
thank you.
Reply With Quote
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On