473,378 Members | 1,482 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,378 software developers and data experts.

Relationships and tables

I am creating a db for users in a company, each user uses different
programes (a choice of 5) some may use one and some may use many, each
program has different settings and in the db has a table of its own. a
user is identified by a unique username, tables so far

User_table
username*
name
email
phoneno etc

Prog1_table
auto_no*
username
settings

Prog2_table
auto_no*
username
settings

etc..

My q is should i have a join table? How should i make this a tidy db? I
want to be able to query on the number of programs a user uses. What
should my relationships be?

Cheers

Apr 24 '06 #1
2 1248
Hi,
First of all you shall create one table for all your program like that:

Programs_Table
program_num ** can be 1 to 5 or etc.
settings ** if this field is constant for all users and not relate to
any user in special so it will be in this table.

Another table:

Program_To_User:
username
program_num

You shall create the relationship like that:
User_Table->username to Program_To_user->username (many to many).
Programs_Table->program_num to Program_To_user->program_num (many to
many).

Hope I Helped, Haim Rubin.

Apr 24 '06 #2
Br
missboom wrote:
I am creating a db for users in a company, each user uses different
programes (a choice of 5) some may use one and some may use many, each
program has different settings and in the db has a table of its own. a
user is identified by a unique username, tables so far

User_table
username*
name
email
phoneno etc

Prog1_table
auto_no*
username
settings

Prog2_table
auto_no*
username
settings

etc..

My q is should i have a join table? How should i make this a tidy db?
I want to be able to query on the number of programs a user uses. What
should my relationships be?

Cheers


I suggest you do some research into database design. If your data is
properly normalised you'd similar data in the one table. Come from an Excel
background??? :)

eg.

Users
--------
UserID
Username

UserPrograms
--------------------
UserID
ProgramID
UserProgramSettings

Programs
--------------
ProgramID
ProgramName
ProgramDefaultSettings (could be useful?)

Hope that guides you a little in the right direction.
--
regards,

Br@dley
Apr 24 '06 #3

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

Similar topics

2
by: Megan | last post by:
hello everybody, i know this is a very long post, but i wanted to provide as much detail as possible. quick overview- i want to create a couple of many to many relationships and am wondering...
0
by: Megan | last post by:
Hi Everybody- I know that this is a really, really long post, but I wanted to try to give you as much background as possible. So here's a quick overview of the issues I'm asking for help with:...
2
by: Max | last post by:
Hi. I really hope someone can help me. Going slowly insane with this problem. I have a two Access 2000 databases. One is the backend containing tables and some admin queries. The other is the...
5
by: Mike Turco | last post by:
What is the difference between creating relationships in the front-end vs. the back-end database? I was trying to create a relationship in a database front-end and noticed that I could not check...
7
by: davegb | last post by:
I'm totally new to relational database design. My boss has asked me to create a database of information on the employees in our group. Seemed to me like a simple application to learn the ropes. A...
45
by: salad | last post by:
I'm curious about your opinion on setting relationships. When I designed my first app in Access I'd go to Tools/Relationships and set the relationships. Over time I'd go into the window and see...
1
by: Ron | last post by:
Hi All, I have relationships on a database built in the back end, but I'm wondering if that's where they should be. Can they be built in the front end but apply to all the back end tables? Can...
13
by: ARC | last post by:
Hello all, Prior to going live with my app, I have questions on relationships theory. My prior app was done in Access 97, and I did NOT use relationships at all. I have 65 tables in my...
2
by: Roger | last post by:
I've moved all my tables to sql server2005 and I've created the appropriate relationships now I create links to two such tables that have a relationship into ms- acess97 but when I add the two...
8
by: Phil Stanton | last post by:
I have a FE, BE database on my home computer and a duplicate on the office computer. Both use Ak2 on Windows XP. The one at home appears normal. The BE consists of about 50 tables with numerous...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...

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.