MySQL table
-- 使用数据库hr use hr; -- 在数据库中创建表 -- ------------------------------------JOBS表---------------------------------------------------------- -- 判断数据库中是否存在表JOBS drop table if exists JOBS; -- 创建表JOBS create table JOBS ( JOB_ID VARCHAR(10) not null,-- 职位编号,主键 JOB_TITLE NVARCHAR(20) not null,-- 职位名称 MIN_SALARY float not null, -- 职位最低薪资,不小于1000元 mysql中没有money类型的数据类型 MAX_SALARY float not null -- 职位最高薪资,不小于最低薪资 ); -- 给JOBS表创建约束 -- 添加主键约束 alter table JOBS add constraint primary key(JOB_ID); -- 职位最低薪资,不小于1000元 alter table JOBS add constraint check(MIN_SALARY>=1000); -- 职位最高薪资,不小于最低薪资 alter table JOBS add