SQLserver語句命令
Create database db001;
--創建表
Create table job(
id char(10)not null,name char(30)not null,address char(100)
);
--刪除表
drop table jobtable2;
--插入數值
use db0001
go
Insert into job values (‘1‘,‘2‘,‘3‘);
insert into job values (‘2‘,‘2‘,‘2‘);
--插入數值
use db001
insert into job values (‘2‘,‘2‘,‘2‘);
insert into job values (‘10001‘, ‘zhangsan‘, ‘sex‘);
--創建表
create table cjtb(id char(30),name char(30), sex char(30)
);
--插入數值
insert into cjtb values (‘10002‘, ‘zhangsan‘, ‘sex‘)
insert into cjtb values (‘10003‘, ‘zhangsan‘, ‘sex‘)
insert into cjtb values (‘10004‘, ‘zhangsan‘, ‘sex‘);
insert into cjtb (id,name,sex) values(‘10005‘,‘lisi‘,‘sex‘);
--修改數值
UPDATE cjtb SET name = ‘wangmazi‘ WHERE id = ‘6‘;
--查詢表
select * from cjtb;
--創建視圖
CREATE VIEW V_Customer
AS SELECT id, name, sex
FROM cjtb;
本文出自 “技術大牛幫你搞定” 博客,請務必保留此出處http://zhaoshilei.blog.51cto.com/6455149/1925101
SQLserver語句命令