excel转成csv后导入oracle数据库中的步骤以及常用sql语句

建表语句:

CREATE table EPID_DATA_PAYMENT (
PROFESSION_WORK VARCHAR2(200),
PASSEN_ID VARCHAR2(500),
PASSEN_NAME VARCHAR2(500),
PASSEN_IDCARD VARCHAR2(500),
PASSEN_TYPE VARCHAR2(500),
HOST_ADDR VARCHAR2(500),
GIVE_DATE VARCHAR2(500),
GIVE_TYPE VARCHAR2(500),
GIVE_MONEY VARCHAR2(500),
GIVE_BANK_CARD VARCHAR2(500),
DEPO_BANK_CARD VARCHAR2(500)

)

select lengthb EXAMPLE from YQ45_2_GD_REALINFO;

alter TABLE YQ45_2_GD_REALINFO RENAME TO YQ45_2_GD_REALINFO_A ;

select table_name from user_tables;

建表 》 添加表和字段的注释 》 查看是否正确 (有没科学记数法和乱码)》复制数据 》 导入到plsql 》 import 》 查看插入数据是否一致

select * from MIDICAL_TREATMENT_CONDITION_01___TEST;
MIDICAL_TREATMENT_CONDITION_0120

MIDICAL_TREATMENT_CONDITION_0113
MIDICAL_TREATMENT_CONDITION_0112

MIDICAL_TREATMENT_CONDITION_0114

alter table MIDICAL_TREATMENT_CONDITION rename to MIDICAL_TREATMENT_CONDITION_0115;

drop table
commit;

建表:

CREATE table MIDICAL_TREATMENT_CONDITION_0120_WD (
AAA027_01 VARCHAR2(500),
AAA027_02 VARCHAR2(500),
AAA027_03 VARCHAR2(500),
AAA027_04 VARCHAR2(500),
AAA027_05 VARCHAR2(500),
AAA027_06 VARCHAR2(500),
AAA027_07 VARCHAR2(500),
AAA027_08 VARCHAR2(500),
AAA027_09 VARCHAR2(500),
AAA027_10 VARCHAR2(500),
AAA027_11 VARCHAR2(500),
AAA027_12 VARCHAR2(500),
AAA027_13 VARCHAR2(500),
AAA027_14 VARCHAR2(500),
AAA027_15 VARCHAR2(500),
AAA027_16 VARCHAR2(500),
AAA027_17 VARCHAR2(500),
AAA027_18 VARCHAR2(500),
AAA027_19 VARCHAR2(500),
AAA027_20 VARCHAR2(500),
AAA027_21 VARCHAR2(500),
AAA027_22 VARCHAR2(500),
AAA027_23 VARCHAR2(500),
AAA027_24 VARCHAR2(500),
AAA027_25 VARCHAR2(500),
AAA027_26 VARCHAR2(500)
)

注释:

COMMENT ON COLUMN MIDICAL_TREATMENT_CONDITION_0113_WD.AAA027_01 IS ‘AAA027’;
COMMENT ON COLUMN MIDICAL_TREATMENT_CONDITION_0113_WD.AAA027_02 IS ‘AKB021’;
COMMENT ON COLUMN MIDICAL_TREATMENT_CONDITION_0113_WD.AAA027_03 IS ‘AKC190’;
COMMENT ON COLUMN MIDICAL_TREATMENT_CONDITION_0113_WD.AAA027_04 IS ‘BKA030’;
COMMENT ON COLUMN MIDICAL_TREATMENT_CONDITION_0113_WD.AAA027_05 IS ‘AAE030’;
COMMENT ON COLUMN MIDICAL_TREATMENT_CONDITION_0113_WD.AAA027_06 IS ‘AAE031’;
COMMENT ON COLUMN MIDICAL_TREATMENT_CONDITION_0113_WD.AAA027_07 IS ‘AKC194’;
COMMENT ON COLUMN MIDICAL_TREATMENT_CONDITION_0113_WD.AAA027_08 IS ‘BKZ101’;
COMMENT ON COLUMN MIDICAL_TREATMENT_CONDITION_0113_WD.AAA027_09 IS ‘AKC193’;
COMMENT ON COLUMN MIDICAL_TREATMENT_CONDITION_0113_WD.AAA027_10 IS ‘BKZ102’;
COMMENT ON COLUMN MIDICAL_TREATMENT_CONDITION_0113_WD.AAA027_11 IS ‘AKC196’;
COMMENT ON COLUMN MIDICAL_TREATMENT_CONDITION_0113_WD.AAA027_12 IS ‘BKA061’;
COMMENT ON COLUMN MIDICAL_TREATMENT_CONDITION_0113_WD.AAA027_13 IS ‘BKA066’;
COMMENT ON COLUMN MIDICAL_TREATMENT_CONDITION_0113_WD.AAA027_14 IS ‘BKA022’;
COMMENT ON COLUMN MIDICAL_TREATMENT_CONDITION_0113_WD.AAA027_15 IS ‘AKE024’;
COMMENT ON COLUMN MIDICAL_TREATMENT_CONDITION_0113_WD.AAA027_16 IS ‘BKA020’;
COMMENT ON COLUMN MIDICAL_TREATMENT_CONDITION_0113_WD.AAA027_17 IS ‘AKE020’;
COMMENT ON COLUMN MIDICAL_TREATMENT_CONDITION_0113_WD.AAA027_18 IS ‘AAC002’;
COMMENT ON COLUMN MIDICAL_TREATMENT_CONDITION_0113_WD.AAA027_19 IS ‘AAC003’;
COMMENT ON COLUMN MIDICAL_TREATMENT_CONDITION_0113_WD.AAA027_20 IS ‘AAE004’;
COMMENT ON COLUMN MIDICAL_TREATMENT_CONDITION_0113_WD.AAA027_21 IS ‘AAE005’;
COMMENT ON COLUMN MIDICAL_TREATMENT_CONDITION_0113_WD.AAA027_22 IS ‘AAE139’;
COMMENT ON COLUMN MIDICAL_TREATMENT_CONDITION_0113_WD.AAA027_23 IS ‘AKA101’;
COMMENT ON COLUMN MIDICAL_TREATMENT_CONDITION_0113_WD.AAA027_24 IS ‘AAE140’;
COMMENT ON COLUMN MIDICAL_TREATMENT_CONDITION_0113_WD.AAA027_25 IS ‘AKA130’;
COMMENT ON COLUMN MIDICAL_TREATMENT_CONDITION_0113_WD.AAA027_26 IS ‘BKA006’;

表的注释:
comment on table EPID_DATA_PAYMENT is ‘xxxxx’;

丢表:
drop table MIDICAL_TREATMENT_CONDITION_01___TEST;

修改字段类型长度:

alter table ADD_PEOLPLE_INFORMATION modify (WORK_CHECK varchar2(50))

删除空记录:
delete from LIST_OF_GOVERNMENT_SBU3 where SNO is NULL;

统计数量:
select count(*) from MIDICAL_TREATMENT_CONDITION_0112;

查看内容:
select * from HEALTHY_DATA_EXP;

删除表内容:
delete from LIST_OF_GOVERNMENT_SBUSHOSPITAL;

INFO_RECORD_KEY_WITHOUT_EPIE_CONTROL_FUTURE_ZMT

插入记录内容:

insert into LIST_OF_GOVERNMENT_SBU4 VALUES( ‘9’ , ‘事务管理局’, ‘办公室’ );

删除特定的记录:

DELETE FROM LIST_OF_GOVERNMENT_SBU4 WHERE SNO=9;

查看本用户有几个表:
select table_name from user_tables;

alter table YQ45_2_GD_R rename to YQ45_2_GD_REALINFO_A_WD;

YQ45_2_GD_REALINFO_B_WD,

你可能感兴趣的:(oracle数据库,数据库)