July 12, 2024 at 12:00 am
Comments posted to this topic are about the item What's Wrong with this Table?
July 12, 2024 at 1:37 pm
While everyone remembered that a primary key cannot have nulls, I'll take issue with some of the designs here. First of all, do you have more than one customer? Shouldn't the tablename be a plural or collective noun to show this?
An identifier is, by its very nature, on a nominal scale; it is not numeric and no calculations are ever done on it. It needs to be CHAR(n) , and perhaps worth adding a CHECK() constraint for safety. Are customer names and emails logically different from other names and emails in this system? Since it's an identifier. the customer_id should be unique by itself, and not require a name added to it to make it unique.
While I've never seen anybody dumb enough to do it, it is possible to have an email address that is insanely long. In the real world CHAR(100) is probably more than good enough, but let's go ahead and name for the max. I think it's 256 currently.
Please post DDL and follow ANSI/ISO standards when asking for help.
Viewing 2 posts - 1 through 1 (of 1 total)
You must be logged in to reply to this topic. Login to reply