NotesWhat is notes.io?

Notes brand slogan

Notes - notes.io

create trigger trg1

on Bolge
instead of delete
as
begin
declare @id int
select @id=BolgeID from deleted
update Bolgeler set BolgeID=3 where BolgeID=@id
delete from Bolge where BolgeID=@id

end

delete from Bolge where BolgeID=2


-----------------------------------------
create clustered index ind_adi
on TBL_DENEME(adi)



select * from TBL_DENEME Where adi='XEGZAP279860'


----------------------------------------------

DECLARE @i INT
DECLARE @deger INT
DECLARE @karakterset varchar(6) set @i=1

WHILE(@i <= 5000000)
BEGIN
set @deger=CAST(RAND()*1000000 as int)
set @karakterset=CHAR(RAND()*26+65)
+CHAR(rand()*26+65)+CHAR(rand()*26+65)
+CHAR(rand()*26+65)+CHAR(rand()*26+65)
+CHAR(rand()*26+65)
insert into TBL_DENEME values(@i,@karakterset+CAST(@deger as varchar(6)),
@karakterset+CAST(@deger as varchar(6)),'222 22 22')
SET @i=@i+1
END
---------------------------

create proc spKitapListele(@yayinNO nvarchar(5))
AS
BEGIN
select * from kitap
where yayinNO=@yayinNO
END

execute spKitapListele 5
select * from kitap

---------------------------------------------

create proc ppyazarListesi(@yazar nvarchar(5))
AS
BEGIN
select * from yazar
where id=@yazar
END

execute ppyazarListesi 5
select * from kitap

--------------------------------

create proc ppkitapyazar(@kitapno varchar(5))
as
begin
select kitap.*,yazar.* from kitap inner join
(kitapYazar inner join yazar on
yazar.yazarID=kitapYazar.yazarID)
on kitap.yayinNO=kitapYazar.yayinNO
where kitap.yayinNO=@kitapno
end

execute ppkitapyazar 5


-----------------------------------

create proc spyekle(@yazarid nvarchar (255),
@yazarad nvarchar (255),
@yazarsoyad nvarchar(255),
@yazarhakkinda nvarchar(255))
as
begin
insert into yazar values(@yazarid,@yazarad,@yazarsoyad,@yazarhakkinda)
end
execute spyekle 11,hakan,gencoglu,veritabanı
select * from yazar
----------------------------------

create proc spygüncelle
(@yazarid nvarchar(255),
@yazarad nvarchar(255),
@yazarsoyad nvarchar(255))
as
begin
update yazar set yazarAd=@yazarad,yazarSoyad=@yazarsoyad where yazarID=@yazarid
end

execute spygüncelle 7,samet,sarı
select * from yazar

-------------------------------------
create proc spsil
(@yazarid nvarchar (255))
as
begin
delete from yazar where
yazarID=@yazarid
end
execute spsil 7
select * from yazar






kitap,yazar

select * from kitap inner join yazar on kitap.kitap.id=yazar.id

---------------------------------------------------------------

ilk önce new queryde create database kurum yazıp calıstırıyoruz sonra kurumu calıstırıyoruz.


declare @isim varchar(10);
select @isim=Gorevli.Isim
from Gorevli where Gorevli.CalisanID=1
print 'ilgili kişi = '+@isim

----------------------------------------------Alttaki kod görevli tablosunu komple gösterir

select * from Gorevli
=====================================================alttaki kod eğer görevli tablosunda
calisanId'si 3 olan bir değer varsa çıktıları verir


if exists (select * from Gorevli where Gorevli.CalisanID=3)
begin
print 'id degeri 3 olan kayıt mevcut'
end
else
print 'id değeri 3 olan kayıt yok'

------------------------------------------------
declare @satirsayisi int
select @satirsayisi=COUNT(*)
from Gorevli;
if @satirsayisi>0
begin
print 'satır sayısı '
+CAST (@satirsayisi as varchar)+' dir'
end else print 'kayıt yoktur'
----------------------------------------------
declare @nakliyeciID int
declare @adet int
select @adet=COUNT (*)
from Satislar where
(CAST(Satislar.NakliyeUcreti as int)>100)

if(@adet>0)
begin
select @nakliyeciID=Satislar.ShipVia
from Satislar
where Satislar.NakliyeUcreti>100
select * from Nakliyeciler
inner join Satislar on
Nakliyeciler.NakliyeciID=Satislar.ShipVia
and Nakliyeciler.NakliyeciID
=@nakliyeciID
and Satislar.NakliyeUcreti>100
end else print 'veri yok'
---------------------------------------------
=============================================
select * from Gorevli where GorevID=16
select * from Gorev
--------------------------------------------

select Gorevli.Isim,GorevIsim
from Gorevli inner join Gorev on
Gorevli.GorevID=Gorev.GorevID

-------------------------------------------
create trigger tgorevsil on Gorev
instead of delete
as
begin
delete from Gorevli
from Gorevli g join deleted d
on t.gorevID=d.GorevID
delete from Gorev
from Gorevli t join deleted d on
t.GorevID=d.GorevID
select * from Gorev
select * from Gorevli
end

delete from Gorev where GorevID=12
     
 
what is notes.io
 

Notes.io is a web-based application for taking notes. You can take your notes and share with others people. If you like taking long notes, notes.io is designed for you. To date, over 8,000,000,000 notes created and continuing...

With notes.io;

  • * You can take a note from anywhere and any device with internet connection.
  • * You can share the notes in social platforms (YouTube, Facebook, Twitter, instagram etc.).
  • * You can quickly share your contents without website, blog and e-mail.
  • * You don't need to create any Account to share a note. As you wish you can use quick, easy and best shortened notes with sms, websites, e-mail, or messaging services (WhatsApp, iMessage, Telegram, Signal).
  • * Notes.io has fabulous infrastructure design for a short link and allows you to share the note as an easy and understandable link.

Fast: Notes.io is built for speed and performance. You can take a notes quickly and browse your archive.

Easy: Notes.io doesn’t require installation. Just write and share note!

Short: Notes.io’s url just 8 character. You’ll get shorten link of your note when you want to share. (Ex: notes.io/q )

Free: Notes.io works for 12 years and has been free since the day it was started.


You immediately create your first note and start sharing with the ones you wish. If you want to contact us, you can use the following communication channels;


Email: [email protected]

Twitter: http://twitter.com/notesio

Instagram: http://instagram.com/notes.io

Facebook: http://facebook.com/notesio



Regards;
Notes.io Team

     
 
Shortened Note Link
 
 
Looding Image
 
     
 
Long File
 
 

For written notes was greater than 18KB Unable to shorten.

To be smaller than 18KB, please organize your notes, or sign in.