Ответы на экзамен по Delphi
Voprosy_dlya_ekzamena_po_programmirovani
Microsoft Word документ 3.9 MB

ЗАЧЕТ ПО ХМЕЛЬНОВУ

https://www.dropbox.com/s/l2slg06ds7eg5p6/Delphi.rar

Вопросы и задания по MSSQL
Билеты по курсу MS SQL.htm.html
HTML документ 84.6 KB

http://hmelnov.icc.ru/stud/MSSQL/Exam

2 вариант

 

select a.vToyName,a.mToyRate, b.cBrandName,
'avg(Marka)'=(select avg(mToyRate) from user5.Toys where cBrandId=a.cBrandId group by cBrandId)
from user5.Toys a,user5.ToyBrand b
where (mToyRate>(
select avg(mToyRate) from user5.Toys where cBrandId=a.cBrandId)and (a.cBrandId=b.cBrandId))
order by a.cBrandId, mToyRate


6 вариант

create TRIGGER trgToyDel

on Toys
after delete
as
begin
update OrderDetail
set cToyId = 'NULL'
from OrderDetail o join Deleted d on
o.cToyId = d.cToyId
end
return
select * from OrderDetail;
select * from Deleted
delete from Toys
where cToyId = '000007';
select * from Toys where cToyId = '000001';


7 вариант

DECLARE @Mark char(25)
DECLARE @Name char(25)
DECLARE @sameMark char(25);
DECLARE curToy cursor for
SELECT T.vToyName, B.cBrandName FROM ToyBrand B join Toys T on T.cBrandId = B.cBrandId
order by B.cBrandName
OPEN curToy
set @sameMark = '';
FETCH curToy into @Name, @Mark
While (0 = 0)
BEGIN
if (@@fetch_status = -2) continue;
if (@@fetch_status <>0) break;
if @sameMark <> @Mark
begin
Print 'BRAND = ' + @Mark
set @SameMark = @Mark
end
Print ' ' + @Name
FETCH curToy into @Name, @Mark
END
CLOSE curToy
DEALLOCATE curToy

eTXT