mysql SQL语句大全
扫描二维码
随时随地手机看文章
1、说明:创建数据库
CREATE
DATABASE
database
-
name
2、说明:删除数据库
drop
database
dbname
3、说明:备份sql
server
---
创建 备份数据的 device
USE
master
EXEC
sp_addumpdevice
'disk'
,
'testBack'
,
'c:mssql7backupMyNwind_1.dat'
---
开始 备份
BACKUP
DATABASE
pubs
TO
testBack
4、说明:创建新表
create
table
tabname(col1
type1 [
not
null
]
[
primary
key
],col2
type2 [
not
null
],..)
根据已有的表创建新表:
A:
create
table
tab_new
like
tab_old
(使用旧表创建新表)
B:
create
table
tab_new
as
select
col1,col2…
<code class="sql keyword" style="white-space:pre-wrap; border:0px!important; bottom:auto!important; float:none!important; height:auto!important; left:auto!important; line-height:1.8em!important; margin:0px!important; outline:0px!important; overflow:visible!important; padding:0px!important; position:static!important; right:auto!important; top:auto!important; vertical-align:baseline!important; width:auto!important; font-family:Consolas,'Bitstream Vera Sans Mono','Courier New',Courier,monospace!important; min-height:inherit!important; color:rgb(0,0,255)!important; background:none!import