首页 > 代码库 > 创建表及对表的增删改查基本操作

创建表及对表的增删改查基本操作

查看数据库的名称:

SQL>show parameter db_name

查询scott用户的状态:

SQL>select username,account_stutas from dba_users where username=‘SCOTT‘;

解锁scott用户:alter user 解锁用户名 account unlock;

SQL>alter user scott account unlock;

查询用户拥有那些表:

SQL>select user_name from user_tables;

设置查询数据的时间格式:

SQL>alter session set nls_date_format=‘YYYY-MM-DD‘;

ROUND(X,Y):四舍五入函数。

sysdate:当前时间。

nvl(x,y):如果x有值则返回x,如果x为空,则返回y。

select 字段名 from 表名称 for update; ----for update:表示可以修改数据了。

创建表及对表的增删改查基本操作