Hello!
Since my video rental database is in Slovene I'm affraid I can't post an example so I'll try to translate the tables involved and post some questions. Hopefully I'll make sense, keep in mind I'm a beginner.
tblMember:
MemberID (PK)
Fname
Lname
etc.
tblRental:
RentalID (PK)
MemberID
DateRented
tblMovie:
MovieID (PK)
Title
etc.
tblCopy:
CopyID (PK) (autonumber type used instead of a composite key of MovieID and Copy)
MovieID
Copy
Rented (flag)
To explain the above table, let's say my rental shop holds three copies of Citizen Kane (MovieID=100), which takes three records in the tblCopy table:
...
CopyID MovieID Copy
...
34 100 1
35 100 2
36 100 3
...
tblCopyRental:
CopyID (PK)
RentalID (PK)
DateReturned (not in tblRental as movies from a particular rental could be returned at different dates)
I'd like to be able to assign to a rental only copies of movies currently available. So I created a query (in design view, mind you) that lists currently available movies:
SELECT tblCopy.CopyID, tblMovie.MovieID, tblMovie.Title, tblCopy.Copy
FROM tblMovie INNER JOIN tblCopy ON tblMovie.MovieID=tblCopy.MovieID
WHERE (((tblCopy.Rented)=False))
GROUP BY tblCopy.CopyID, tblMovie.MovieID, tblMovie.Title, tblCopy.Copy
ORDER BY tblMovie.Title
I actually created the Rented flag for this purpose. At the mom I have to manually check copies that are rented.
What I want to know, is something like Rented flag in tblCopy neccessary? Couldn't this be achieved somehow by only excluding copies from tblCopyRental where DateReturned doesn't yet exist from all the copies rental shop holds (listed in tblCopy)? I mean the way I see it all data is there to figure out which movies are available.
If Rented flag is a good idea, is it possible to have it automatically change status when available copies are assigned to a rental, and then back when DateReturned is entered?
Thanks for your help.
Since my video rental database is in Slovene I'm affraid I can't post an example so I'll try to translate the tables involved and post some questions. Hopefully I'll make sense, keep in mind I'm a beginner.
tblMember:
MemberID (PK)
Fname
Lname
etc.
tblRental:
RentalID (PK)
MemberID
DateRented
tblMovie:
MovieID (PK)
Title
etc.
tblCopy:
CopyID (PK) (autonumber type used instead of a composite key of MovieID and Copy)
MovieID
Copy
Rented (flag)
To explain the above table, let's say my rental shop holds three copies of Citizen Kane (MovieID=100), which takes three records in the tblCopy table:
...
CopyID MovieID Copy
...
34 100 1
35 100 2
36 100 3
...
tblCopyRental:
CopyID (PK)
RentalID (PK)
DateReturned (not in tblRental as movies from a particular rental could be returned at different dates)
I'd like to be able to assign to a rental only copies of movies currently available. So I created a query (in design view, mind you) that lists currently available movies:
SELECT tblCopy.CopyID, tblMovie.MovieID, tblMovie.Title, tblCopy.Copy
FROM tblMovie INNER JOIN tblCopy ON tblMovie.MovieID=tblCopy.MovieID
WHERE (((tblCopy.Rented)=False))
GROUP BY tblCopy.CopyID, tblMovie.MovieID, tblMovie.Title, tblCopy.Copy
ORDER BY tblMovie.Title
I actually created the Rented flag for this purpose. At the mom I have to manually check copies that are rented.
What I want to know, is something like Rented flag in tblCopy neccessary? Couldn't this be achieved somehow by only excluding copies from tblCopyRental where DateReturned doesn't yet exist from all the copies rental shop holds (listed in tblCopy)? I mean the way I see it all data is there to figure out which movies are available.
If Rented flag is a good idea, is it possible to have it automatically change status when available copies are assigned to a rental, and then back when DateReturned is entered?
Thanks for your help.