Connecting Tech Pros Worldwide Forums | Help | Site Map

Help With Database Solution

Stephen
Guest
 
Posts: n/a
#1: Aug 4 '06
I volunteer for a non-for profit group and they have alot of names in a
multiple databases. the problem is that some people are in multiple
databases. and if they send out a mailing from multiple databases some
people get 2 and 3 of the same thing. my idea was to either make or find a
program that has everyone is 1 database and then make the people part of
multiple groups. (ex: bill is part of group a and b and im doing a mailing
from both group i only want 1 piece of mail to go to him).

It can be a separate program or with access. that use access now but i cant
figure out how to make my idea work.

any question please ask.
tia
Stephen



strawberry
Guest
 
Posts: n/a
#2: Aug 4 '06

re: Help With Database Solution



Stephen wrote:
Quote:
I volunteer for a non-for profit group and they have alot of names in a
multiple databases. the problem is that some people are in multiple
databases. and if they send out a mailing from multiple databases some
people get 2 and 3 of the same thing. my idea was to either make or find a
program that has everyone is 1 database and then make the people part of
multiple groups. (ex: bill is part of group a and b and im doing a mailing
from both group i only want 1 piece of mail to go to him).
>
It can be a separate program or with access. that use access now but i cant
figure out how to make my idea work.
>
any question please ask.
tia
Stephen
First off you should only have ONE database!!!

Within that database there should be 3 tables:

contacts(contact_id,f_name,l_name,street1,street2, email1address,etc,etc)
groups(group_id,group_name,group_description)
groups_contacts(group_id,contact_id)

Your query would then look like this (untested)

SELECT DISTINCT(gc.contact_id),c.*
FROM group_contacts AS gc
LEFT JOIN contacts c ON c.contact_id = gc.contact_id;

strawberry
Guest
 
Posts: n/a
#3: Aug 4 '06

re: Help With Database Solution



strawberry wrote:
Quote:
Stephen wrote:
Quote:
I volunteer for a non-for profit group and they have alot of names in a
multiple databases. the problem is that some people are in multiple
databases. and if they send out a mailing from multiple databases some
people get 2 and 3 of the same thing. my idea was to either make or find a
program that has everyone is 1 database and then make the people part of
multiple groups. (ex: bill is part of group a and b and im doing a mailing
from both group i only want 1 piece of mail to go to him).

It can be a separate program or with access. that use access now but i cant
figure out how to make my idea work.

any question please ask.
tia
Stephen
>
First off you should only have ONE database!!!
>
Within that database there should be 3 tables:
>
contacts(contact_id,f_name,l_name,street1,street2, email1address,etc,etc)
groups(group_id,group_name,group_description)
groups_contacts(group_id,contact_id)
>
Your query would then look like this (untested)
>
SELECT DISTINCT(gc.contact_id),c.*
FROM group_contacts AS gc
LEFT JOIN contacts c ON c.contact_id = gc.contact_id;
Oops, that query should be like this (again untested):

SELECT DISTINCT(gc.contact_id),c.*
FROM group_contacts AS gc
LEFT JOIN contacts c ON c.contact_id = gc.contact_id
WHERE gc.group_id = 1
OR gc.group_id = 2;

strawberry
Guest
 
Posts: n/a
#4: Aug 4 '06

re: Help With Database Solution


strawberry wrote:
Quote:
Stephen wrote:
Quote:
I volunteer for a non-for profit group and they have alot of names in a
multiple databases. the problem is that some people are in multiple
databases. and if they send out a mailing from multiple databases some
people get 2 and 3 of the same thing. my idea was to either make or find a
program that has everyone is 1 database and then make the people part of
multiple groups. (ex: bill is part of group a and b and im doing a mailing
from both group i only want 1 piece of mail to go to him).

It can be a separate program or with access. that use access now but i cant
figure out how to make my idea work.

any question please ask.
tia
Stephen
>
First off you should only have ONE database!!!
>
Within that database there should be 3 tables:
>
contacts(contact_id,f_name,l_name,street1,street2, email1address,etc,etc)
groups(group_id,group_name,group_description)
groups_contacts(group_id,contact_id)
>
Your query would then look like this (untested)
>
SELECT DISTINCT(gc.contact_id),c.*
FROM group_contacts AS gc
LEFT JOIN contacts c ON c.contact_id = gc.contact_id;
Oops, that query should be like this (again untested):

SELECT DISTINCT(gc.contact_id),c.*
FROM group_contacts AS gc
LEFT JOIN contacts c ON c.contact_id = gc.contact_id
WHERE gc.group_id = 1
OR gc.group_id = 2;

Stephen
Guest
 
Posts: n/a
#5: Aug 4 '06

re: Help With Database Solution


yopu say 3 tables...contacts is the table and the stuff in the () is the
fiels names?


"strawberry" <zac.carey@gmail.comwrote in message
news:1154692262.802400.120910@h48g2000cwc.googlegr oups.com...
Quote:
strawberry wrote:
Quote:
>Stephen wrote:
Quote:
I volunteer for a non-for profit group and they have alot of names in a
multiple databases. the problem is that some people are in multiple
databases. and if they send out a mailing from multiple databases some
people get 2 and 3 of the same thing. my idea was to either make or
find a
program that has everyone is 1 database and then make the people part
of
multiple groups. (ex: bill is part of group a and b and im doing a
mailing
from both group i only want 1 piece of mail to go to him).
>
It can be a separate program or with access. that use access now but i
cant
figure out how to make my idea work.
>
any question please ask.
tia
Stephen
>>
>First off you should only have ONE database!!!
>>
>Within that database there should be 3 tables:
>>
>contacts(contact_id,f_name,l_name,street1,street2 ,email1address,etc,etc)
>groups(group_id,group_name,group_description)
>groups_contacts(group_id,contact_id)
>>
>Your query would then look like this (untested)
>>
>SELECT DISTINCT(gc.contact_id),c.*
>FROM group_contacts AS gc
>LEFT JOIN contacts c ON c.contact_id = gc.contact_id;
>
Oops, that query should be like this (again untested):
>
SELECT DISTINCT(gc.contact_id),c.*
FROM group_contacts AS gc
LEFT JOIN contacts c ON c.contact_id = gc.contact_id
WHERE gc.group_id = 1
OR gc.group_id = 2;
>

strawberry
Guest
 
Posts: n/a
#6: Aug 4 '06

re: Help With Database Solution



Stephen wrote:
Quote:
yopu say 3 tables...contacts is the table and the stuff in the () is the
fiels names?
>
>
"strawberry" <zac.carey@gmail.comwrote in message
news:1154692262.802400.120910@h48g2000cwc.googlegr oups.com...
Quote:
strawberry wrote:
Quote:
Stephen wrote:
I volunteer for a non-for profit group and they have alot of names in a
multiple databases. the problem is that some people are in multiple
databases. and if they send out a mailing from multiple databases some
people get 2 and 3 of the same thing. my idea was to either make or
find a
program that has everyone is 1 database and then make the people part
of
multiple groups. (ex: bill is part of group a and b and im doing a
mailing
from both group i only want 1 piece of mail to go to him).

It can be a separate program or with access. that use access now but i
cant
figure out how to make my idea work.

any question please ask.
tia
Stephen
>
First off you should only have ONE database!!!
>
Within that database there should be 3 tables:
>
contacts(contact_id,f_name,l_name,street1,street2, email1address,etc,etc)
groups(group_id,group_name,group_description)
groups_contacts(group_id,contact_id)
>
Your query would then look like this (untested)
>
SELECT DISTINCT(gc.contact_id),c.*
FROM group_contacts AS gc
LEFT JOIN contacts c ON c.contact_id = gc.contact_id;
Oops, that query should be like this (again untested):

SELECT DISTINCT(gc.contact_id),c.*
FROM group_contacts AS gc
LEFT JOIN contacts c ON c.contact_id = gc.contact_id
WHERE gc.group_id = 1
OR gc.group_id = 2;
yes, that's right

Stephen
Guest
 
Posts: n/a
#7: Aug 4 '06

re: Help With Database Solution


another uestion. i know there is a way to make drop downs so that can only
pick a certian item...they only use like 5 or 10 sgroups how do i make the
drop down so it can be selected
"strawberry" <zac.carey@gmail.comwrote in message
news:1154692686.988284.223750@s13g2000cwa.googlegr oups.com...
Quote:
>
Stephen wrote:
Quote:
>yopu say 3 tables...contacts is the table and the stuff in the () is the
>fiels names?
>>
>>
>"strawberry" <zac.carey@gmail.comwrote in message
>news:1154692262.802400.120910@h48g2000cwc.googleg roups.com...
Quote:
strawberry wrote:
>Stephen wrote:
I volunteer for a non-for profit group and they have alot of names
in a
multiple databases. the problem is that some people are in multiple
databases. and if they send out a mailing from multiple databases
some
people get 2 and 3 of the same thing. my idea was to either make or
find a
program that has everyone is 1 database and then make the people
part
of
multiple groups. (ex: bill is part of group a and b and im doing a
mailing
from both group i only want 1 piece of mail to go to him).
>
It can be a separate program or with access. that use access now but
i
cant
figure out how to make my idea work.
>
any question please ask.
tia
Stephen
>>
>First off you should only have ONE database!!!
>>
>Within that database there should be 3 tables:
>>
>contacts(contact_id,f_name,l_name,street1,street2 ,email1address,etc,etc)
>groups(group_id,group_name,group_description)
>groups_contacts(group_id,contact_id)
>>
>Your query would then look like this (untested)
>>
>SELECT DISTINCT(gc.contact_id),c.*
>FROM group_contacts AS gc
>LEFT JOIN contacts c ON c.contact_id = gc.contact_id;
>
Oops, that query should be like this (again untested):
>
SELECT DISTINCT(gc.contact_id),c.*
FROM group_contacts AS gc
LEFT JOIN contacts c ON c.contact_id = gc.contact_id
WHERE gc.group_id = 1
OR gc.group_id = 2;
>
>
yes, that's right
>

Stephen
Guest
 
Posts: n/a
#8: Aug 4 '06

re: Help With Database Solution


and do i need a primary key
"strawberry" <zac.carey@gmail.comwrote in message
news:1154692686.988284.223750@s13g2000cwa.googlegr oups.com...
Quote:
>
Stephen wrote:
Quote:
>yopu say 3 tables...contacts is the table and the stuff in the () is the
>fiels names?
>>
>>
>"strawberry" <zac.carey@gmail.comwrote in message
>news:1154692262.802400.120910@h48g2000cwc.googleg roups.com...
Quote:
strawberry wrote:
>Stephen wrote:
I volunteer for a non-for profit group and they have alot of names
in a
multiple databases. the problem is that some people are in multiple
databases. and if they send out a mailing from multiple databases
some
people get 2 and 3 of the same thing. my idea was to either make or
find a
program that has everyone is 1 database and then make the people
part
of
multiple groups. (ex: bill is part of group a and b and im doing a
mailing
from both group i only want 1 piece of mail to go to him).
>
It can be a separate program or with access. that use access now but
i
cant
figure out how to make my idea work.
>
any question please ask.
tia
Stephen
>>
>First off you should only have ONE database!!!
>>
>Within that database there should be 3 tables:
>>
>contacts(contact_id,f_name,l_name,street1,street2 ,email1address,etc,etc)
>groups(group_id,group_name,group_description)
>groups_contacts(group_id,contact_id)
>>
>Your query would then look like this (untested)
>>
>SELECT DISTINCT(gc.contact_id),c.*
>FROM group_contacts AS gc
>LEFT JOIN contacts c ON c.contact_id = gc.contact_id;
>
Oops, that query should be like this (again untested):
>
SELECT DISTINCT(gc.contact_id),c.*
FROM group_contacts AS gc
LEFT JOIN contacts c ON c.contact_id = gc.contact_id
WHERE gc.group_id = 1
OR gc.group_id = 2;
>
>
yes, that's right
>

strawberry
Guest
 
Posts: n/a
#9: Aug 4 '06

re: Help With Database Solution



Stephen wrote:
Quote:
and do i need a primary key
contacts(contact_id*,f_name,l_name,street1,street2 ,email1address,etc,etc)
groups(group_id*,group_name,group_description)
groups_contacts(group_id*,contact_id*)

* = Primary Key

Note that the Primary Key for the groups_contacts table is a
combination of both the group_id and the contact_id

strawberry
Guest
 
Posts: n/a
#10: Aug 4 '06

re: Help With Database Solution



Stephen wrote:
Quote:
another uestion. i know there is a way to make drop downs so that can only
pick a certian item...they only use like 5 or 10 sgroups how do i make the
drop down so it can be selected
This sounds like an access question. Sorry, I don't anything about
access!

Stephen
Guest
 
Posts: n/a
#11: Aug 4 '06

re: Help With Database Solution


ok ty
"strawberry" <zac.carey@gmail.comwrote in message
news:1154693205.586597.207140@h48g2000cwc.googlegr oups.com...
Quote:
>
Stephen wrote:
Quote:
>and do i need a primary key
>
contacts(contact_id*,f_name,l_name,street1,street2 ,email1address,etc,etc)
groups(group_id*,group_name,group_description)
groups_contacts(group_id*,contact_id*)
>
* = Primary Key
>
Note that the Primary Key for the groups_contacts table is a
combination of both the group_id and the contact_id
>

Closed Thread


Similar MySQL Database bytes