久久r热视频,国产午夜精品一区二区三区视频,亚洲精品自拍偷拍,欧美日韩精品二区

您的位置:首頁技術(shù)文章
文章詳情頁

Mysql復(fù)合主鍵和聯(lián)合主鍵的區(qū)別解析

瀏覽:130日期:2023-05-05 10:12:05

復(fù)合主鍵:

create table index_test
(
    a int not null,
    b int not null,
    c int not null,
    d int null,
    primary key (c, a, b)
);

即一個表的主鍵同時由多個字段共同組成,復(fù)合主鍵索引見【Mysql】復(fù)合主鍵的索引。

聯(lián)合主鍵:

create table index_test_a
(
    id int not null,
    a int not null
    primary key (id)
);
create table index_test_b
(
    id int not null,
    b int not null
    primary key (id)
);
create table index_test_a_b
(
    id int not null,
    a_id int not null,
    b_id int not null,
    primary key (id)
);
index_test_a_b表的id為表index_test_a和表index_test_b的聯(lián)合主鍵,就是個邏輯概念

到此這篇關(guān)于Mysql復(fù)合主鍵和聯(lián)合主鍵的區(qū)別的文章就介紹到這了,更多相關(guān)mysql復(fù)合主鍵和聯(lián)合主鍵內(nèi)容請搜索以前的文章或繼續(xù)瀏覽下面的相關(guān)文章希望大家以后多多支持!

標(biāo)簽: MySQL
主站蜘蛛池模板: 孟津县| 城口县| 巴彦县| 苗栗市| 福建省| 株洲县| 若尔盖县| 观塘区| 茌平县| 靖江市| 洛隆县| 富裕县| 平原县| 突泉县| 商丘市| 错那县| 禄劝| 平遥县| 宿松县| 丹寨县| 长治市| 丽水市| 绥棱县| 天门市| 项城市| 乐平市| 华安县| 盖州市| 龙胜| 蒲城县| 府谷县| 甘孜县| 邵东县| 龙泉市| 佛坪县| 厦门市| 新龙县| 浮山县| 深圳市| 抚宁县| 西华县|