CS157a
Chris Pollett
Oct 30, 2023
LongMovie(t,y) <- Movies(t,y,l,g,s,p), l ≥ 100 .
A|B --- 1|2 3|4as it asserts that (1,2) is in R and and (3,4) is in R. In datalog terminology it asserts that R(1,2) is true.
A|B --- 1|2 1|2and `S(B,C)` is given by
B|C --- 2|3 4|5 4|5then we can compute `H` as
1|3 1|3by treating the two rows of `R` as distinct when trying to satisfy the clause.
Which of the following is true?
SELECT list_of_columns FROM list_of_tables WHERE some_condition;
Movies(title, year, length, genre, studioName, producerC#)then to return all movies produced by Disney Studios in 1990, we could write:
SELECT * FROM MOVIES WHERE studioName = 'Disney' AND year = 1990;
SELECT title, length FROM MOVIES WHERE studioName = 'Disney' AND year = 1990;
SELECT title AS name, length*0.016667 AS lengthInHours FROM MOVIES WHERE studioName = 'Disney' AND year = 1990;
(year - 1930) * (year - 1930) < 100
SELECT title FROM Movies WHERE (year > 1970 OR length < 90) AND studioName = 'MGM';
SELECT title FROM Movies WHERE title LIKE 'Star ____';whould also title to match 'Star Wars'.
SELECT title FROM Movies WHERE title LIKE '%''s%';
SELECT * FROM MOVIES WHERE studioName = 'Disney' AND year = 1990 ORDER BY length, title;