给我BSEMPMS这个表的ddl语句,至少包含有EMP_NO/EMP_NAM/DAT_IN/HIREDATE/SAL/DPT_NO这6个字段,且包含主键PK_BSEMPMS,且包含索引SAL_BMI、HIREDATE_BMI,且有模拟数据
时间: 2023-03-07 18:54:57 浏览: 124
Oracle数据库中SQL语句的优化技巧
CREATE TABLE BSEMPMS (
EMP_NO INTEGER NOT NULL PRIMARY KEY,
EMP_NAME VARCHAR(50) NOT NULL,
DAT_IN DATE NOT NULL,
HIREDATE DATE NOT NULL,
SAL DECIMAL(10,2) NOT NULL,
DPT_NO INTEGER NOT NULL,
CONSTRAINT PK_BSEMPMS PRIMARY KEY (EMP_NO),
CONSTRAINT SAL_BMI UNIQUE (SAL),
CONSTRAINT HIREDATE_BMI UNIQUE (HIREDATE)
);INSERT INTO BSEMPMS (EMP_NO, EMP_NAME, DAT_IN, HIREDATE, SAL, DPT_NO) VALUES
(1, 'John', '2020-02-10', '2020-02-10', 1000.00, 1),
(2, 'Bob', '2020-03-01', '2020-03-01', 2000.00, 1),
(3, 'Sara', '2020-04-02', '2020-04-02', 3000.00, 2);
阅读全文