当前位置:网站首页>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 .
边栏推荐
- What is product thinking
- Kubernetes ---- pod configuration container start command
- Oracle-数据完整性
- 20220215 misc buctf easycap Wireshark tracks TCP flow hidden key (use of WinHex tool)
- 2022-2028 global public address fire alarm system industry research and trend analysis report
- 2022-2028 global rampant travel industry research and trend analysis report
- 对libco的一点看法
- Date类的实现
- ArrayList analysis 1-cycle, capacity expansion, version
- What SQL statements are supported for data filtering
猜你喜欢

Ditto set global paste only text shortcuts

Error 2059 when Navicat connects to MySQL

20220216 misc buuctf another world WinHex, ASCII conversion flag zip file extraction and repair if you give me three days of brightness zip to rar, Morse code waveform conversion mysterious tornado br

2022-2028 global capsule shell industry research and trend analysis report

Teach you how to use Hal library to get started -- become a lighting master

2022-2028 global plant peptone industry research and trend analysis report

MySQL variables, stored procedures and functions

What should I do without 50W bride price

Redis - understand the master-slave replication mechanism

剑指 Offer 18. 删除链表的节点
随机推荐
Sword finger offer 19 Regular Expression Matching
Self examination before school starts
CSDN常用复杂公式模板记录
Mindjet mindmanager2022 mind map decompression installer tutorial
Examples of topological sequences
Solving the weird problem that the query conditions affect the value of query fields in MySQL query
The full technology stack, full scene and full role cloud native series training was launched to help enterprises build a hard core cloud native technology team
20220215-ctf-misc-buuctf-einstein-binwalk analyze picture-dd command separate zip file -- look for password in picture attribute
Oracle-表的创建与管理
The programmer's girlfriend gave me a fatigue driving test
[designmode] factory pattern
SAP ui5 beginner tutorial 19 - SAP ui5 data types and complex data binding
2022-2028 global rotary transmission system industry research and trend analysis report
Can JDBC based on openjdk connect to MySQL?
MySQL storage engine
Cmu15445 (fall 2019) project 1 - buffer pool details
CMU15445 (Fall 2019) 之 Project#1 - Buffer Pool 详解
Exercise and health
Search rotation sort array
Thoughts on the future of data analysis in "miscellaneous talk"