資料定義語言DDL之資料庫操作

2021-10-08 18:38:53 字數 793 閱讀 5064

create (database|schema) [if not exists] database_name

[comment database_comment]

[location hdfs_path]

[managedlocation hdfs_path]

[with dbproperties (property_name=property_value, ...)];

(database|schema)二選一, 裡面的內容為可選:即可以寫也可以不寫

例如:

hive> create database if not exists hive3 with dbproperties(

'creator'='pk'

);

describe database [extended] db_name;

describe schema [extended] db_name;

檢視資料庫資訊

hive> desc database hive;

檢視資料庫詳細資訊

hive> desc database extended hive3;

drop (database|schema) [if exists] database_name [restrict|cascade];
hive (hive2)> drop database test_db cascade; 工作中不要使用,因為會強制的把資料庫中的表刪除,同時刪除資料庫

資料庫資料定義語言(DDL)

資料定義語言 一般由create,drop和alter開頭,作用於database,table,view,function等圖示物件,對它們進行建立,刪除和修改等操作。建立資料庫 語法 create database if not exists database name comment with ...

資料庫 資料定義語言DDL

資料庫模式定義語言 ddl data definition language 是用於描述資料庫中要儲存的現實世界實體的語言。乙個資料庫模式包含該資料庫中所有實體的描述定義。禁用ddl語句 在一些特定情況下,如 金融 安全 稅務等等部門,有一些資料庫為了安全需要,需要禁止執行ddl語句。在oracle...

資料庫 DDL資料定義語言

庫的管理 建立,修改,刪除 表的管理 建立 修改,刪除 建立 create 修改 alter 刪除 drop ddl語言 資料定義語言 用於庫和表的管理 1.庫的管理 建立,修改,刪除 2.表的管理 建立 修改,刪除 建立 create 修改 alter 刪除 drop 一,庫的管理 1.庫的建立 ...