Oracle學習筆記第五天
阿新 • • 發佈:2018-12-23
Oracle學習筆記第五天
表相關操作
增:
新增表之前已經有了,不再多說;
刪:
truncate table mytable; -- 刪除表裡面的所有資料,表還在
delete from student where 1 = 1 ; -- 刪除表裡面的所有資料,表還在
drop table mytable; -- 刪除表和表裡的資料
drop table mytable purge; -- 永久性刪除表,不能恢復:
查:
select table_name from user_tables; -- 當前使用者的表
select table_name from all_tables; -- 所有使用者的表
select table_name from dba_tables; -- 包括系統表
desc 表名; -- 在命令視窗下可以實現,PL/SQL軟體中會報錯...
select * from user_tab_columns where Table_Name='使用者表名'; -- 查看錶結構
select * from all_tab_columns where Table_Name='使用者表名';
select * from dba_tab_columns where Table_Name='使用者表名';
改:
這部分在第二天已經有了,這裡也不描述了。