Answer the question
In order to leave comments, you need to log in
MySql which data type to choose for url ?
Tell me what type of data to choose for url?
and in general, did I create a one-to-one connection correctly
CREATE TABLE `g_url` (
`id` INT NOT NULL,
`url` TEXT NOT NULL,
PRIMARY KEY(`id`)
);
CREATE TABLE `g_field` (
`id` int NOT NULL,
`title` CHAR(30),
`description` CHAR(30),
PRIMARY KEY(`id`),
FOREIGN KEY (`id`) REFERENCES g_url(`id`)
)
Answer the question
In order to leave comments, you need to log in
Why not store everything in one table, why a 1:1 relationship?
Type can choose VARCHAR - there is a limit on the length or a long TEXT.
Don't make extra connections. Make in one table and field type VARCHAR with margin (0 to 65535)
TEXT in general should be used carefully, since queries involving BLOB / TEXT that require a temporary table always lead to the creation of a table on disk ( proof ), which obviously will not add speed to your queries.
In this case, varchar will be more than enough.
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question