当前位置:网站首页>Oracle data integrity
Oracle data integrity
2022-07-01 00:47:00 【Mr. Li, a prodigy】
If a worker wants to do a good job, he must sharpen his tools first
Articles are constantly updated , You can search by wechat 【 Xiaoqi JAVA interview 】 First time reading , reply 【 Information 】 Access to benefits , reply 【 project 】 Get the source code of the project , reply 【 The resume template 】 Get resume template , reply 【 Learning Roadmap 】 Get a learning roadmap .

List of articles
One 、 Non empty constraint
not null
1、 Create a student table , There are two fields , The first field is id yes number type , The second field is name yes varchar2 Type and cannot be empty .
create table student(
id number,
name varchar2 not null,
)
Two 、 Unique constraint
unique
1、 Create a student table , There are two fields , The first field is id yes number type , The second field is name yes varchar2 Type and no repetition is allowed .
Copying tables is actually used to back up tables
create table student(
id number,
name varchar2 unique,
)
3、 ... and 、 Primary key constraint
1、 Create a student table , There are two fields , The first field is id yes number Type and primary key , The second field is name yes varchar2 Type and cannot be empty .
create table student(
id number,
name varchar2 not null,
constraint pk_id primary key(id);
Four 、 Composite primary key constraint
1、 Create a student table , There are two fields , The first field is id yes number type , The second field is name yes varchar2 type , And set the two fields as a composite primary key constraint .
create table student(
id number,
name varchar2,
constraint pk_id primary key(id,name);
5、 ... and 、 Check constraint
1、 Create a student table , There are two fields , The first field is id yes number Type and primary key , The second field is name yes varchar2 type , The third is age yes number type , also age stay 0-100 Between .
create table student(
id number,
name varchar2,
age number,
constraint pk_id primary key(id),
constraint ck_age check(age between 0 and 100);
6、 ... and 、 Foreign key constraints
1、 Create a student table , There is a field , The first field is id yes number Type and primary key , Create a teacher table , There are two fields , The first field is id yes number type , The second field is sid And for students id The foreign key
create table student(
id number,
constraint pk_id primary key(id);
create table teacher(
id number,
sid number
constraint fk_sid foreign key(sid) references student(id);
7、 ... and 、 Modify constraints
1、 Put the student list student Add primary key id Constraints
alter table student add constraint pk_id primary key(id);
2、 Put the student list student Of name Change the field to non empty constraint
alter table student modify(name varchar2 not null);
8、 ... and 、 summary
The relevant contents here have not been sorted out yet , The article continues to be updated later , Recommended collection .
The commands involved in the article must be typed several times each like me , Only in the process of knocking can you find out whether you really master the command .
You can search by wechat 【 Xiaoqi JAVA interview 】 First time reading , reply 【 Information 】 Access to benefits , reply 【 project 】 Get the source code of the project , reply 【 The resume template 】 Get resume template , reply 【 Learning Roadmap 】 Get a learning roadmap .
边栏推荐
- Which is better, server rental or hosting services in the United States?
- C#生成putty格式的ppk文件(支持passphrase)
- Luogu p1168 median
- 2022-2028 global capsule shell industry research and trend analysis report
- P4 learning - Basic tunneling
- What is product thinking
- Ybtoj exchange game [tree chain splitting, line segment tree merging]
- When is it appropriate to replace a virtual machine with a virtual machine?
- 魔王冷饭||#101 魔王解惑数量多与质量;员工管理;高考志愿填报;游戏架构设计
- Authentication principle of Ranger plug-in
猜你喜欢

2022-2028 global ethylene oxide scrubber industry research and trend analysis report

P4学习——p4runtime

Deployment of mini version message queue based on redis6.0

Host FL Studio fruit music production daw20.9

HDU 2488 A Knight's Journey(DFS)

P4 learning - Basic tunneling

初识 Flutter 的绘图组件 — CustomPaint

Date类的实现

left join左连接匹配数据为NULL时显示指定值

Bugku CTF daily one question dark cloud invitation code
随机推荐
The difference between union and union all in MySQL
Confirm() method of window
File reading and writing for rust file system processing - rust Practice Guide
P4 learning - p4runtime
How to specify the number of cycles in JSTL- How to loop over something a specified number of times in JSTL?
CentOS install MySQL
Pytorch installs and uses GPU acceleration
解决 error MSB8031: Building an MFC project for a non-Unicode character set is deprecated.
2022就要过去一半了,挣钱好难
When is it appropriate to replace a virtual machine with a virtual machine?
From January 11, 2007 to January 11, 2022, I have been in SAP Chengdu Research Institute for 15 years
MySQL index test
【2023联发科提前批笔试题】~ 题目及参考答案
The principle and related problems of acid in MySQL
BeanUtils. Copyproperties() vs. mapstruct
Rust controls Dajiang programmable UAV Tello
Redis - sentinel mode
20220215-ctf-misc-buuctf-einstein-binwalk analyze picture-dd command separate zip file -- look for password in picture attribute
Using Excel to quickly generate SQL statements
[designmode] singleton pattern