C# 利用mysql.data 在mysql中创建数据库及数据表 using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading.Tasks; using MySql.Data.MySqlClient; namespace CA_Mysql { class Program { static void Main(string[] args) {…
最近要查询一些数据库的基本情况,由于以前用oracle数据库比较多,现在换了MySQL数据库,就整理了一部分语句记录下来. 1.查询数据库表数量 #查询MySQL服务中数据库表数据量 SELECT COUNT(*) TABLES, table_schema FROM information_schema.TABLES GROUP BY table_schema; #查询指定数据库表数量 SELECT COUNT(*) TABLES, table_schema FROM information_s…
模糊查找db2数据库中的数据库表: select tabname,remarks from syscat.tables where TABNAME like 'DM%' select 'DROP TABLE DW_RPT.'||tabname||';' from syscat.tables where tabschema = CURRENT SCHEMA ----------------------------------------------------------------------…