views:

164

answers:

1

So I have an web app, where users can pay for certain extra features, and also subscription.

At first it was just a few simple things, and I had one Payment table, which had an "item" field, to specify what the user was paying for.

But now would need to come other items, with various accompanying parameters. Even the subscription could take an extra parameter, for how long to subscribe for.

I don't know if every such item should get its own table, or how to design this.

+1  A: 

There are several examples of viable database models here: http://www.databaseanswers.org/data_models/

It is helpful to think of database tables as spreadsheets of rows and columns, where each column is a field, and each row is a record. In general, if you need to capture a new instance of column values, that calls for a new record/row. If you need to capture a new data item for each row, that's a new field/column.

Robert Harvey