当前位置:网站首页>sqlite创建表联合主键的sql写法
sqlite创建表联合主键的sql写法
2022-07-27 17:20:00 【荆楚闲人】
像下面那样创建TStudent表,让id,.name为联合主键
create table TStudent(
id INT primary key not null,
name VARCHAR(50) primary key not null
);会报如下错误:
Error:table "TStudent" has more than one primary key
正确的写法为如下:
create table TStudent(
id INT,
name VARCHAR(50),
primary_key(id, name)
);即联合主键,要写在建表语句最后一行,在primary key ()括号里面,且用逗号隔开。
边栏推荐
- [basic knowledge of deep learning - 49] kmeans
- GestureDetector(手势识别)
- 统一建模语言 (UML) 规范
- 11.2DHCP
- Intel's process roadmap for the next 10 years is exposed: 1.4nm process will be launched in 2029! How?
- DNSSEC verification with dig [verify DNSSEC with dig]
- MarqueeTextview(跑马灯)
- pytorch 常见报错
- [deep learning target detection series - 01] what is target detection
- The valuation exceeds 15.6 billion yuan! Huaqin communication completed the round B financing of 1billion yuan! Qualcomm venture capital, Intel Capital led investment
猜你喜欢

Application pool has been disabled

Virtualbox:ssh connection

高手勿进!写给初中级程序员以及还在大学修炼的“准程序员”的成长秘籍

GestureOverlayView(手势识别2)

UnicodeDecodeError: ‘utf-8‘ codec can‘t decode byte 0xff in position 0: invalid start byte

2022爱分析·智慧社区厂商全景报告 厂商征集

Fabric上搭建Hyperledger caliper进行性能测试

Marqueetextview (running lantern)

ToggleButton(按钮开关)

Intent(有无返回值得跳转)
随机推荐
ACL11.12
Hacker introductory tutorial (very detailed) from zero basic introduction to proficiency, it is enough to read this one.
Oracle 日期的转换
The first Xiaolong 765G! Redmi K30 5g release: support 5g dual-mode 120Hz screen, priced from 1999 yuan
UnicodeDecodeError: ‘utf-8‘ codec can‘t decode byte 0xff in position 0: invalid start byte
Systemservice (system service)
VS2017#include 'xxx.h'
[basic knowledge of deep learning - 38] the difference between L1 regularization and L2 regularization
【C#】正序、逆序、最大值、最小值和平均值
Flink introduction and operation architecture
ToggleButton(按钮开关)
JS 事件监听 鼠标 键盘 表单 页面 onclick onkeydown onChange
Turn Hyper-V on and off
File operation protection
Object常用方法学习【clone和equals】
go-zero单体服务使用泛型简化注册Handler路由
Fileoutputstream (file storage) and FileInputStream (file reading)
Radiogroup (radio box)
Detailed interpretation of IEC104 protocol (II) interaction process and protocol analysis
How powerful can top "hackers" be? Internet access without signal, expert: high-end operation!