国产成人精品亚洲777人妖,欧美日韩精品一区视频,最新亚洲国产,国产乱码精品一区二区亚洲

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

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

瀏覽:110日期: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)
);

即一個(gè)表的主鍵同時(shí)由多個(gè)字段共同組成,復(fù)合主鍵索引見(jiàn)【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)合主鍵,就是個(gè)邏輯概念

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

標(biāo)簽: MySQL
主站蜘蛛池模板: 北安市| 乐平市| 清新县| 磐安县| 阳新县| 祁连县| 观塘区| 湘乡市| 金坛市| 隆化县| 连城县| 鄂州市| 忻州市| 宜君县| 潮州市| 宝坻区| 西盟| 昌平区| 屯昌县| 建平县| 云和县| 亳州市| 万载县| 武平县| 大安市| 安康市| 大邑县| 黄梅县| 康平县| 灵璧县| 塔城市| 沂南县| 曲水县| 冷水江市| 尚义县| 广丰县| 利津县| 康保县| 顺平县| 长阳| 武邑县|