程序師世界是廣大編程愛好者互助、分享、學習的平台,程序師世界有你更精彩!
首頁
編程語言
C語言|JAVA編程
Python編程
網頁編程
ASP編程|PHP編程
JSP編程
數據庫知識
MYSQL數據庫|SqlServer數據庫
Oracle數據庫|DB2數據庫
 程式師世界 >> 數據庫知識 >> MYSQL數據庫 >> MySQL綜合教程 >> 數據庫 SQL語句小結,sql語句小結

數據庫 SQL語句小結,sql語句小結

編輯:MySQL綜合教程

數據庫 SQL語句小結,sql語句小結


################ 根據舊表創建新表 ################
#1 只有全表結構,沒有數據
create table stu_new like stu
#2 創建部分屬性 ,不帶結構帶數據
create table stu_new1 as select id,name from stu
#3 創建部分屬性表,不帶結構不帶數據
create table stu_new2 as select id,name from stu where 1=0
################ 刪除表 ################
#1 刪除表,只刪除數據,主鍵繼續遞增
delete from stu
#2 刪除表,只刪除數據,主鍵重新編排
truncate table stu
#3 刪除表結構及數據
drop table stu

  1. 上一頁:
  2. 下一頁:
Copyright © 程式師世界 All Rights Reserved