oracel空間表的操作
sqlplus sys/sys as sysdba;
mysql:乙個使用者–>多個庫–>表
oracel:乙個資料庫–>多個使用者–>表
建立表空間
create tablespace itheima10 -- 建立表空間
datafile 'c:\itheima10.dbf' -- 表空間的物理檔案位址
size 100m -- 表空間的預設物理大小
autoextend on -- 自動擴充套件
next 10m; -- 每次擴充套件的大小
--刪除表空間
drop tablespace itheima;
--建立使用者
create user itheima10 -- 使用者名稱
identified by itheima10 -- 密碼
default tablespace itheima10; -- 使用者預設使用的表空間
--使用者授權
grant dba to itheima10; --授權給使用者
varchar2 number date clob blob--建立表
create table person (id number,username varchar2(24),adderss varchar2(32)); --same
--修改表結構
alter table 表名
add modify rename column...to.... drop column
-- 刪除表
drop table person;
表資料的修改 注意事務的提交
insert update select delete
delete和truncate的區別
delete可以回滾,會產生碎片
truncate 直接刪除表,然後再建立表
條件表示式
1select e.ename
(case e.ename
when 『tom』 then 『劉德華』
when…then…
else…
end) 中文名
from emp e;
2select e.sal,(
case
when e.sal>3000 then 『high』
when e.sal>1500 then 『mid』
else 『low』
end) 「工資等級」 from emp e;
select * from
(select rownum r,e1.* from
(select * from emp e order by e.sal desc) e1) e2 where r>5 and r<11
第一天筆記
ide integrated development environment 整合開發環境 常用開發環境有idle pythcharm wingide eclipse ipython 1.ctrl z 和回車 2.輸入quit 命令 3.直接關閉命令列視窗 ctrl c python中一切皆物件。物...
Linux第一天筆記
1 linux指一套免費使用和自由傳播的類unix作業系統。linux一切皆檔案!2 fsf free software foundation 自由軟體聯盟 gnu gun s not unix general public license gpl 3 linux核心版本格式是x.y.zz www,...
hadoop筆記第一天
1 安裝虛擬機器 略 2 安裝必要的環境 安裝jdk 3 安裝hadoop 3.1上傳hadoop包 3.2解壓hadoop包 解壓 hadoop hadoop001 hadoop 2.4.1 ll total 60 drwxr xr x.2 hadoop hadoop 4096 jun 20 20...