當前位置:首頁 » 操作系統 » 資料庫查看錶

資料庫查看錶

發布時間: 2022-01-26 11:16:55

① mysql如何進入資料庫查看所有表

1.查看資料庫,選中使用資料庫,並查看資料庫表,具體操作命令如下:

show databases;

use student;

show tables;

(1)資料庫查看錶擴展閱讀:

可以使用命令行工具管理 MySQL 資料庫(命令 mysql 和 mysqladmin),也可以從 MySQL 的網站下載圖形管理工具 MySQL Administrator, MySQL Query Browser 和 MySQL Workbench。

phpMyAdmin是由 php 寫成的 MySQ L資料庫系統管理程程序,讓管理者可用 Web 界面管理 MySQL 資料庫。

phpMyBackupPro也是由 PHP 寫成的,可以透過 Web 界面創建和管理資料庫。它可以創建偽 cronjobs,可以用來自動在某個時間或周期備份 MySQL 資料庫。

另外,還有其他的 GUI 管理工具,例如 mysql-front 以及 ems mysql manager,navicat等等。

② 如何查看oracle資料庫中的所有表

參考以下方法:
SELECT * FROM ALL_TABLES;系統里有許可權的表
SELECT * FROM DBA_TABLES; 系統表
SELECT * FROM USER_TABLES; 當前用戶下的表

③ SQL如何查詢一個資料庫中的表

第一次回答:
存儲過程或者函數來做。

第二次回答:
過程如下,你還可以完善一下
create procere get_table
@colname varchar(30),
@colvalue varchar(30),
@coltype varchar(30)=null,
@colformat varchar(30)=null
as
begin
declare @sql varchar(100), @tablename varchar(30)
create table #tables( tablename varchar(30))
declare cur_table cursor for
select name from sysobjects a
where type = 'U' and uid = 1 and exists( select 1 from syscolumns b where b.id = a.id and b.name = @colname)
open cur_table
fetch cur_table into @tablename
WHILE @@FETCH_STATUS = 0 begin
select @sql = 'insert into #tables select'''+ @tablename +''' where exists( select 1 from '+ @tablename +' where '+ @colname +' = '''+ @colvalue +''')'
exec(@sql)
fetch cur_table into @tablename
end
close cur_table
deallocate cur_table
select * from #tables
end
go

exec get_table 'name', '張三'

第三次回答:
這個過程我在SQL server 2005中執行過了,沒有問題,而且這語法也在2000中適用。

過程,我寫了幾次,或許你看得是開始我寫的,那有錯,後來更正了。

如果報錯,請把錯誤貼出來。

第四次回答:

你要把你的過程及語句,貼出來嘛,或者說明沒有改動,完全按照我的,那你也得把你的SQL語句貼出來吧?

然後,你說:
報錯如下,我是新手 麻煩大家了:

(所影響的行數為 0 行)

伺服器: 消息 105,級別 15,狀態 1,行 1
字元串 '張' 之前有未閉合的引號。
伺服器: 消息 170,級別 15,狀態 1,行 1
第 1 行: '張' 附近有語法錯誤。

(所影響的行數為 0 行)

伺服器: 消息 170,級別 15,狀態 1,行 1
第 1 行: '=' 附近有語法錯誤。

為什麼有那麼多報錯?是否執行了一次語句就報了你列出的所有錯誤?

務必把你的語句貼出來。像我第三次回答一樣,建立過程的語句(如果你沒有改,則不需要列出只需要說明,沒有改即可),及執行過程的語句(如果你沒有改,則不需要列出只需要說明,沒有改即可)。

第四次回答:

你重新執行一遍一下語句:

選中到「--到這里結束」的語句,一次執行。
drop procere get_table
go
create procere get_table
@colname varchar(30),
@colvalue varchar(30),
@coltype varchar(30)=null,
@colformat varchar(30)=null
as
begin
declare @sql varchar(100), @tablename varchar(30)
create table #tables( tablename varchar(30))
declare cur_table cursor for
select name from sysobjects a
where type = 'U' and uid = 1 and exists( select 1 from syscolumns b where b.id = a.id and b.name = @colname)
open cur_table
fetch cur_table into @tablename
WHILE @@FETCH_STATUS = 0 begin
select @sql = 'insert into #tables select'''+ @tablename +''' where exists( select 1 from '+ @tablename +' where '+ @colname +' = '''+ @colvalue +''')'
exec(@sql)
fetch cur_table into @tablename
end
close cur_table
deallocate cur_table
select * from #tables
end
go

exec get_table 'name, '張三'

--到這里結束

如果仍有問題,那麼執行以下語句:

create table #tables( tablename varchar(30))
insert into #tables select a.name from sysobjects a
where type = 'U' and uid = 1 and exists( select 1 from syscolumns b where b.id = a.id and b.name = 'name')
select * from #tables
drop table #tables

可以把所有包含欄位'name'的表找出來,你自己再仔細研究,使用exec( SQL)的方式 SQL2000也是支持的,實在不行,你就找到表後,自己一個一個表再select也可以得到結果:

select count(1) from tablename where name = '張三'
結果大於零就說明這個表是你要找的表之一了。
自己研究下吧。

④ 怎樣用SQL語句查詢一個資料庫中的所有表

查詢一個資料庫中的所有表sql語句是show tables;

顯示所有資料庫的命令是:show databases;要查看某個資料庫先要進入資料庫使用user <資料庫名>命令;進入資料庫之後才能查詢資料庫中有哪些表。使用以下命令即可查出所有表:

show tables;

(4)資料庫查看錶擴展閱讀

mysql資料庫的基本sql操作命令介紹:

1、顯示當前資料庫伺服器中的資料庫列表:mysql> SHOW DATABASES;

2、建立資料庫:mysql> CREATE DATABASE 庫名;

3、建立數據表:mysql> USE 庫名;mysql> CREATE TABLE 表名 (欄位名 VARCHAR(20), 字

名 CHAR(1));

4、刪除資料庫:mysql> DROP DATABASE 庫名;

5、刪除數據表:mysql> DROP TABLE 表名;

6、將表中記錄清空:mysql> DELETE FROM 表名;

7、往表中插入記錄:mysql> INSERT INTO 表名 VALUES ("hyq","M");

8、更新表中數據:mysql-> UPDATE 表名 SET 欄位名1='a',欄位名2='b' WHERE 欄位名3='c';

9、用文本方式將數據裝入數據表中:mysql> load data local infile "d:/mysql.txt" into table 表名;

10、導入.sql文件命令:mysql> USE 資料庫名;mysql> source d:/mysql.sql;

⑤ 如何查看oracle資料庫中的所有表

1、如果你想查資料庫中所有的表的話,可以查詢
SELECT * FROM dba_tables

2、如果你想查詢資料庫中某個用戶下的表的話,也可以登錄這個用戶,再查詢:
SELECT * FROM USER_TABLES

3、要想導入外部sql語句可以用命令

sql >@e:文件名.sql

如你想保存 select * from tablename;語句的結果,可以在sql*plus 裡面這樣:

SPOOL c:test.sql //

這是保存文件的位置

select * from tablename;

SPOOL OFF

⑥ 如何查看mysql資料庫中有哪些表

  1. use 資料庫名
    show tables就能看到這個庫中所有的表
    或者更直接一點,你到mysql 的data文件夾下看看,有多少個文件夾就有多少個庫,看看有多少個不同的文件名,就有多少個表

  2. //看當前使用的是哪個資料庫 ,如果你還沒選擇任何資料庫,結果是NULL。mysql>select database(); +------------+ | DATABASE() | +------------+ | menagerie | +------------+

  3. 如何查看Mysql中有哪些資料庫和表

    我想要知道自己的Mysql中有哪些資料庫和表,該如何查看?
    2006-6-20 02:22 lcy234
    show databases;use databaseName;show tables;

⑦ 如何查看mysql資料庫中有哪些表

show tables即為顯示當前資料庫中所有的表。又如:

mysql> use mysql
Database changed
mysql> show tables;
+---------------------------+
| Tables_in_mysql |
+---------------------------+
| columns_priv |
| db |
| event |
| func |
| general_log |
| help_category |
| help_keyword |
| help_relation |
| help_topic |
| innodb_index_stats |
| innodb_table_stats |
| ndb_binlog_index |
| plugin |
| proc |
| procs_priv |
| proxies_priv |
| servers |
| slave_master_info |
| slave_relay_log_info |
| slave_worker_info |
| slow_log |
| tables_priv |
| time_zone |
| time_zone_leap_second |
| time_zone_name |
| time_zone_transition |
| time_zone_transition_type |
| user |
+---------------------------+
28 rows in set (0.05 sec)

這個是顯示「mysql」這個資料庫中的所有的表,一共有28張。

⑧ oracle查看資料庫中有哪些表

查看那些庫的話必須用dba許可權登錄。登陸後可以通過下面的方法來查看。
一、查看有哪些庫,你的庫理解不準確,應該准確來說是表空間,可以通過下面的命令來實現
SELECT Total.name "Tablespace Name",Free_space, (total_space-Free_space) Used_space, total_spaceFROM(select tablespace_name, sum(bytes/1024/1024) Free_Spacefrom sys.dba_free_spacegroup by tablespace_name) Free,(select b.name, sum(bytes/1024/1024) TOTAL_SPACEfrom sys.v_$datafile a, sys.v_$tablespace Bwhere a.ts# = b.ts#group by b.name) TotalWHERE Free.Tablespace_name = Total.name

二、查看有哪些表。select table_name from dba_tables where owner='A';

⑨ 怎樣用SQL語句查詢一個資料庫中的所有表

1、打開Microsoft SQL Server 2012,選中需要查詢所有表的資料庫。

⑩ 怎麼查看資料庫里的所有表

--讀取庫中的所有表名
select name from sysobjects where xtype='u'
--讀取指定表的所有列名
select name from syscolumns where id=(select max(id) from sysobjects where xtype='u' and name='表名')
獲取資料庫表名和欄位
sqlserver中各個系統表的作用
sysaltfiles 主資料庫 保存資料庫的文件
syscharsets 主資料庫 字元集與排序順序
sysconfigures 主資料庫 配置選項
syscurconfigs 主資料庫 當前配置選項
sysdatabases 主資料庫 伺服器中的資料庫
syslanguages 主資料庫 語言
syslogins 主資料庫 登陸帳號信息
sysoledbusers 主資料庫 鏈接伺服器登陸信息
sysprocesses 主資料庫 進程
sysremotelogins主資料庫 遠程登錄帳號
syscolumns 每個資料庫 列
sysconstrains 每個資料庫 限制
sysfilegroups 每個資料庫 文件組
sysfiles 每個資料庫 文件
sysforeignkeys 每個資料庫 外部關鍵字
sysindexs 每個資料庫 索引
sysmenbers 每個資料庫 角色成員
sysobjects 每個資料庫 所有資料庫對象
syspermissions 每個資料庫 許可權
systypes 每個資料庫 用戶定義數據類型
select 列名=name from syscolumns where id=object_id(N'要查的表名')

熱點內容
java資料庫工具類 發布:2024-03-29 16:31:15 瀏覽:387
安卓機哪裡看型號 發布:2024-03-29 15:59:40 瀏覽:281
cad解壓錯誤 發布:2024-03-29 15:01:45 瀏覽:79
存儲指令集 發布:2024-03-29 14:39:27 瀏覽:649
資料庫表刪除數據 發布:2024-03-29 14:39:26 瀏覽:367
出c語言整除 發布:2024-03-29 14:28:22 瀏覽:572
芬尼壓縮機 發布:2024-03-29 14:24:11 瀏覽:464
電腦數據實時上傳本地伺服器軟體 發布:2024-03-29 14:07:57 瀏覽:920
尋秦記源碼 發布:2024-03-29 13:56:17 瀏覽:496
linux的備份命令 發布:2024-03-29 13:41:22 瀏覽:383