資料庫統計建表字段資訊

2021-09-06 00:19:06 字數 543 閱讀 6959

1.統計資料庫中標的字段資訊(欄位名字,字段約束,字段型別,字段注釋等,建表的資訊都儲存在information_schema資料庫中,這個資料庫是mysql預設就有的,查詢sql語句如下(只需要把錶名稱換成自己的表名即可執行):

use information_schema;

select

c.column_name as '欄位名',

c.column_type as '資料型別',

c.is_nullable as '允許為空',

c.extra as 'pk',

c.column_comment as '字段說明'

from

columns c

inner join tables t on c.table_schema = t.table_schema

and c.table_name = t.table_name

where

t.table_name='表名稱'

hive 建庫建表字段操作基礎

建庫 create database if not exists test03 建庫,並指定位置 查詢所有的資料庫 show databases 使用庫 use test03 展示所有表 show tables 顯示表結構 desc employee 顯示建立表的語句 詳細 show create ...

資料庫表字段介紹

相應字段 categoryid 型別id categoryname 型別名 description 型別說明 picture 產品樣本 customercustomerdemo 客戶型別表1 相應字段 customerid 客戶id customertypeid 客戶型別id customerdem...

資料庫表字段命名規範

摘要 當前研發工作中經常出現因資料庫表 資料庫表字段格式不規則而影響開發進度的問題,在後續開發使用原來資料庫表時,也會因為資料庫表的可讀性不夠高,表字段規則不統一,造成資料查詢,資料使用效率低的問題,所以有必要整理出一套合適的資料庫表字段命名規範來解決優化這些問題。本文是一篇包含了資料庫命名 資料庫...