oracle sql 简单语句
创建数据库: create database dbname;
1.创建表: create table (l列名 类型,...);
2.修改表名: alter table 表名 rename to 新表名;
3.添加列: alter table 表名 add 列名 类型;
4.修改列名: 两种一种表中无数据:alter table 表名 modify 列名 修改后类型;表总有数据:alter table 表名 add 新列名 目标类型; update table 表名 set 新列名=列名;
5.修改表名:alter table 表名 dorp column 列名;alter table 表名 rename column 新列名 to 列名; 修改完毕。
6.添加数据: insert into 表名 (列名,...)values(列值,...(值与前面的顺序相对应)) ;或者 insert into 表名 values (列值,....(这里的列是全部的列值,不可以省略或者不填));
7.查看整条数据: select * from 表 where 条件 (获取所有的可以写成 where 1=1(表示条件永远成立));
8.查看个选定列的数据: select 列名,列名,... from 表名 where 条件 (获取所有的可以写成 where 1=1(表示条件永远成立));
9.删除列: alter table 表名 drop column 列名;
10.修改数据: update 表名 set 列名=值 where 条件;
11.删除数据: delete from 表名 where 条件;delete 表名 where 条件
12.删除表: drop table 表名;
13.复制表:create table 新表名 as (select * from 目标表 where 条件(复制整表为1=1 一直成立 复制 表结构为1=0 一直不成立不导入数据));