473,614 Members | 2,268 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Database design/ query question

Lets say i have a database where users can upload their dvd collection.
I want to be able to do a query where i can select all the users who
have a certain DVD. Can someone point me in the right direction as how
to optimally do this?

Aug 6 '06 #1
3 2709
On Sun, 06 Aug 2006 07:24:08 -0700, ryan wrote:
Lets say i have a database where users can upload their dvd collection.
I want to be able to do a query where i can select all the users who
have a certain DVD. Can someone point me in the right direction as how
to optimally do this?
Why not:

SELECT user-name FROM dvd-table WHERE dvd-name = <search value>.

Based on the nature of your question I believe you are a "newbie" and I
suggest that you do some research about Relational Database Management
Systems. A good place to start is to ask the instructor at one of the
local colleges the name of the text they use for their basic database
management course.

If your local college doesn't offer such a course you can use the book I
used when I taught this course last year. Database Systems: Design,
Implementation, & Management by Peter Rob and Carlos Coronel. The
publisher is Thomson Course Technology. If you can't find it locally
it is available from Amazon.

HTH
Jerry

Aug 6 '06 #2
Maybe i didnt state my question clear enough. This is a hypothetical
situation, but what if i had thousands of users? Would i be forced to
store the user IDs of each person who owns that DVD in each DVD row?
This doesnt seem practical to me. I want the DVD table to act as a
library with length, year, etc, and i dont want users to be included in
it.

Aug 6 '06 #3
On Sun, 06 Aug 2006 14:45:13 -0700, ryan wrote:
Maybe i didnt state my question clear enough. This is a hypothetical
situation, but what if i had thousands of users? Would i be forced to
store the user IDs of each person who owns that DVD in each DVD row?
This doesnt seem practical to me. I want the DVD table to act as a
library with length, year, etc, and i dont want users to be included in
it.
Ah!

What you need is a third table. The table will consist of one row for
each DVD owned by each user. Each row will contain two columns, the first
being the primary key from the user table and the second being the primary
key from the DVD table. So if user a has 10 DVDs there will be 10 rows
for user x in this table.

You can wind up with a lot of rows in this table, but each row doesn't
take up very much space and, these days, disk space is very inexpensive.
HTH
Jerry
Aug 6 '06 #4

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

0
1512
by: Lefevre, Steven | last post by:
Hey folks - Thanks to everyone who gave input to my concerns. Of course, we don't intend to have the mysql port open to the world. We will have Apache/PHP connect on a unix socket, or to another machine with a cross-cable on non-routeable IPs. But now I have another question. We are working on a web database to allow our suppliers to log on and submit information that they would otherwise fax, email, or phone to us. It would reduce...
7
2286
by: Foxster | last post by:
in access i have two tables (tblplayer, tblpoints) in tblplayer i have field totalpoint (number) in tlbpoints i have field pointgame (number) the two files are related via idplayer now i made a query "qrybegan" and in that query i calculate a field sumpointgame which is the sum of all the field pointgame (option sum in the query) i have put in the query also the field totalpoint from the tblplayer now i want to put the sumpointgame in...
7
2707
by: Danny J. Lesandrini | last post by:
I know this has been discussed before, as I've seen the Google posts, but they all leave me with an unanswered question: Does my DAO code executed in the front end cause the back end to bloat? (May also substitute UPDATE and/or DELETE queries for DAO code.) I was just brought on to a project with Access 97 where the all data is kept on the server. It doubles in size each day, from 80 mb to 160 mb. The data file contains only tables...
6
1523
by: Noozer | last post by:
I'm developing a database using MS Access and have come across a problem. The majority of my database is pretty straightforward "many to one" relationships. I have one relationship that is backwards though... This is probably easier to diagram than to describe... Countries -M to1-> Provinces - M to 1-> Cities <-M to 1- Call Centres With the above relationships I am having trouble implementing a simple data entry interface. Basically...
5
1998
by: William Wisnieski | last post by:
Hello Everyone, I'm really stuck on how to design this application, so I thought I'd see if anyone had any general ideas on how to proceed. I'd say I'm an intermediate level Access developer. I volunteered to help my kid's school (a small non-profit) with a tremendous need they have for a complete student administration database. I've developed fairly complex databases before but this one is very unique in how it must be designed.
4
2067
by: Smriti Dev | last post by:
Hi There, I'm creating a MS ACCESS database using Ms Access 2000 to store Interpretation requests by different departments in a hospital and Interpreter availability. All internal departments will be calling in or faxing their Interpretation requests to Intake staff at the Interpretation department and the intake staff will feed the request into the database. However, their is one department, Rehab, that is going to be going to be able...
29
3560
by: MP | last post by:
Greets, context: vb6/ado/.mdb/jet 4.0 (no access)/sql beginning learner, first database, planning stages (I think the underlying question here is whether to normalize or not to normalize this one data field - but i'm not sure) :-) Background info:
10
7687
by: Jim Devenish | last post by:
I have a split front end/back end system. However I create a number of local tables to carry out certain operations. There is a tendency for the front end to bloat so I have set 'compact on close' I think that I have read in some threads (althoug I cannot find them now) that others place such tables in a local, linked database. I could do this but I am interested to know what would be the advantages. And disadvantages, if any. Any...
12
6993
by: nyathancha | last post by:
Hi, I have a question regarding best practices in database design. In a relational database, is it wise/necessary to sometimes create tables that are not related to other tables through a foreign Key relationship or does this always indicate some sort of underlying design flaw. Something that requires a re evaluation of the problem domain? The reason I ask is because in our application, the user can perform x
1
8275
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
8429
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
7091
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
6088
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
4050
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
4121
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
2566
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
1
1745
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
0
1423
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.