面试题:Sql Server的操作

来源:互联网 发布:淘宝关键词在哪里设置 编辑:程序博客网 时间:2024/05/21 10:18

题目:
题目
题目
答案如下:

(1)drop table Table1(2)create table Table1(Id int not null,name char(100),Age int,Dept char(20));(3)update Table2 set salary=(select Age from Table1 where Table1.id=Table2.id)(4)update Table1 set name=Table1.Age(5)select name,salary from Table1,Table2 where Table1.Id=Table2.Id(6)create view v asselect Dept from Table1group by Depthaving AVG(Age)>30(7)select distinct Dept from Table1order by Dept desc(8)alter table Table1 add address char(30) 
0 0
原创粉丝点击