1. 程式人生 > >mysql命令列查看錶結構,欄位等資訊 和 TRUNCATE TABLE

mysql命令列查看錶結構,欄位等資訊 和 TRUNCATE TABLE

mysql查看錶結構命令,如下:


desc 表名;
show columns from 表名;
describe 表名;
show create table 表名;


use information_schema
select * from columns where table_name='表名';


順便記下:
show databases;
use 資料庫名;
show tables;


建立資料庫

create database abc;

====================

1.DELETE
 ・DML語言
 ・可以回退
 ・可以有條件的刪除

     DELETE FROM 表名
   WHERE 條件

2.TRUNCATE TABLE
 ・DDL語言
 ・無法回退
 ・預設所有的表內容都刪除
 ・刪除速度比delete快。

   TRUNCATE TABLE 表名