| Re: What is the correct way create two similar tables? -
06-04-2007, 07:48 AM
Blaine,
Both are correct. The question might be: Which would better meet my
requirements? Usage, data volume and maintainability all have implications.
The larget the number of rows, the better the arguement for two tables.
If you have one table and you are querying based upon type, then you might
want an index on the type column.
-- Bill
<EMAIL REMOVED> wrote in message
news:EMAIL REMOVED ups.com...
> Hey,
>
> I will be creating two tables with similar data. However I was
> wondering what the standard is for this.
>
> Should you
>
> a) Create two tables eg
> CREATE TABLE foo (id TINYINT UNSIGNED NOT NULL, name char(20) NOT
> NULL);
> CREATE TABLE footwo (id TINYINT UNSIGNED NOT NULL, name char(20) NOT
> NULL);
>
>
> b) Create one table with a column variable "type" to differentiate.
> CREATE TABLE foo (id TINYINT UNSIGNED NOT NULL, name char(20) NOT NULL,
> type char(20) NOT NULL);
> |