用户登陆
1、oracle是独立的数据库服务器
2、程序打开sqlplus.exe 运行
3、Scott 普通用户 -->表(增删改查) 密码是tiger
system 数据库管理员 -->库/用户/表 密码是manager
sys 数据库系统管理员 -->库/用户/表/可执行文件 密码是change_an_install
4、查询用户
show user
5、解锁语句
alter user 用户名 account unlock; 错误为28000时为被锁定
6、用户登陆
connect 用户名/口令密码;
7、强制登陆
sqlplus /nolog
sqlplus之后有空格 登陆之后必须写 conn /as sysdba;否则永远未登录
8、有数据库记录的时候(运行上的)登陆
sqlplus /用户名/密码 /@ord
9、更改用户名密码
alter user 用户名 indentified by 密码;
10、查询当前拥有的表名
select table.name from user_tables;
11、数据库中控制为null ,任何一个值与null运算都是null值
12、查询当前用户所有的数据:
select * from 表名;
13、查询表内容
select 字段名1,字段名2 from 表名;
14、起别名(给表起别名 不能加as)
select 字段名1 别名1,字段名2 as 别名2,字段名3 as "别名3",字段名4 "字段名4" from 表名;
15、 字符串链接
字段1||字段2 from 表名;
字段名1||'字符串'||字段名2 from 表名;
16、取消重复值
select distinct 字段名 from 表名;
17、显示表结构
desc[ribe] 表名; ----> irbe可以省略
18、额外条件
where 条件 ----> where后不能使用别名
19、取两个值之间的内容
between (小值) and (大值) ---> 包含边界值
20、取两个固定值
in (值,值) ---->等于值列表中的一个,取固定值,()内以逗号分隔
21、迷糊查询
like '内容'
% 代表0个或者多个字符 's%' 以s打头的字符
_ 代表字符 '_b_' 以第二个字符为s的字符
22、is null 空值
is not null 不为空值
23、order by asc 升序
order by desc 降序