如何用sql语句alter写: 1、主键和外键 约束 2、工资大于零,并且在0--10000之间 3、员工姓名以字母开头

如题所述

1, alter table '表x'
add constraint PK_字段1 PRIMARY KEY (字段1) --这是定义主键
add constraint FK_字段2 FOREING KEY (字段2) REFERENCES 表(字段2)
2,select * from 表x where money>0 and money<=10000
3,select * from 表 where name like '%字母%'
另外你的问题问的太模糊了 我把格式发你参考下 谢谢
温馨提示:答案为网友推荐,仅供参考