dbTalk Databases Forums  

Database cross-reference ?

comp.databases comp.databases


Discuss Database cross-reference ? in the comp.databases forum.



Reply
 
Thread Tools Display Modes
  #1  
Old   
AT
 
Posts: n/a

Default Database cross-reference ? - 05-13-2006 , 04:10 PM






Hi

I don't know if this is a good place to ask but I take my chances.

I have small project on my hands. I have two databases. One containing
data about people and their interests and the other one with where to
find information that could interest those people.

Now I need to write some kind of program probably in C++ or something
like that to cross-reference those two databases and send, let say,
emails to people that could be interested in that information.

It's the first time I'm doing the project like that so I'm
looking for any references to this kind of database programming or
anything that could help me.

Thank you very much.
Ralph


Reply With Quote
  #2  
Old   
Ed Prochak
 
Posts: n/a

Default Re: Database cross-reference ? - 05-14-2006 , 08:45 PM







rzajac (AT) gmail (DOT) com wrote:
Quote:
Hi

I don't know if this is a good place to ask but I take my chances.

I have small project on my hands. I have two databases. One containing
data about people and their interests and the other one with where to
find information that could interest those people.

Now I need to write some kind of program probably in C++ or something
like that to cross-reference those two databases and send, let say,
emails to people that could be interested in that information.

It's the first time I'm doing the project like that so I'm
looking for any references to this kind of database programming or
anything that could help me.

Thank you very much.
Ralph
I don't have any specific solution for you, but I would suggest it
would be easier if all the information was in one database. Then you
could use the power of SQL to make the connections. Otherwise you are
going to replicate a lot of the query functionality in your application
program.

Ed.



Reply With Quote
  #3  
Old   
Bill Karwin
 
Posts: n/a

Default Re: Database cross-reference ? - 05-14-2006 , 10:38 PM



Ed Prochak wrote:
Quote:
rzajac (AT) gmail (DOT) com wrote:
Now I need to write some kind of program probably in C++ or something
like that to cross-reference those two databases and send, let say,
emails to people that could be interested in that information.

I don't have any specific solution for you, but I would suggest it
would be easier if all the information was in one database. Then you
could use the power of SQL ...
For what it's worth, some RDBMS implementations (e.g. MySQL) can do
cross-database queries in SQL. Though many RDBMS implementations do not
support this.

The syntax is simply to use databasename.tablename where you would use
tablename. For example:

SELECT a.*, b.*
FROM database1.table_a AS a
JOIN database2.table_b AS b ON a.col1 = b.col2

This is supported only if the two databases reside on the same server.

Regards,
Bill K.


Reply With Quote
  #4  
Old   
AT
 
Posts: n/a

Default Re: Database cross-reference ? - 05-15-2006 , 02:46 AM



So it is possible to cross reference data from two databases just using
SQL queries?

Do you know where can I find some examples of this kind of query and
database designs? (books, Internet, ...)

Once again I'll say that my goal will be to find potentially
interesting information for people based on many levels of comparison.
The closest analogy would be dating sites sending emails about
potential matches based on profiles with selected requirements.

Thank you for your help.
Ralph


Reply With Quote
  #5  
Old   
Bill Karwin
 
Posts: n/a

Default Re: Database cross-reference ? - 05-15-2006 , 01:50 PM



rzajac (AT) gmail (DOT) com wrote:
Quote:
So it is possible to cross reference data from two databases just using
SQL queries?
Like I said, it depends on the RDBMS software implementation you are
using. Are you using MySQL? That's the only one I know supports
cross-database joins, but there may be others. You need to make sure
(that is, read the documentation) that the RDBMS you use supports this
feature.

By the way, are you clear on the distinction between a "database" and a
"table"?

As for the specific queries to use, that depends on the database design
you have, and the types of comparisons you want to make. I can't guess
anything about your database from what you have told us.

Regards,
Bill K.


Reply With Quote
  #6  
Old   
Gene Wirchenko
 
Posts: n/a

Default Re: Database cross-reference ? - 05-15-2006 , 02:05 PM



On 13 May 2006 14:10:49 -0700, rzajac (AT) gmail (DOT) com wrote:

Quote:
I don't know if this is a good place to ask but I take my chances.

I have small project on my hands. I have two databases. One containing
data about people and their interests and the other one with where to
find information that could interest those people.
So far the responses have been taking the two databases statement
at face value, but I see a possible vocabulary problem.

A database is a collection of data organised for quick access.
(There is more to it, but this suffices for this discussion.) A
database may have more than table of data.

Do you really have two databases, or do you have two tables?

If the former, read what the other posters have said. If it is
two tables, then you need to learn about joins.

Quote:
Now I need to write some kind of program probably in C++ or something
like that to cross-reference those two databases and send, let say,
emails to people that could be interested in that information.
Do not presuppose the language. The query might be done quite
easily by the DBMS (database management system).

Quote:
It's the first time I'm doing the project like that so I'm
looking for any references to this kind of database programming or
anything that could help me.
Sincerely,

Gene Wirchenko



Reply With Quote
  #7  
Old   
Lennart
 
Posts: n/a

Default Re: Database cross-reference ? - 05-15-2006 , 10:56 PM




Bill Karwin wrote:
Quote:
rzajac (AT) gmail (DOT) com wrote:
So it is possible to cross reference data from two databases just using
SQL queries?

Like I said, it depends on the RDBMS software implementation you are
using. Are you using MySQL? That's the only one I know supports
cross-database joins, but there may be others.
DB2 does support this via federation/nicknames. I assume Oracle and
SQLServer implements something similar, but I dont know


/Lennart

[...]



Reply With Quote
  #8  
Old   
AT
 
Posts: n/a

Default Re: Database cross-reference ? - 05-17-2006 , 05:16 PM



I have two separate databases. I never did something like that before
so I'm just asking where should I go from here - what books would you
suggest or maybe some online tutorials.

Thank you very much for help so far.

Ralph


Reply With Quote
  #9  
Old   
Bill Karwin
 
Posts: n/a

Default Re: Database cross-reference ? - 05-17-2006 , 06:13 PM



rzajac (AT) gmail (DOT) com wrote:
Quote:
I have two separate databases. I never did something like that before
so I'm just asking where should I go from here - what books would you
suggest or maybe some online tutorials.
MySQL docs:
http://dev.mysql.com/doc/refman/5.0/...ualifiers.html

I'm assuming you are using MySQL. I asked you that question but you
didn't answer it.

Regards,
Bill K.


Reply With Quote
Reply




Thread Tools
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

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Powered by vBulletin Version 3.5.3
Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.