this forum doesn’t see enough activity and i’m bored
what is wrong with this table design?
wrong answers only
CREATE TABLE customers
( id INTEGER NOT NULL AUTO_INCREMENT
, name VARCHAR(100) NOT NULL
, addr VARCHAR(400)
, phone VARCHAR(37)
)
this forum doesn’t see enough activity and i’m bored
what is wrong with this table design?
wrong answers only
CREATE TABLE customers
( id INTEGER NOT NULL AUTO_INCREMENT
, name VARCHAR(100) NOT NULL
, addr VARCHAR(400)
, phone VARCHAR(37)
)
You’re right. It looks like Christmas hit really hard and we’re all exhausted.
To be honest, I don’t see anything particularly wrong with the design per ser.
Probably I would call CustomerID and not only ID the firfs field, and I guess that 37 digits for a phone number is a bit too much.
But now you’ll tell me something really obvious that it is right in front of my face and that I didn’t pay attention
Not sure about the SQL dialect but I would say INT instead of INTEGER
You never set the primary key.
Varchar has a max length of 255 therefore 400 is wrong
You got it. An auto_increment must be a key.
reread the op. He is asking for wrong answers, not for what is rightfully wrong.
So a wrong answer is that it does not have an order ID
beautiful!!
and wrong, as requested
that’s not wrong, so your answer is wrong, so it’s right!!!
i love it!!
wrong as requested!!
So the right answer is that there’s nothing wrong
As my answer is not wrong, your answer is wrong as requested
255 characters will be the maximum lengh in a database like Access.I think the limit for varchar is 8000
that answer is wrong! i love it!!
This depends on the database. That’s why I asked for the dialect. For MYSQL it is 4096 chars, for Postgres it’s 65535 for example
I’m so happy that you’re having fun on our behalf
pls do a little bit of googling (or test it yourself)
an auto_increment has to have an index, but it does not have to be a PK
wrong!! well done!!
“The length can be specified as a value from 0 to 65,535.” – https://dev.mysql.com/doc/refman/8.0/en/char.html
Please read my post. I said “key" not primary key, what for me is similar to an index. It’s just an other word