Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Empty file added Extension 1.sql
Empty file.
Empty file added Extension 1.sql.tag
Empty file.
Empty file added Extension 2.sql
Empty file.
Empty file added Extension 2.sql.tag
Empty file.
4 changes: 4 additions & 0 deletions Extension 3.sql
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
SELECT ARRAY[CONCAT(name, ':', CAST(COUNT(name) AS CHAR))] from films_ext f
INNER JOIN directors d
ON f.directorId = d.id
GROUP BY d.name, f.title;
Empty file added Extension 3.sql.tag
Empty file.
49 changes: 49 additions & 0 deletions Standard Criteria 2.sql
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@

SELECT * FROM films;


SELECT * FROM films
ORDER BY (score) DESC;



SELECT * FROM films
ORDER BY (release_year) DESC;


SELECT * FROM films
WHERE (score) >= 8;

SELECT * FROM films
WHERE (score) <= 7;


SELECT * FROM films
WHERE (release_year) = 1990;

SELECT * FROM films
WHERE (release_year) < 2000;

SELECT * FROM films
WHERE (release_year) > 1990;

SELECT * FROM films
WHERE (release_year) > 1990 AND (release_year) < 1999;

SELECT * FROM films
WHERE (genre) = 'SciFi';

SELECT * FROM films
WHERE (genre) = 'SciFi' OR (genre) = 'Western';


SELECT * FROM films
WHERE NOT (genre) = 'SciFi';

SELECT * FROM films
WHERE (genre) = 'Western' AND (release_year) < 2000;

SELECT * FROM films
WHERE (title) LIKE '%Matrix%';


Empty file added Standard Criteria 2.sql.tag
Empty file.
27 changes: 27 additions & 0 deletions Standard Criteria.sql
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
CREATE TABLE films (
id SERIAL,
title VARCHAR (50) UNIQUE,
genre VARCHAR(30),
release_year INT,
score INT,
PRIMARY KEY (id)
);

INSERT INTO FILMS (title, genre, release_year, score)
VALUES
('The Shawshank Redemption', 'Drama', 1994, 9),
('The Godfather', 'Crime', 1972, 9),
('The Dark Knight', 'Action', 2008, 9),
('Alien', 'SciFi', 1979, 9),
('Total Recall', 'SciFi', 1990, 8),
('The Matrix', 'SciFi', 1999, 8),
('The Matrix Resurrections', 'SciFi', 2021, 5),
('The Matrix Reloaded', 'SciFi', 2003, 6),
('The Hunt for Red October', 'Thriller', 1990, 7),
('Misery', 'Thriller', 1990, 7),
('The Power Of The Dog', 'Western', 2021, 6),
('Hell or High Water', 'Western', 2016, 8),
('The Good the Bad and the Ugly', 'Western', 1966, 9),
('Unforgiven', 'Western', 1992, 7);


Empty file added Standard Criteria.sql.tag
Empty file.