Baze podataka- SQL

Pozdrav ljudi....Treba mi pomoc... Poceo sam na faxu da radim Baze SQL pa bih bio jako zahvalan ako bi mi neko od vas pomogao da uradim ovaj zadatak....
Zadatak glasi :
Napisati spisak studenata koji su polozili i Osnove programiranja 1 ( OP1 ) i Osnove programiranja 2 ( OP2 ) i Baze SQL.
A tabele koje koristimo su :
Studenti( Br.Ind,Ime,Pol,Adresa,Datum upisa)
Predmeti(ID Predmeta,Naziv)
Smerovi(ID Smera,Naziv)
Ocene(Br.Ind,ID Predmeta,Ocena)
 
nesto ovako
Kod:
create database Fakultet

use Fakultet
go

create table Student(
ID_Studenta int primary key not null,
Br_Ind char(13) not null unique,
Ime nvarchar(60) null,
Pol bit not null,
Adresa nvarchar(100) null,
Datum_upisa date not null 
)

create table Predmet(
ID_Predmeta int primary key not null,
Naziv nvarchar(50)null,
)

create table Smer(
ID_Smera int primary key not null, 
Naziv nvarchar(20) null
)

create table Ocena(
Br_Ind char(13) not null,
ID_Predmeta int not null,
Ocena int not null,
foreign key (Br_Ind) references Student(Br_Ind),
foreign key (ID_Predmeta) references Predmet(ID_Predmeta)
)

insert into Student values('1','2a1/0118/10','Jovan Jovic', '1', 'Beograd Nemanjina 16', '11/9/2010')
insert into Student values('2','2a1/0198/10','Mika Mikic', '1', 'Beograd Kneza Milosa 116', '11/10/2010')
insert into Student values('3','2a1/0123/11','Pera Peric', '1', 'Beograd Cara Dusana 31', '11/10/2010')
insert into Student values('4','1a1/0131/11','Laza Lazic', '1', 'Beograd Kralja Aleksandra 29', '11/10/2010')
insert into Student values('5','1a1/0144/10','Zika Zikic', '1', 'Beograd Kneza Milosa 26', '11/10/2010')


insert into Predmet values('1','OP1')
insert into Predmet values('2','OP2')
insert into Predmet values('3','Baze SQL')

insert into Smer values('1','Inf tehnologije')

insert into Ocena values('2a1/0118/10','1','7')
insert into Ocena values('2a1/0118/10','2','8')
insert into Ocena values('2a1/0118/10','3','6')
insert into Ocena values('2a1/0198/10','1','5')
insert into Ocena values('2a1/0198/10','2','5')
insert into Ocena values('2a1/0198/10','3','7')

select Br_Ind from Ocena where Ocena>5 and ID_Predmeta=1 and ID_Predmeta=2 and ID_Predmeta=3
 
Poslednja izmena:

Back
Top