Welcome 微信登录

首页 / 数据库 / MySQL / Oracle笔记:基本SQL语句

延续之前安装好的Oracle11g R2(见 http://www.linuxidc.com/Linux/2011-12/50277.htm ),这里使用putty这个工具登陆linux系统,putty的好处就在于可以随意在linux和windows直接复制粘贴,而且互相拷贝文件也非常方便!这里注意要用oracle用户登陆才能正常登陆oracle!系统登陆成功后访问数据库,使用oracle自带的用户名system登陆,如下图所示:650) this.width=650;" height=363>以下用表tableA来举一个例子 

1、创建表create table 表名( 字段名A 字符类型, 字段名B 字符类型); create table tableA (id integer,name varchar(25),age number);2、删除表drop table 表名;drop table tableA;650) this.width=650;" height=362>3、添加记录insert into 表名 values(‘记录A’,’记录B’,’记录C’);或 insert into 表名(字段名A,字段名C) values(‘记录A’,’记录C’);insert into tableA values(‘101’,’Jack’,’25’);或 insert into tableA (id,name,age) values (‘101’,‘Jack’,’25’);650) this.width=650;" height=168>4、添加字段ALTER TABLE 表名 ADD 字段名 字符类型;alter table tableA add native varchar(20);650) this.width=650;" height=184>5、删除字段ALTER TABLE 表名 DROP COLUMN 字段名;alter table tableA drop column native;650) this.width=650;" height=187>6、修改记录Update 表名 set 字段名A=’记录C’ where 字段名B=’记录B’;update tableA set age=’23’ where name=’Jack’;650) this.width=650;" height=263>7、删除记录Delete from 表名 where 字段名A=’记录A’;delete from tableA where name=’Jack’650) this.width=650;" height=279>8、查询记录select 字段名 from 表名 where 字段名="记录A’;select name from tableA where age=’24’;650) this.width=650;" height=129>MySQL主从同步部署总结Oracle笔记:数据操作相关资讯      Oracle基础教程 
  • Oracle块编程返回结果集详解  (11/10/2013 10:45:58)
  • Oracle基础教程之设置系统全局区  (08/22/2013 14:24:00)
  • Oracle基础教程知识点总结  (06/18/2013 07:43:32)
  • Oracle基础教程之tkprof程序详解  (10/22/2013 11:49:50)
  • Oracle基础教程之sqlplus汉字乱码  (07/18/2013 16:30:00)
  • Oracle 管理之 Linux 网络基础  (02/16/2013 18:37:35)
本文评论 查看全部评论 (0)
表情: 姓名: 字数