码迷,mamicode.com
首页 > 数据库 > 详细

数据库语句的基本操作(mon10-day21)

时间:2017-10-22 01:31:58      阅读:174      评论:0      收藏:0      [点我收藏+]

标签:select   名称   blog   core   sel   where   set   ble   nec   

--创建用户
  create user yanlong identified by 123456;
--切换用户
   conn yanlong/123456;
--修改密码
   password yanlong;
   alter user yanlong identified by 123;
--添加数据
   insert table student(id number);
--添加数据
   insert into student(1);
--查询数据
   select *from student;
--删除表
   drop table student;
--回收权限
   remoke connect from student;
   remoke resource from student;
--使用yanlong建表
   create table students(id,number);
--赋予权限
   grant connect,resource to student;
--删除用户
   drop  user student;
--创建表
  create table students(
      id number,
      name varchar2(32),
      sex char(2),
      birthday date,
      score number(5,1),
      resume clob);
-------修改表
      --添加列的基本操作
      alter table students add(class_id number);
      --修改列的属性
      alter table students modify(score number(5,1));
      ---删除列
      alter table students drop(score);
      alter table students drop column score;
      --修改表名称
      rename students to student;
      --修改列名称
      alter table student rename column class_id to cId;
-------添加数据
       ---插入数据
       insert into student values(1,陈燕龙,,10-10月-2017,321,1001);
       --更改数据
       update  student set name=李四 where id=1; 
       
       

 

数据库语句的基本操作(mon10-day21)

标签:select   名称   blog   core   sel   where   set   ble   nec   

原文地址:http://www.cnblogs.com/chenyanlong/p/7707420.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!