Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

SQL tables help

Status
Not open for further replies.

12938172

Programmer
Jan 23, 2008
4
Hey guys,

I am working on my table structure and am alittle stuck on what to do. The user has the ability to reg himself, and if he doesnt then his details wont be saved but his transaction will. Now, when I store the transactions for regged and unregged users should I store them in different tables ? See the tables below:

User Table
UserID
Name
Contact
Email
Gender
Registered
username
password
moderator

Event Table
EventID
EventName
MaxNoTickets
SingleTicketPrice

Purchase Table
PurchaseID
UserID
EventID
NoOfTicketsPurchased
TotalPrice

As you can see, the following table would only work if the user was registered. But now the question is how I should store events for unregistered users. So far it looks like I will need to create a seperate table.
 
if the user is unregistered, how do you know who he is?

i don't understand how "his details wont be saved but his transaction will" is supposed to work

this does not require a separate purchase table

you could insert a row into the purchase table with a user_id of NULL

this would correspond to a number of tickets being sold but you don't know who you sold them to

if that makes sense to you...

r937.com | rudy.ca
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top