Confused about how my database should be set up.
Posted: Sun Apr 17, 2011 8:28 pm
Hey everyone.
I'll go ahead and give you all some background on what I'm doing. I'm putting together a simple investment portfolio, and I'm sort of stuck trying to visualize how I should be setting up my database.
It's currently creating a table for the user upon registration, with provisions for 15 Stocks, being stock1name, stock1symbol, and stock1shares, incrementing to 15.
I'm thinking it would be simpler to not set up the full table for the user upon registration. It should be faster to add and drop rows for the user on-demand than to constantly search for an empty row and attempt to fill it.
My question is this:
How would I go about making this happen, as far as incrementing the rows?
For example,
Users adds stock 1. Script queries SQL to add the row for stock 1 including stock1name, stock1symbol, and stock1shares.
User completes stock 1, and now wants to add stock 2. How do I make the script increment the number for the next row?
Thanks in advance for any and all consideration.
I'll go ahead and give you all some background on what I'm doing. I'm putting together a simple investment portfolio, and I'm sort of stuck trying to visualize how I should be setting up my database.
It's currently creating a table for the user upon registration, with provisions for 15 Stocks, being stock1name, stock1symbol, and stock1shares, incrementing to 15.
I'm thinking it would be simpler to not set up the full table for the user upon registration. It should be faster to add and drop rows for the user on-demand than to constantly search for an empty row and attempt to fill it.
My question is this:
How would I go about making this happen, as far as incrementing the rows?
For example,
Users adds stock 1. Script queries SQL to add the row for stock 1 including stock1name, stock1symbol, and stock1shares.
User completes stock 1, and now wants to add stock 2. How do I make the script increment the number for the next row?
Thanks in advance for any and all consideration.