NotesWhat is notes.io?

Notes brand slogan

Notes - notes.io

ödev2.2 veli bilgi sistemi

go

If Not Exists(Select * from sys.tables where name='veliler')
Begin
create table veliler
(
veliid int identity,
velitc varchar(11),
veliad varchar(50),
velisoyadi varchar(50),

Constraint PK_veli_VeliId primary key(veliid),
Constraint CK_veli_velitc Check (velitc LIKE '[1-9][0-9][0-9][0-9][0-9][0-9][0-9][0-9][0-9][0-9][0-9]'),
Constraint AN_veli_velitc unique (velitc),


)

End
Else
print 'Veli adında bir tablo mevcuttur...'
Go
If Not Exists(Select * from sys.tables where name='puan')
Begin
Create table puan
(
puanid Int Identity,
puan Int,
Constraint PK_puan_puanid primary key (puanid),
Constraint CK_puan_puan check (puan LIKE '0-100')
)
End
Else
print 'Puan adında bir tablo mevcuttur...'
go

If Not Exists(Select * from sys.tables where name='Sınıfogretmeni')
Begin
Create table Sınıfogretmeni
(
Sınıfogretmeniid Int Identity,
Sınıfogretmeniadi varchar(50),
Puanid Int,
constraint PK_Sınıfogretmeni_Sınıfogretmeniid primary key (Sınıfogretmeniid),
constraint FK_Sınıfogretmeni_Puanid foreign key (Puanid) references Puan(Puanid),

)
End
Else
print 'Sınıfogretmeni adında bir tablo mevcuttur...'
go

If Not Exists(Select * from sys.tables where name='Veliogretmenpuanlama')
Begin
Create table Veliogretmenpuanlama
(
VOPid Int Identity,
Veliid Int,
Puanid Int,
Sınıfogretmeniid Int,
Puantarihi Date,
Constraint PK_Veliogretmenpuanlama_VOPid primary key (VOPid),
Constraint FK_Veliogretmenpuanlama_Veliid foreign key (Veliid) references Veliler(Veliid),
Constraint FK_Veliogretmenpuanlama_Puanid foreign key (Puanid) references Puan(Puanid),
Constraint FK_Veliogretmenpuanlama_Sınıfogretmeniid foreign key (Sınıfogretmeniid) references Sınıfogretmeni(Sınıfogretmeniid),
)
End
Else
print 'Veliogretmenpuanlama adında bir tablo mevcuttur...'
go

If Not Exists(Select * from sys.tables where name='Okul')
Begin
Create table Okul
(
Okulid Int Identity,
Okuladi varchar(50),
Okultürü varchar(50),
constraint PK_Okul_Okulid primary key (Okulid)
)
End
Else
print 'Okul adında bir tablo mevcuttur...'
go

If Not Exists(Select * from sys.tables where name='Sınıf')
Begin
Create table Sınıf
(
Sınıfid Int Identity,
Sınıfadi varchar(10),
Sınıfogretmeniid Int,
Okulid Int,
constraint PK_Sınıf_Sınıfid primary key (Sınıfid),
constraint FK_Sınıf_Sınıfogretmeniid foreign key (Sınıfogretmeniid) references Sınıfogretmeni (Sınıfogretmeniid),
constraint FK_Sınıf_Okulid foreign key (Okulid) references Okul (Okulid)
)
End
Else
print 'Sınıf adında bir tablo mevcuttur...'
Go
If Not Exists(Select * from sys.tables where name='Dersler')
Begin
Create table Dersler
(
Dersid Int Identity,
Dersadi varchar(25),
Derssaati varchar(5),
Okulid Int,
constraint PK_Dersler_Dersid primary key (Dersid),
constraint FK_Dersler_Okulid foreign key (Okulid) references Okul(Okulid)
)
End
Else
print 'Dersler adında bir tablo mevcuttur...'
go


If Not Exists(Select * from sys.tables where name='Ogrenci')
Begin
Create table Ogrenci
(
Ogrenciid Int Identity,
Ogrencitc varchar(11),
Okulno varchar(25),
Ogrenciadi varchar(50),
Ogrencisoyadi varchar(50),
Sınıfid Int,
Dersid Int,
Veliid Int,
Sınıfogretmeniid Int,
constraint PK_Ogrenci_Ogrenciid primary key (Ogrenciid),
Constraint FK_Ogrenci_Sınıfid foreign key(Sınıfid) References Sınıf(Sınıfid),
Constraint FK_Ogrenci_Dersid foreign key(Dersid) References Dersler(Dersid),
Constraint FK_Ogrenci_Veliid foreign key (Veliid)References Veliler(Veliid),
Constraint FK_Ogrenci_Sınıfogretmeniid foreign key (Sınıfogretmeniid)References Sınıfogretmeni(Sınıfogretmeniid),
Constraint CK_Ogrenci_Ogrencitc Check (Ogrencitc LIKE '[1-9][0-9][0-9][0-9][0-9][0-9][0-9][0-9][0-9][0-9][0-9]'),
Constraint AN_Ogrenci_Okulno unique (Okulno),
Constraint AN_Ogrenci_Ogrencitc unique (Ogrencitc),
)
End
Else
print 'Ogrenci adında bir tablo mevcuttur...'

Go
If Not Exists(Select * from sys.tables where name='Brans')
Begin
Create table Brans
(
Bransid Int Identity,
Bransadi varchar(50),
constraint PK_Brans_Bransid primary key (Bransid)
)

End
Else
print 'Brans adında bir tablo mevcuttur...'
go

If Not Exists(Select * from sys.tables where name='Yetki')
Begin
Create table Yetki
(
Yetkiid Int Identity,
Yetkiadi varchar(50),
Constraint PK_Yetki_Yetkiid primary key (Yetkiid)
)
End
Else
print 'Yetki adında bir tablo mevcuttur...'
go

If Not Exists(Select * from sys.tables where name='Unvan')
Begin
Create table Unvan
(
Unvanid Int Identity,
Unvanadi varchar(50),
Yetkiid Int,
Constraint PK_Unvan_Unvanid primary key (Unvanid),
Constraint FK_Unvan_Yetkiid foreign key (Yetkiid) References Yetki(Yetkiid)
)
End
Else
print 'Unvan adında bir tablo mevcuttur...'
go

If Not Exists(Select * from sys.tables where name='Ogretmen')
Begin
Create table Ogretmen
(
Ogretmenid Int Identity,
Ogretmentc varchar(11),
Ogretmenadi varchar(50),
Ogretmensoyadi varchar(50),
Dogumtarihi date,
GorevBT date,
Bransid Int,
Dersid Int,
Sınıfid Int,
Okulid Int,
Unvanid Int,

constraint PK_Ogretmen_Ogretmenid primary key (Ogretmenid),
Constraint AN_Ogretmen_Ogretmentc unique (Ogretmentc),
Constraint CK_Ogretmen_Ogretmentc Check (Ogretmentc LIKE '[1-9][0-9][0-9][0-9][0-9][0-9][0-9][0-9][0-9][0-9][0-9]'),
Constraint FK_Ogretmen_Bransid foreign key(Bransid) References Brans(Bransid),
Constraint FK_Ogretmen_Dersid foreign key(Dersid) References Dersler(Dersid),
Constraint FK_Ogretmen_Sınıfid foreign key(Sınıfid) References Sınıf(Sınıfid),
Constraint FK_Ogretmen_Okulid foreign key(Okulid) References Okul(Okulid),
Constraint FK_Ogretmen_Unvanid foreign key(Unvanid) References Unvan(Unvanid),

)
End
Else
print 'Ogretmen adında bir tablo mevcuttur...'

Go
If Not Exists(Select * from sys.tables where name='OgrenciOgretmenPuanlama')
Begin
Create table OgrenciOgretmenPuanlama
(
OOPid Int Identity,
Ogrenciid Int,
Puanid Int,
Ogretmenid Int,
PuanTarihi Date,
Constraint PK_OgrenciOgretmenPuanlama_OOPid primary key (OOPid),
Constraint FK_OgrenciOgretmenPuankama_Ogrenciid foreign key (Ogrenciid) References Ogrenci(Ogrenciid),
Constraint FK_OgrenciOgretmenPuankama_Puanid foreign key (Puanid) References Puan(Puanid),
Constraint FK_OgrenciOgretmenPuankama_Ogretmenid foreign key (Ogretmenid) References Ogretmen(Ogretmenid),

)
End
Else
print 'OgrenciOgretmenPuanlama adında bir tablo mevcuttur...'
go

If Not Exists(Select * from sys.tables where name='Yonetici')
Begin
Create table Yonetici
(
Yoneticiid Int Identity,
Yoneticiadi Int,
Unvanid Int,
Constraint PK_Yonetici_Yoneticiid primary key (Yoneticiid),
Constraint FK_Yonetici_Unvanid foreign key (Unvanid) references Unvan (Unvanid)
)
End
Else
print 'Yonetici adında bir tablo mevcuttur...'
go

If Not Exists(Select * from sys.tables where name='YoneticiOgretmenPuanlama')
Begin
Create table YoneticiOgretmenPuanlama
(
YOPid Int Identity,
Yoneticiid Int,
Puanid Int,
Ogretmenid Int,
Puantarihi date,
Constraint PK_YoneticiOgretmenPuanlama_YOPid primary key (YOPid),
Constraint FK_YoneticiOgretmenPuanlama_Yoneticiid foreign key (Yoneticiid) references Yonetici (Yoneticiid),
Constraint FK_YoneticiOgretmenPuanlama_Puanid foreign key (Puanid) references Puan (Puanid),
Constraint FK_YoneticiOgretmenPuanlama_Ogretmenid foreign key (Ogretmenid) references Ogretmen (Ogretmenid)
)

End
Else
print 'YoneticiOgretmenPuanlama adında bir tablo mevcuttur...'
     
 
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.