⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 4_2.sql

📁 to study the example of creation of tables, formative DB, and filling with their information. Using
💻 SQL
字号:

--insert into Person 
--select 'SHEREMET','VICTORIYA','BATKOVNA','1','28 Aug 88','8-0562-38-17-26','0', (select id_country from Countries where country_name='Ukrain'),( select id_city from Cities where city_name='Dnipropetrovsk'), (select id_street from Streets where street_name='Kazakova'), '38',5
declare 
@var1 int,
@var2 int,
@var3 int,
@var4 varchar(10)

set @var1 = (select id_country 	from Countries	where country_name='Ukraine')
set @var2 =(select id_city 		from Cities			where city_name= 'Dnipropetrovsk')
set @var3 =(select id_street 		from Streets 		where street_name= 'Kazakova')
set @var4 = '38'


--Students in hostel 
select st_surname, left(st_name,1) as st_name, left(st_pname,1) as st_pname 
	from Person
where id_person = 
	(select id_person 
		from Person
			where id_country= @var1
		and id_city=@var2
		and id_street=@var3
		and	house =@var4
	)


⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -