Cartesian Product:
Person x Country
{
(1, “Linus”, “Rudbeck”, 27),
(2, “Jerome”, “Landre”, 103),
(3, “Mira”, “Pop”, 46)
}
The content of the table Country is:
{
(27, “Sweden”),
(46, “Romania”),
(103, “France”)
}
{
(1, ”Linus”, ”Rudbeck”, 27, 27, ”Sweden”),
(1, “Linus”, “Rudbeck”, 27, 46, “Romania”),
(1, “Linus”, “Rudbeck”, 27, 103, “France”),
(2, “Jerome”, “Landre”, 103, 27, “Sweden”),
(2, “Jerome”, “Landre”, 103, 46, “Romania”),
(2, “Jerome”, “Landre”, 103, 103, “France”),
(3, “Mira”, “Pop”, 46, 27, “Sweden”),
(3, “Mira”, “Pop”, 46, 46, “Romania”),
(3, “Mira”, “Pop”, 46, 103, “France”)
}
What is the generic name of the “rectangles” in ER diagrams?
Entity
What is the generic name of the “diamonds” in ER diagrams?
Relations
What is the generic name of the “ellipses” in ER diagrams?
Attributes
What is the generic name of the underlined elements in ER diagrams?
Primary key
What is the generic name of “0:”? Explain what “0”, “1” (not present in this diagram but possible in other diagrams) and “” represent in ER diagrams?
JSON:
[ ]
Array
JSON:
{ }
Object
JSON:
“key”:”value”
A key/value pair separated by :
JSON:
” “
A character string
JSON:
,
Separator between objects and key/value pairs
Please write the answer in the text box below and give an example of a movies variable in JSON containing an array of three movies, each movie has a “title”, a “director”, and a “year”, fill in the information of each book as “realistic” data:
{
“movies”: [
{“title”: “Inception”, “director”: “Chistopher Nolan”, “year”: 2010},
{“title”: “The Matrix”, “director”: “Lana Wachowski, Lilly Wachowski”, “year”: 1999},
{“title”: “Parasite”, “director”: “Bong Joon-ho”, “year”: 2019}
]
}
What do we need for 1NF?
What do we need for 2NF?
What do we need for 3NF?
What are the advantages to have a database in 3NF?
To avoid problems when you insert, delete and update
Closure:
We have the relation
R0 = {A, B, C, D, E, F}
and the functional dependencies
F0 = { {A} → {C}, {C} → {F}, {D,E} → {B}, {F} → {D, E} }
{A}+ = {A, C, F, D, E, B}
{B}+ = {B}
{C}+ = {C, F, D, E, B}
What does each letter of CRUD mean?
C = Create
R = Read
U = Update
D = Delete