462
правки
Изменения
→Примеры
== Примеры ==
Переменные:
S <font color = grey>:: </font> Students<font color = grey>; </font> G <font color = grey>:: </font> Groups<font color = grey>; </font> C <font color = grey>:: </font> Courses<font color = grey>; </font> P <font color = grey>:: </font> Point<font color = grey>;</font> G4 <font color = grey>:: </font> Groups where Name <font color = grey>=</font> <font color = green>'M34351' </font> ∨ Name <font color = grey>=</font> <font color = green>'M34371' </font> ∨ Name <font color = grey>=</font> <font color = green>'M34391'</font>
Полностью аттестованные группы:
select G<font color = grey>.</font>GId from G where ∀S <font color = grey>(</font>∀C <font color = grey>(</font>∃P <font color = grey>(</font>S<font color = grey>.</font>SId <font color = grey>= </font> P<font color = grey>.</font>SId ∧ C<font color = grey>.</font>CId <font color = grey>= </font> P<font color = grey>.</font>CId ∧ P<font color = grey>.</font>Points ≥ 60<font color = grey>)))</font>
Несколько отношений:
select S<font color = grey>.</font>FirstName<font color = grey>, </font> S<font color = grey>.</font>LastName<font color = grey>, </font> G<font color = grey>.</font>Name from S<font color = grey>, </font> G where S<font color = grey>.</font>GId <font color = grey>= </font> G<font color = grey>.</font>GId