Witaj Gościu! ( Zaloguj | Rejestruj )

Forum PHP.pl

> [SQL]Relacje i klucze w tabeli
Malinaa
post 18.10.2019, 16:07:27
Post #1





Grupa: Zarejestrowani
Postów: 573
Pomógł: 6
Dołączył: 21.07.2008

Ostrzeżenie: (0%)
-----


Mam kod tabel

CREATE TABLE IF NOT EXISTS `sql_articles` (
`id_articles` int(11) NOT NULL auto_increment,
`comments_id` int(11) NOT NULL DEFAULT 0,
...
PRIMARY KEY (`id_articles`),
KEY `CommentsId` (`comments_id`)
);

oraz

CREATE TABLE IF NOT EXISTS `sql_comments` (
`id_comments` int(11) NOT NULL AUTO_INCREMENT,
`articles_id` int(11) NOT NULL DEFAULT 0,
`parent_comment_id` int(11) NOT NULL DEFAULT 0,
`comment` text NOT NULL,
...
PRIMARY KEY (`id_comments`),
KEY `ArticlesId` (`articles_id`)
);

Nie pamiętam jak to było dokładnie z kluczem KEY?

Dla tabel/i:
KEY `id_articles` (`articles_id`)
czy np. KEY `ArticlesId` (`articles_id`) też zadziała
czy raczej KEY `articles_id` (`articles_id`) jak to było itp.
Prośba o szczegóły relacji pomiędzy tymi tabelami.


--------------------
I welcome you on the Internet >>> Design by Malina
Go to the top of the page
+Quote Post

Posty w temacie


Reply to this topicStart new topic
1 Użytkowników czyta ten temat (1 Gości i 0 Anonimowych użytkowników)
0 Zarejestrowanych:

 



RSS Wersja Lo-Fi Aktualny czas: 6.07.2025 - 20:04