Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
Kiryuu Sakuya
Database-school
Commits
26389b99
Verified
Commit
26389b99
authored
Nov 11, 2019
by
Kiryuu Sakuya
🎵
Browse files
Thanks to
@enihsyou
parent
45d3115e
Changes
1
Hide whitespace changes
Inline
Side-by-side
实验三.md
View file @
26389b99
...
...
@@ -167,6 +167,12 @@ ALTER TABLE employee ADD CONSTRAINT Check_Sex CHECK (emp_sex IN ("男", "女", "
ALTER TABLE employee ADD CHECK(emp_no RLIKE "[0-9][0-9][0-9][0-9][0-9]");
```
如果用 REGEX 的话就是
```
mysql
ALTER TABLE employee ADD CONSTRAINT CHECK (emp_no REGEXP '\\d{5}');
```
或者,输入的编号必须以 E 开头的 5 位数编号
```
mysql
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment