创建数据表和数据表常用增删改操作
1.点击"开始/程序/ Oracle - OraHome92/ Application Development/ SQL Plus";
2.在"用户名称[U]:"和"口令[P]:"输入system的用户名和密码,默认为system和manager(或安装时自己设定的密码)
3.创建表空间"TEST",大小100M:
CREATE TABLESPACE "TEST" ;
LOGGING ;
DATAFILE 'D:/ORACLE/ORADATA/TEST/HAIG.ora' SIZE 100M;
4.创建用户"TEST",默认表空间"TEST";
CREATE USER "TEST" PROFILE "DEFAULT" IDENTIFIED BY "TEST" ;
DEFAULT ;
TABLESPACE "TEST" ACCOUNT UNLOCK;
5.授予其三个权限:UNLIMITED TABLESPACE,CONNECT,RESOURCE;
GRANT UNLIMITED TABLESPACE, CONNECT, RESOURCE TO "TEST";
6.使用"TEST"用户登录;
CONNECT TEST/TEST;
1.建表;
CREATE TABLE count
(
num1 NUMBER(4,2),
num2 NUMBER(5,2),
result NUMBER(6,2)
);
2.插入数据;
INSERT INTO count(num1,num2,result) VALUES(1,1,2);
INSERT INTO count(num1,num2,result) VALUES(1,1,1);
INSERT INTO count(num1,num2,result) VALUES(2,8,10);
INSERT INTO count(num1,num2,result) VALUES(68,90,158);
3.提交数据;
COMMIT;
4.更新数据;
Update count set num1=100;
5.删除数据;
delete from count;
6.查询数据;
select * from count;