简单的SQL语句_常用简单sql语句
简单的SQL语句由刀豆文库小编整理,希望给你工作、学习、生活带来方便,猜你可能喜欢“常用简单sql语句”。
use Test
Create table Student(ID int identity(1,1)primary key,[Name] nvarchar(50)not null)
Create Table Book(ID int identity(1,1)primary key,[Name] nvarchar(50)not null,StudentID int not null)
insert into Student values('ÕÅÈý')
insert into Student values('ÀîËÄ')
insert into Student values('ÍõÎå')
select * from student
--ÕÅÈý½èµÄÊé
insert into Book values('ºìÂ¥',1)
insert into Book values('´ó»°ºìÂ¥',1)
--ÀîËĽèµÄÊé
insert into Book values('Èý¹ú',2)
--ÍõÎåû½èÊé
--Ò»±¾´íÎóµÄ¼Ç¼
insert into Book values('´íÎóʱÔõÑùÁ·³ÉµÄ',111)
--×óÁ¬½Ó
select s.name,b.name from student as s
left join Book as b on s.id=b.studentid
--ÓÒÁ¬½Ó
select s.name,b.name from student as s
right join Book as b on s.id=b.studentid
《简单的SQL语句.docx》
将本文的Word文档下载,方便收藏和打印
推荐度:
点击下载文档
[其他范文]热门文章