Professional Documents
Culture Documents
DBMS 02 DBD Relational Model
DBMS 02 DBD Relational Model
Pictorial Form
• A—B PK of either side relation can be introduced as FK in other relation with constrained on Referred PK
C―D 1―M c1 D(d1, d2, d3, d4, c1) Yes Yes Yes
A a1 a2 a3 a4 ta1
C c1 c2 c3 b1
B b1 b2 b3 b4 a1
D d1 d2 d3 d4 c1
G g1 g2 g3 g4
E e1 e2 e3 e4 e5 c1 EG g1 e1 r1 r2
F f1 f2 f3 EFH e1 f1 h1 k1 k2 k3 H h1 h2 h3
List ‘FCode’ who have taught ‘IT-261’ in term ‘S19’ OR have taught ‘IT-366’ in term ‘F18’
𝑹 = 𝝅𝑭𝑪𝒐𝒅𝒆 𝝈𝑪𝑪𝒐𝒅𝒆=′𝑰𝑻−𝟐𝟔𝟏′ ∧ 𝑻𝒆𝒓𝒎𝑰𝑫=′ 𝑺𝟏𝟗′ 𝑻𝒆𝒂𝒄𝒉 ∪ 𝝈𝑪𝑪𝒐𝒅𝒆=′𝑰𝑻−𝟑𝟔𝟔′ ∧ 𝑻𝒆𝒓𝒎𝑰𝑫=′ 𝑭𝟏𝟖′ 𝑻𝒆𝒂𝒄𝒉
𝑹 = 𝝅𝑭𝑪𝒐𝒅𝒆 𝝈 𝑪𝑪𝒐𝒅𝒆=′ 𝑰𝑻−𝟐𝟔𝟏′ ∧ 𝑻𝒆𝒓𝒎𝑰𝑫=′ 𝑺𝟏𝟗′ ∨ 𝑪𝑪𝒐𝒅𝒆=′ 𝑰𝑻−𝟑𝟔𝟔′ ∧ 𝑻𝒆𝒓𝒎𝑰𝑫=′ 𝑭𝟏𝟖′ 𝑻𝒆𝒂𝒄𝒉
SELECT FCode
FROM Teach
WHERE (CCode=‘IT-261’ AND TermID=‘S19’ ) OR (CCode=‘IT-366’ AND TermID=‘F18’ );
C.CustID FName LName City State Zip OrdID OrdDate Amount O.CustID
C.CustID FName LName City State Zip OrdID OrdDate Amount O.CustID
1 George Washington Mount Vernon VA 22121 1 07/04/1776 $234.56 1
2 John Adams Quincy MA 02169 3 05/23/1784 $124.00 2
3 Thomas Jefferson Charlottesville VA 22902 2 03/14/1760 $78.50 3
3 Thomas Jefferson Charlottesville VA 22902 4 09/03/1790 $65.50 3
5 07/21/1795 $25.50 10
6 11/27/1787 $14.40 9
C.CustID FName LName City State Zip OrdID OrdDate Amount O.CustID
1 George Washington Mount Vernon VA 22121 1 07/04/1776 $234.56 1
2 John Adams Quincy MA 02169 3 05/23/1784 $124.00 2
3 Thomas Jefferson Charlottesville VA 22902 2 03/14/1760 $78.50 3
3 Thomas Jefferson Charlottesville VA 22902 4 09/03/1790 $65.50 3
5 07/21/1795 $25.50 10
6 11/27/1787 $14.40 9
4 James Madison Orange VA 22960
5 James Monroe Charlottesville VA 22902