寫一個SQL存儲過程,建立一個表USER 字段是姓名,年齡,職位,權(quán)限,然后向里面插入6條數(shù)據(jù),然后查詢出年齡大于18的所有信息。
Create table user
(
Name varchar(20),
Age int,
Position varchar(20)
Quanxian varchar(20)
)
Insert into user values(‘111’,11,’11111’,’1111111’)
Insert into user values(‘112’,12,’11112’,’1111112’)
Insert into user values(‘113’,13,’11113’,’1111113’)
Insert into user values(‘114’,14,’11114’,’1111114’)
Insert into user values(‘115’,15,’11115’,’1111115’)
Insert into user values(‘116’,16,’11116’,’1111116’)
Create procedure selectUser
As
Select * from user where age >18
go