Code: Select all
Room(number_room,id_typeRoom,building,floor,state_room)
Student(id_student,last_name,fist_name,address)
Worker(id_worker,lats_name,first_name,address)
Reservation(id_reservation,id_student,id_worker,day ,time,day_moveinto,day_moveout)
Thing_borrow(id_thing,name,money_advance,time)
Borrowing(id_borrowing,id_thing,day_borrow,day_return,id_student,id_worker)
Housing(number_pokoj,day_book,from_day,to_day,price)
Motion_money(id_motion,day,time,amount,type(receipt or dispentation))
Code: Select all
SELECT *
FROM student S,room R ,housing H
WHERE S.id_student = H.id_student
AND P.state_Room = 'contract'
IN (SELECT R.number_pokoj,R.state_room
FROM room R,housing H
WHERE R.number_room = H.number_room
);
Thanxxx much[/syntax]