Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 SQL Server 2000 Forums
 SQL Server Development (2000)
 SQL Select on 4 tables

Author  Topic 

AskSQLTeam
Ask SQLTeam Question

0 Posts

Posted - 2001-03-05 : 00:32:36
Ely writes "Hello,

I have a database for online seminars, which looks something like:

User Table:
ID
Username

Course Table:
ID
CourseName

SubCourse Table: //Table that stores the courses users are subscribed to
ID
UserID //FK to User Table
CourseID //FK to Course Table

Transactions Table: //This table shows which courses have been bought
ID
UserID //FK to User Table
SubCourseID //FK to SubCourse Table

Now, what I am trying to do is write an SQL statement that will show the transactions for a particular user. However, I also want to get the name of the course and the username from the appropriate tables. So I am stuck with writing an SQL statement pulling info out of 4 tables that I can't seem to hack out. Any pointers? Is something like this even advisable?"
   

- Advertisement -