Задание 3. Реляционная логика Согласно варианту (см. табл. 4):
удалить из отношений r1 и r2 (см. табл. 3) четыре пары (столбец, строка) и сформировать из оставшихся строк и столбцов отношения индивидуального задания (r1 и r2); имена атрибутов при этом не изменять, выполнить операции (r1r2), (r1r2), (r1\r2), (r1r2): написать формулы реляционной алгебры, реляционного исчисления с переменными-кортежами, составить таблицы, выполнить операции, представленные в графе 3 табл. 4:написать формулы реляционной алгебры, реляционного исчисления с переменными-кортежами, составить таблицы для операций >< или >θ< (в зависимости от варианта), δ, π.
Таблица3а Таблица 3b
r1
| A1
| A2
| A3
| A4
| A5
| A6
| A7
| A8
|
| r2
| A1
| A2
| A3
| A4
| A5
| A6
| A7
| A8
|
| a1
| b2
| c3
| d4
| 1
| 2
| 3
| 4
|
|
| a1
| b2
| c3
| d4
| 1
| 2
| 3
| 4
| a2
| b3
| c4
| d1
| 2
| 3
| 4
| 1
|
| a2
| b3
| c4
| d1
| 2
| 3
| 4
| 1
| a3
| b4
| c1
| d2
| 3
| 4
| 1
| 2
|
| a3
| b4
| c1
| d2
| 3
| 4
| 1
| 2
| a4
| b1
| c2
| d3
| 4
| 1
| 2
| 3
|
| a4
| b1
| c2
| d3
| 4
| 1
| 2
| 3
| a1
| b1
| c1
| d1
| 4
| 3
| 2
| 1
|
| a1
| b1
| c1
| d1
| 4
| 3
| 2
| 1
| a2
| b2
| c2
| d2
| 3
| 2
| 1
| 4
|
| a2
| b2
| c2
| d2
| 3
| 2
| 1
| 4
| a3
| b3
| c3
| d4
| 2
| 1
| 4
| 3
|
| a3
| b3
| c3
| d4
| 2
| 1
| 4
| 3
| a4
| b4
| c4
| d4
| 1
| 4
| 3
| 2
|
| a4
| b4
| c4
| d4
| 1
| 4
| 3
| 2
|
Таблица 4
Ва-ри-
ант
| Удалить
(столбец,строка)
| Выполнить заданные операции
| 1
| 2
| 3
| 1
| r1:(3,1),(4,2),(7,8),(8,6)
r2:(3,3),(4,5),(7,6),(8,8)
| (r1.A1,r2.A5,r2.A6)(((r1><r2, r1.A6r2.A6), r2.A51 and r2.A61))
| 2
| r1:(3,5),(4,2),(7,6),(8,8)
r2:(3,2),(4,5),(7,3),(8,4)
| (r1.A5, r2.A2, r2.A5(((r1><r2, r1.A2=r2.A2), r1.A52 and r2.A54))
| 3
| r1:(3,4),(4,2),(7,6),(8,8)
r2:(3,2),(4,4),(7,1),(8,5)
| (r1.A5,r2.A5,r2.A6)(((r1><r2, r1.A6r2.A5), r1.A52 and r2.A52))
| 4
| r1:(3,1),(4,3),(7,6),(8,8)
r2:(3,3),(4,1),(7,4),(8,5)
| (r1.A2,r1.A5,r2.A2)(((r1><r2, r1.A5r2.A5), r1.A2=b1 and r1.A2=b2))
| 5
| r1:(3,1),(4,2),(7,7),(8,8)
r2:(3,3),(4,1),(7,6),(8,7)
| (r1.A1,r1.A6, r2.A5)(((r1><r2, r1.A6r2.A5), r1.A1=a3 and r1.A1=a4))
| 6
| r1:(3,5),(4,2),(7,6),(8,8)
r2:(3,1),(4,4),(7,6),(8,8)
| (r1.A6, r1.A2, r2.A5)(((r1><r2, r1.A2=r2.A2), r2.A62 and r2.A52))
| 7
| r1:(3,5),(4,2),(7,6),(8,8)
r2:(3,1),(4,5),(7,6),(8,3)
| (r1.A1, r1, A2,r2.A1)(((r1><r2, r1.A1=r2.A1), r1.A1=a3 and r1.A1=a4))
| 8
| r1:(3,1),(4,2),(7,6),(8,8)
r2:(3,2),(4,3),(7,5),(8,8)
| (r1.A1,r2,A1,r2.A6)(((r1><r2, r1.A5r2.A6), r1.A1=a3 and r2.A1=a4))
| 9
| r1:(3,1),(4,2),(7,5),(8,8)
r2:(3,4),(4,1),(7,5),(8,6)
| (r1.A5,r1.A6,r2.A6)(((r1><r2, r1.A6r2.A6), r1.A51 and r2.A51))
| 10
| r1:(3,1),(4,2),(7,6),(8,8)
r2:(3,2),(4,3),(7,8),(8,5)
| (r1.A1,r1.A5,r2.A5)(((r1><r2, r1.A5 r2.A5), r1.A1=a3 and r2.A62))
| 11
| r1:(3,1),(4,3),(7,5),(8,8)
r2:(3,3),(4,6),(7,4),(8,8)
| (r1.A5,r2.A5,r2.A6)(((r1><r2, r1.A6=r2.A6), r1.A52 and r2.A54))
| 12
| r1:(3,1),(4,2),(7,5),(8,7)
r2:(3,2),(4,4),(7,3),(8,7)
| (r1.A1,r2.A5,r1.A5)(((r1><r2, r1.A5r2.A5), r1.A1=a3 and r2.A52))
| 13
| r1:(3,1),(4,2),(7,5),(8,6)
r2:(3,6),(4,2),(7,3),(8,4)
| (r1.A1,r2.A5,r1.A5,)(((r1><r2, r1.A5r2.A6), r1.A1=a3 and r2.A52))
| 14
| r1:(3,1),(4,2),(7,5),(8,8)
r2:(3,8),(4,4),(7,1),(8,3)
| (r1.A1,r1.A5,r2.A5)(((r1><r2, r1.A5r2.A5), r1.A52 and r2.A62))
| 15
| r1:(3,1),(4,2),(7,5),(8,8)
r2:(3,2),(4,7),(7,1),(8,3)
| (r1.A1,r2.A1,r2.A6)(((r1><r2, r1.A5=r2.A6), r1.A1=a3 and r2.A1=a4))
| 16
| r1:(3,1),(4,2),(7,4),(8,8)
r2:(3,8),(4,5),(7,2),(8,6)
| (r1.A6,r2.A1,r2.A6)(((r1><r2, r1.A6r2.A6), r2.A1=a2 and r1.A52))
| 17
| r1:(3,1),(4,2),(7,4),(8,8)
r2:(3,8),(4,3),(7,2),(8,6)
| (r1.A5,r2.A5,r2.A1)(((r1><r2, r2.A53), r1.A5=1 and r2.A52))
| 18
| r1:(3,1),(4,2),(7,4),(8,8)
r2:(3,4),(4,8),(7,3),(8,5)
| (r1.A1,r1.A2,r2.A2)(((r1><r2, r1.A2r2.A2), r1.A1a2 and r2.A53))
| 19
| r1:(3,3),(4,4),(7,5),(8,7)
r2:(3,1),(4,4),(7,6),(8,7)
| (r1.A6.r2.A6,r2.A5)(((r1><r2, r1.A6 r2.A6), r1.A1a3 and r2.A52))
| 20
| r1:(3,3),(4,5),(7,4),(8,7)
r2:(3,3),(4,2),(7,4),(8,6)
| (r1.A1,r2.A2,r2.A5)(((r1><r2, r1.A2=r2.A2), r1.A1a2 and r2.A51))
| 21
| r1:(3,3),(4,6),(7,4),(8,8)
r2:(3,5),(4,8),(7,6),(8,1)
| (r1.A1, r2.A5, r1.A5)(((r1><r2, r1.A5=r2.A5), r1.A1a2 and r2.A53))
| 22
| r1:(3,3),(4,6),(7,4),(8,8)
r2:(3,6),(4,4),(7,1),(8,2)
| (r1.A1,r1.A5,r2.A5)(((r1><r2, r1.A5r2.A5), r1.A1a3 and r2.A52))
| 23
| r1:(3,1),(4,2),(7,4),(8,8)
r2:(3,2),(4,5),(7,3),(8,8)
| (r1.A1,r1.A5,r2.A5)(((r1><r2, r1.A5r2.A6), r1.A1a2 and r2.A53))
| 24
| r1:(3,1),(4,2),(7,3),(8,8)
r2:(3,3),(4,8),(7,4),(8,5)
| (r1.A1,r1.A6,r2.A6)(((r1><r2, r1.A6=r2.A6), r2.A1a2 and r2.A52))
| 25
| r1:(3,1),(4,2),(7,3),(8,6)
r2:(3,3),(4,4),(7,1),(8,7)
| (r1.A1,r1.A5,r2.A5)((((r1><r2, r2.A5r1.A5), r1.A1a3 and r2.A62))
| 26
| r1:(3,1),(4,2),(7,4),(8,7)
r2:(3,2),(4,5),(7,6),(8,7)
| (r2.A2, r1A5, r2.A6)(((r1><r2, r1.A5=r2.A6), r2.A2b3 and r2.A62))
| 27
| r1:(3,1),(4,2),(7,3),(8,7)
r2:(3,3),(4,4),(7,2),(8,5)
| (r1.A5, r2.A5,r1.A6)(((r1><r2, r1.A5r2.A5), r1.A62 and r2.A64))
| 28
| r1:(3,1),(4,2),(7,3),(8,7)
r2:(3,3),(4,4),(7,6),(8,7)
| ( r1.A1,r1A6,r2.A6)(((r1><r2, r1.A6r2.A6), r1.A1a2 and r2.A64))
| 29
| r1:(3,1),(4,2),(7,3),(8,7)
r2:(3,3),(4,4),(7,1),(8,6)
| ( r2.A2, r2.A5, r1.A6)(((r1><r2, r1.A5=r2.A6), r1.A2b3 and r2.A52))
| 30
| r1:(3,1),(4,2),(7,5),(8,7)
r2:(3,5),(4,4),(7,2),(8,6)
| (r1.A6, r2A6, r1.A1)(((r1><r2, r1.A63 and r2.A63), r1.A1a4))
| 31
| r1:(3,1),(4,2),(7,5),(8,6)
r2:(3,6),(4,4),(7,3),(8,1)
| (r1.A5,r2.A6,r1.A1)(((r1><r2, r1.A5r2.A6), r1.A1a2 and r2.A1a3))
| 32
| r1:(3,1),(4,2),(7,3),(8,6)
r2:(3,3),(4,5),(7,8),(8,6)
| (r1.A1,r2.A1,r1.A6)(((r1><r2, r1.A6=r2.A6), r1.A1a3 and r2.A1a3))
| 33
| r1:(3,1),(4,2),(7,3),(8,6)
r2:(3,3),(4,4),(7,1),(8,7)
| (r1.A6,r2.A6, r1.A2)(((r1><r2, r1.A63 and r2.A63), r1.A2b2))
| 34
| r1:(3,1),(4,2),(7,3),(8,6)
r2:(3,3),(4,4),(7,7),(8,1)
| (r1.A1,r2.A5,r2.A1)(((r1><r2, r1.A5=r2.A5), r1.A1a3 and r2.A1a3))
| 35
| r1:(2,1),(4,2),(7,3),(8,6)
r2:(2,3),(4,5),(7,7),(8,1)
| (r1.A3,r2.A3,r2.A6)(((r1><r2, r1.A6=r2.A6), r1.A3c1 and r2.A3c1))
| 36
| r1:(1,1),(2,2),(5,7),(6,8)
r2:(1,7),(2,3),(5,4),(6,8)
| (r1.A7,r2.A8, r2.A4)(((r1><r2, r1.A7r2.A8), r1.A4d1 and r2.A4c1))
| 37
| r1:(1,1),(2,2),(5,7),(6,8)
r2:(1,7),(2,3),(5,6),(6,7)
| (r1.A3,r2.A3,r1.A8)(((r1>2, r1.A3=r2.A3), r1.A3c1 and r2. A3c1))
| 38
| r1:(3,1),(4,2),(7,3),(8,6)
r2:(3,3),(4,4),(7,5),(8,6)
| (r1.A1,r2.A1,r1.A6)(((r1>2, r1.A6=r2.A6), r1.A1a3 and r2.A1a3))
| 39
| r1:(1,1),(2,2),(5,7),(6,8)
r2:(1,8),(2,3),(5,4),(6,2)
| (r1.A3,r2.A7,r1.A7)(((r1>2, r1.A7r2.A7), r1.A3c2 and r2.A72))
| 40
| r1:(1,1),(2,2),(5,7),(6,8)
r2:(1,7),(2,2),(5,4),(6,5)
| (r1.A3, r1.A8, r2.A8) (((r1>2, r1.A8r2.A8), r1.A3c1 and r2.A82))
| 41
| r1:(1,1),(2,2),(5,7),(6,8)
r2:(1,8),(2,3),(5,6),(6,1)
| (r1.A3,r2.A3,r1.A7)(((r1>2, A7=r1.A8), r1.A3c2 and r2.A3c3))
| 42
| r1:(1,1),(2,2),(5,7),(6,8)
r2:(1,8),(2,4),(5,6),(6,2)
| (r1.A7,r.1,A4, r2.A7) (((r1>2, r1.A4=r2.A4), r1.A72 and r2.A74))
| 43
| r1:(1,1),(2,2),(5,7),(6,8)
r2:(1,1),(2,3),(5,4),(6,2)
| (r1.A3,r1.A7,r2.A7)(((r1>2,r1.A7r2.A7), r1.A3=c2 and r2.A84))
| 44
| r1:(1,1),(2,2),(5,7),(6,8)
r2:(1,8),(2,3),(5,6),(6,1)
| (r1.A3, r1.A7, r2.A7)(((r1>2, r1.A7r2.A7), r1.A3=c3 and r2.A82))
| 45
| r1:(1,1),(2,2),(5,7),(6,8)
r2:(1,7),(2,4),(5,6),(6,8)
| (r1.A3,r2.A7,r1.A7)(((r1>2, r1.A72 and r2.A74),r1.A3c1))
| 46
| r1:(1,1),(2,2),(5,7),(6,8)
r2:(1,7),(2,5),(5,3),(6,2)
| (r1.A3, r1.A7, r2.A7)(((r1>2, r1.A7r2.A7), r1.A3c2 and r2.A3c3))
| 47
| r1:(1,1),(2,2),(5,7),(6,8)
r2:(1,2),(2,3),(5,4),(6,7)
| (r1.A3,r2.A8,r1.A8)(((r1>2, r1.A8r2.A8), r1.A3=c2 and r2.A3c3))
| 48
| r1:(1,1),(2,2),(5,7),(6,8)
r2:(1,2),(2,3),(5,5),(6,8)
| (r1.A3, r2.A3, r2.A7)(((r1>2, r1.A7r2.A7), r2.A74 and r1.A3c1))
| 49
| r1:(1,1),(2,2),(5,7),(6,8)
r2:(1,2),(2,6),(5,4),(6,8)
| (r1.A4,r2.A7,r1.A7)(((r1>2, r1.A7r2.A7), r1.A4=d1 and r2.A4d4))
| 50
| r1:(1,1),(2,2),(5,7),(6,8)
r2:(1,2),(2,4),(5,6),(6,7)
| (r1.4, r2.A4, r2.A3)(((r1>2, r1.A4r2.A4), r1.A3c1 and r2.A3c1))
| |