1. Access Control statements
1.1 New tablespace
create tablespace ERP_TS
datafile 'D:\app\Administrator\oradata\orcl\erp.dbf'
size 100M
autoextend on
next 10M;
note:
1. ERP_TS table space name
2. datafile directory path for the installation directory path to the oracle
1.2 New User table space and associated
create user ERPUSER identified by zoudm default tablespace ERP_TS
1.3 assign permissions to users
grant dba to ERPUSER
2. DDL and DML statements
2.1 Create a table
create table EMP (
UUID NUMBER not null,
USERNAME VARCHAR2(15),
PWD VARCHAR2(32),
NAME VARCHAR2(28),
GENDER NUMBER,
EMAIL VARCHAR2(255),
TELE VARCHAR2(30),
ADDRESS VARCHAR2(255),
BIRTHDAY DATE,
DEPUUID NUMBER,
constraint PK_EMP primary key (UUID)
);
2.2 add comments to the table
comment on table EMP is '员工';
2.3 add comments to table fields
comment on column EMP.UUID is '编号';
2.4 Creating a sequence
CREATE SEQUENCE "DEP_SEQ" NOCACHE ;
Insert data 2.5
insert into DEP values (DEP_SEQ.NEXTVAL, '管理员组', '000000');
To be continued. . . . . .