gopeshravi
commited on
Commit
•
1419886
1
Parent(s):
a96921e
Upload 3 files
Browse files- data/films.db +0 -0
- data/training_data.csv +116 -0
- data/training_data_refined.csv +90 -0
data/films.db
ADDED
Binary file (28.7 kB). View file
|
|
data/training_data.csv
ADDED
@@ -0,0 +1,116 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
description,query
|
2 |
+
"List all films in the database.","SELECT * FROM films;"
|
3 |
+
"Retrieve the details of a specific film by its ID.","SELECT * FROM films WHERE id = 1;"
|
4 |
+
"Retrieve the details of films released in a specific year.","SELECT * FROM films WHERE release_year = 2022;"
|
5 |
+
"Retrieve the details of films with a rating higher than a certain value.","SELECT * FROM films WHERE rating > 4.0;"
|
6 |
+
"Retrieve the details of films with a review containing specific keywords.","SELECT * FROM films WHERE review LIKE '%great%';"
|
7 |
+
"Retrieve the details of films watched at a specific time.","SELECT * FROM films WHERE watched_time = '2022-01-01';"
|
8 |
+
"Retrieve the number of films in the database.","SELECT COUNT(*) FROM films;"
|
9 |
+
"Retrieve the average rating of all films in the database.","SELECT AVG(rating) FROM films;"
|
10 |
+
"Retrieve the details of the top 10 highest-rated films.","SELECT * FROM films ORDER BY rating DESC LIMIT 10;"
|
11 |
+
"Retrieve the details of films released after a certain year.","SELECT * FROM films WHERE release_year > 2020;"
|
12 |
+
"Retrieve the details of films with a rating within a specific range.","SELECT * FROM films WHERE rating BETWEEN 3.0 AND 4.5;"
|
13 |
+
"Retrieve the details of films with a specific name.","SELECT * FROM films WHERE film_name = 'The Matrix';"
|
14 |
+
"Retrieve the highest rating among all films.","SELECT MAX(rating) FROM films;"
|
15 |
+
"Retrieve the lowest release year among all films.","SELECT MIN(release_year) FROM films;"
|
16 |
+
"Retrieve the total count of films watched.","SELECT COUNT(*) FROM films WHERE watched_time IS NOT NULL;"
|
17 |
+
"Calculate the average rating of films released after 2000.","SELECT AVG(rating) FROM films WHERE release_year > 2000;"
|
18 |
+
"Count the number of films released each year.","SELECT release_year, COUNT(*) FROM films GROUP BY release_year;"
|
19 |
+
"Calculate the total sum of ratings for all films.","SELECT SUM(rating) FROM films;"
|
20 |
+
"Find the average rating of films watched in 2022.","SELECT AVG(rating) FROM films WHERE strftime('%Y', watched_time) = '2022';"
|
21 |
+
"Retrieve the number of films with a review containing more than 100 characters.","SELECT COUNT(*) FROM films WHERE LENGTH(review) > 100;"
|
22 |
+
"Calculate the total count of films watched per month.","SELECT strftime('%m', watched_time) AS month, COUNT(*) FROM films WHERE watched_time IS NOT NULL GROUP BY month;"
|
23 |
+
"Retrieve the release year with the highest number of films.","SELECT release_year, COUNT(*) FROM films GROUP BY release_year ORDER BY COUNT(*) DESC LIMIT 1;"
|
24 |
+
"Calculate the average rating of films released in each year.","SELECT release_year, AVG(rating) FROM films GROUP BY release_year;"
|
25 |
+
"Find the year with the highest average rating.","SELECT release_year, AVG(rating) FROM films GROUP BY release_year ORDER BY AVG(rating) DESC LIMIT 1;"
|
26 |
+
"Retrieve the number of films released in the last decade.","SELECT COUNT(*) FROM films WHERE release_year BETWEEN 2014 AND 2024;"
|
27 |
+
"Calculate the total count of films with non-null ratings.","SELECT COUNT(*) FROM films WHERE rating IS NOT NULL;"
|
28 |
+
"Retrieve the details of films with a rating higher than the average rating of all films.","SELECT * FROM films WHERE rating > (SELECT AVG(rating) FROM films);"
|
29 |
+
"Retrieve the details of films released after the year of the film with the highest rating.","SELECT * FROM films WHERE release_year > (SELECT release_year FROM films ORDER BY rating DESC LIMIT 1);"
|
30 |
+
"Retrieve the details of films with a rating higher than the average rating of films released in 2022.","SELECT * FROM films WHERE rating > (SELECT AVG(rating) FROM films WHERE release_year = 2022);"
|
31 |
+
"Retrieve the details of films with a rating higher than the lowest rating of films released in 2022.","SELECT * FROM films WHERE rating > (SELECT MIN(rating) FROM films WHERE release_year = 2022);"
|
32 |
+
"Retrieve the details of films released in the same year as 'The Matrix'.",SELECT * FROM films WHERE release_year = (SELECT release_year FROM films WHERE film_name = 'The Matrix');"
|
33 |
+
"Retrieve the details of films with a rating higher than the average rating of films released in the same year as 'The Matrix'.","SELECT * FROM films WHERE rating > (SELECT AVG(rating) FROM films WHERE release_year = (SELECT release_year FROM films WHERE film_name = 'The Matrix'));"
|
34 |
+
"Retrieve the details of films with a rating higher than the average rating of films watched on January 1, 2022.","SELECT * FROM films WHERE rating > (SELECT AVG(rating) FROM films WHERE strftime('%Y-%m-%d', watched_time) = '2022-01-01');"
|
35 |
+
"Retrieve the details of films released in the same year as the film with the lowest rating.","SELECT * FROM films WHERE release_year = (SELECT release_year FROM films WHERE rating = (SELECT MIN(rating) FROM films));"
|
36 |
+
"Retrieve the details of films with a rating higher than the average rating of films released after 2000.","SELECT * FROM films WHERE rating > (SELECT AVG(rating) FROM films WHERE release_year > 2000);"
|
37 |
+
"Retrieve the details of films with a rating higher than the average rating of films released before 2000.","SELECT * FROM films WHERE rating > (SELECT AVG(rating) FROM films WHERE release_year < 2000);"
|
38 |
+
"Retrieve the details of films with release years formatted as 'YYYY-MM-DD'.","SELECT film_name, strftime('%Y-%m-%d', release_year) AS formatted_release_year FROM films;"
|
39 |
+
"Retrieve the details of films with their names converted to uppercase.","SELECT UPPER(film_name) FROM films;"
|
40 |
+
"Retrieve the details of films with their release years shifted by 5 years into the future.","SELECT film_name, release_year + 5 AS future_release_year FROM films;"
|
41 |
+
"Retrieve the details of films with their ratings rounded to the nearest integer.","SELECT ROUND(rating) FROM films;"
|
42 |
+
"Retrieve the details of films with their review lengths calculated.","SELECT film_name, LENGTH(review) AS review_length FROM films;"
|
43 |
+
"Retrieve the details of films with their review contents replaced with 'No review available' if the review is null.","SELECT film_name, COALESCE(review, 'No review available') AS review_content FROM films;"
|
44 |
+
"Retrieve the details of films with their ratings multiplied by 2.","SELECT film_name, rating * 2 AS multiplied_rating FROM films;"
|
45 |
+
"Retrieve the details of films with their release years truncated to the nearest decade.","SELECT film_name, CAST(release_year / 10 * 10 AS INTEGER) AS truncated_release_year FROM films;"
|
46 |
+
"Retrieve the details of films with their ratings ranked in descending order.","SELECT film_name, rating, RANK() OVER (ORDER BY rating DESC) AS rating_rank FROM films;"
|
47 |
+
"Retrieve the details of films with their release years converted to Julian day numbers.","SELECT film_name, julianday(release_year) AS julian_release_year FROM films;"
|
48 |
+
"List films with release years formatted as 'YYYY-MM-DD'.","SELECT film_name, strftime('%Y-%m-%d', release_year) AS formatted_release_year FROM films;"
|
49 |
+
"Fetch films with their names converted to uppercase.","SELECT UPPER(film_name) FROM films;"
|
50 |
+
"Retrieve films with release years shifted by 5 years into the future.","SELECT film_name, release_year + 5 AS future_release_year FROM films;"
|
51 |
+
"Show films with ratings rounded to the nearest integer.","SELECT ROUND(rating) FROM films;"
|
52 |
+
"Display films with their review lengths calculated.","SELECT film_name, LENGTH(review) AS review_length FROM films;"
|
53 |
+
"Bring films with review contents replaced with 'No review available' if the review is null.","SELECT film_name, COALESCE(review, 'No review available') AS review_content FROM films;"
|
54 |
+
"List films with ratings multiplied by 2.","SELECT film_name, rating * 2 AS multiplied_rating FROM films;"
|
55 |
+
"Fetch films with release years truncated to the nearest decade.","SELECT film_name, CAST(release_year / 10 * 10 AS INTEGER) AS truncated_release_year FROM films;"
|
56 |
+
"Show films with ratings ranked in descending order.","SELECT film_name, rating, RANK() OVER (ORDER BY rating DESC) AS rating_rank FROM films;"
|
57 |
+
"Display films with release years converted to Julian day numbers.","SELECT film_name, julianday(release_year) AS julian_release_year FROM films;"
|
58 |
+
"Find films with the longest review length.","SELECT * FROM films WHERE LENGTH(review) = (SELECT MAX(LENGTH(review)) FROM films);"
|
59 |
+
"Retrieve films with release years between the earliest and latest years in the database.","SELECT * FROM films WHERE release_year BETWEEN (SELECT MIN(release_year) FROM films) AND (SELECT MAX(release_year) FROM films);"
|
60 |
+
"List films with release years matching those of the highest-rated films.","SELECT * FROM films WHERE release_year IN (SELECT release_year FROM films WHERE rating = (SELECT MAX(rating) FROM films));"
|
61 |
+
"Show films with ratings within 1 point of the maximum rating.","SELECT * FROM films WHERE rating >= (SELECT MAX(rating) FROM films) - 1;"
|
62 |
+
"Retrieve films with ratings at least 1 point lower than the maximum rating.","SELECT * FROM films WHERE rating < (SELECT MAX(rating) FROM films) - 1;"
|
63 |
+
"Find films with release years matching those of the lowest-rated films.","SELECT * FROM films WHERE release_year IN (SELECT release_year FROM films WHERE rating = (SELECT MIN(rating) FROM films));"
|
64 |
+
"Display films with release years not found in the list of distinct release years.","SELECT * FROM films WHERE release_year NOT IN (SELECT DISTINCT release_year FROM films);"
|
65 |
+
"Fetch films with reviews containing words longer than the average word length in reviews.","SELECT * FROM films WHERE LENGTH(SUBSTR(review, INSTR(review || ' ', ' ') + 1)) > (SELECT AVG(LENGTH(SUBSTR(review, INSTR(review || ' ', ' ') + 1))) FROM films);"
|
66 |
+
"List films with release years that are prime numbers.","SELECT * FROM films WHERE release_year IN (2, 3, 5, 7, 11, 13, 17, 19, 23, 29, 31, 37, 41, 43, 47, 53, 59, 61, 67, 71, 73, 79, 83, 89, 97);"
|
67 |
+
"Retrieve films with release years that are leap years.","SELECT * FROM films WHERE release_year % 4 = 0 AND (release_year % 100 != 0 OR release_year % 400 = 0);"
|
68 |
+
"Find films released in the same year as other films.","SELECT f1.film_name AS film1, f2.film_name AS film2, f1.release_year FROM films f1 JOIN films f2 ON f1.release_year = f2.release_year AND f1.id != f2.id;"
|
69 |
+
"Identify films directed by the same director.","SELECT f1.film_name AS film1, f2.film_name AS film2, f1.director FROM films f1 JOIN films f2 ON f1.director = f2.director AND f1.id != f2.id;"
|
70 |
+
"Discover films with similar genres.","SELECT f1.film_name AS film1, f2.film_name AS film2, f1.genre FROM films f1 JOIN films f2 ON f1.genre = f2.genre AND f1.id != f2.id;"
|
71 |
+
"Retrieve films featuring the same lead actor.","SELECT f1.film_name AS film1, f2.film_name AS film2, f1.lead_actor FROM films f1 JOIN films f2 ON f1.lead_actor = f2.lead_actor AND f1.id != f2.id;"
|
72 |
+
"List films with identical runtime durations.","SELECT f1.film_name AS film1, f2.film_name AS film2, f1.runtime FROM films f1 JOIN films f2 ON f1.runtime = f2.runtime AND f1.id != f2.id;"
|
73 |
+
"Show films in the same language.","SELECT f1.film_name AS film1, f2.film_name AS film2, f1.language FROM films f1 JOIN films f2 ON f1.language = f2.language AND f1.id != f2.id;"
|
74 |
+
"Retrieve films with similar ratings released in the same year.","SELECT f1.film_name AS film1, f2.film_name AS film2, f1.release_year FROM films f1 JOIN films f2 ON f1.release_year = f2.release_year AND f1.rating = f2.rating AND f1.id != f2.id;"
|
75 |
+
"Find films with the same director and runtime difference within 10 minutes.","SELECT f1.film_name AS film1, f2.film_name AS film2, f1.director FROM films f1 JOIN films f2 ON f1.director = f2.director AND ABS(f1.runtime - f2.runtime) <= 10 AND f1.id != f2.id;"
|
76 |
+
"Retrieve films with the same genre and at least 1 year difference in release.","SELECT f1.film_name AS film1, f2.film_name AS film2, f1.genre FROM films f1 JOIN films f2 ON f1.genre = f2.genre AND ABS(f1.release_year - f2.release_year) >= 1 AND f1.id != f2.id;"
|
77 |
+
"Identify films with the same lead actor and within 20 minutes runtime difference.","SELECT f1.film_name AS film1, f2.film_name AS film2, f1.lead_actor FROM films f1 JOIN films f2 ON f1.lead_actor = f2.lead_actor AND ABS(f1.runtime - f2.runtime) <= 20 AND f1.id != f2.id;"
|
78 |
+
"Retrieve films with similar ratings and lead actor but different directors.","SELECT f1.film_name AS film1, f2.film_name AS film2, f1.rating, f1.lead_actor FROM films f1 JOIN films f2 ON f1.rating = f2.rating AND f1.lead_actor = f2.lead_actor AND f1.director != f2.director AND f1.id != f2.id;"
|
79 |
+
"Find films released in the same year with a difference of 20 minutes in runtime.","SELECT f1.film_name AS film1, f2.film_name AS film2, f1.release_year FROM films f1 JOIN films f2 ON f1.release_year = f2.release_year AND ABS(f1.runtime - f2.runtime) <= 20 AND f1.id != f2.id;"
|
80 |
+
"Retrieve films with the same language and runtime difference within 15 minutes.","SELECT f1.film_name AS film1, f2.film_name AS film2, f1.language FROM films f1 JOIN films f2 ON f1.language = f2.language AND ABS(f1.runtime - f2.runtime) <= 15 AND f1.id != f2.id;"
|
81 |
+
"Identify films with the same genre and director but different release years.","SELECT f1.film_name AS film1, f2.film_name AS film2, f1.genre, f1.director FROM films f1 JOIN films f2 ON f1.genre = f2.genre AND f1.director = f2.director AND f1.release_year != f2.release_year AND f1.id != f2.id;"
|
82 |
+
"Retrieve films where the runtime is within 10 minutes of 100 minutes.","SELECT * FROM films WHERE ABS(runtime - 100) <= 10;"
|
83 |
+
"Find films with the rating increased by 1.","SELECT film_name, rating + 1 AS increased_rating FROM films;"
|
84 |
+
"Retrieve films with a review or 'No review available' if the review is null.","SELECT film_name, coalesce(review, 'No review available') AS review_content FROM films;"
|
85 |
+
"List films with the title and release year concatenated.","SELECT concat(film_name, ' ', release_year) AS film_info FROM films;"
|
86 |
+
"Fetch films with the title and release year concatenated with '-' as a single string.","SELECT concat_ws('-', film_name, release_year) AS film_info FROM films;"
|
87 |
+
"Display films with ratings formatted to two decimal places.","SELECT film_name, format(rating, '0.00') AS formatted_rating FROM films;"
|
88 |
+
"Retrieve films with 'The' in the title using a wildcard search.","SELECT * FROM films WHERE glob(film_name, '*The*');"
|
89 |
+
"Find films where the release year is represented in hexadecimal.","SELECT film_name, hex(release_year) AS hex_release_year FROM films;"
|
90 |
+
"Retrieve films with the rating if not null, otherwise display 'N/A'.","SELECT film_name, ifnull(rating, 'N/A') AS rating FROM films;"
|
91 |
+
"Identify films with a rating greater than 4 as 'High' or 'Low'.","SELECT film_name, iif(rating > 4, 'High', 'Low') AS rating_classification FROM films;"
|
92 |
+
"Find films with 'Matrix' in the title using a substring search.","SELECT * FROM films WHERE instr(film_name, 'Matrix') > 0;"
|
93 |
+
"Retrieve the last inserted row ID.","SELECT last_insert_rowid() AS last_row_id;"
|
94 |
+
"List films with the length of the review.","SELECT film_name, length(review) AS review_length FROM films;"
|
95 |
+
"Fetch films with titles starting with 'The'.","SELECT * FROM films WHERE film_name like 'The%';"
|
96 |
+
"Display films with ratings rounded to two decimal places if they exceed 3.","SELECT film_name, round(ifnull(rating, 0), 2) AS formatted_rating FROM films WHERE rating > 3;"
|
97 |
+
"Retrieve films with leading whitespaces removed from the title.","SELECT ltrim(film_name) AS trimmed_title FROM films;"
|
98 |
+
"Retrieve films with the review if available, otherwise display 'No review available'.","SELECT film_name, COALESCE(review, 'No review available') AS review_content FROM films;"
|
99 |
+
"Fetch films with either the director's name or 'Unknown' if the director is null.","SELECT film_name, COALESCE(director, 'Unknown') AS director_name FROM films;"
|
100 |
+
"Display films with the release year if available, otherwise show 'N/A'.","SELECT film_name, COALESCE(release_year, 'N/A') AS release_year FROM films;"
|
101 |
+
"List films with either the rating or 'Not rated' if the rating is null.","SELECT film_name, COALESCE(rating, 'Not rated') AS film_rating FROM films;"
|
102 |
+
"Retrieve films with the lead actor's name if provided, otherwise display 'Unknown'.","SELECT film_name, COALESCE(lead_actor, 'Unknown') AS lead_actor_name FROM films;"
|
103 |
+
"Find films with the genre if available, otherwise show 'Not specified'.","SELECT film_name, COALESCE(genre, 'Not specified') AS film_genre FROM films;"
|
104 |
+
"Identify films with the language specified or 'Not specified' if the language is null.","SELECT film_name, COALESCE(language, 'Not specified') AS film_language FROM films;"
|
105 |
+
"Retrieve films with the runtime duration if provided, otherwise display 'Unknown'.","SELECT film_name, COALESCE(runtime, 'Unknown') AS runtime_duration FROM films;"
|
106 |
+
"List films with the budget if available, otherwise show 'Not available'.","SELECT film_name, COALESCE(budget, 'Not available') AS film_budget FROM films;"
|
107 |
+
"Fetch films with the country of production if specified, otherwise display 'Not specified'.","SELECT film_name, COALESCE(country, 'Not specified') AS production_country FROM films;"
|
108 |
+
"Trim leading and trailing whitespace from the title column.","SELECT trim(title) FROM films;"
|
109 |
+
"Trim leading and trailing characters 'abc' from the description column.","SELECT trim(description, 'abc') FROM films;"
|
110 |
+
"Get the data type of the runtime column.","SELECT typeof(runtime) FROM films;"
|
111 |
+
"Convert hexadecimal string '4D61726B' to its binary value.","SELECT unhex('4D61726B');"
|
112 |
+
"Convert hexadecimal string '4D61726B' to its binary value and specify the output length as 4.","SELECT unhex('4D61726B', 4);"
|
113 |
+
"Get the Unicode code point of the first character in the film_name column.","SELECT unicode(film_name) FROM films;"
|
114 |
+
"Estimate the likelihood of a condition being false.","SELECT unlikely(rating < 3) FROM films;"
|
115 |
+
"Convert the film_name column to uppercase.","SELECT upper(film_name) FROM films;"
|
116 |
+
"Generate a zero-filled blob of length 100.","SELECT zeroblob(100);"
|
data/training_data_refined.csv
ADDED
@@ -0,0 +1,90 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
,description,query
|
2 |
+
0,List all films in the database.,SELECT * FROM films;
|
3 |
+
1,Retrieve the details of a specific film by its ID.,SELECT * FROM films WHERE id = 1;
|
4 |
+
2,Retrieve the details of films released in a specific year.,SELECT * FROM films WHERE release_year = 2022;
|
5 |
+
3,Retrieve the details of films with a rating higher than a certain value.,SELECT * FROM films WHERE rating > 4.0;
|
6 |
+
4,Retrieve the details of films with a review containing specific keywords.,SELECT * FROM films WHERE review LIKE '%great%';
|
7 |
+
5,Retrieve the details of films watched at a specific time.,SELECT * FROM films WHERE watched_time = '2022-01-01';
|
8 |
+
6,Retrieve the number of films in the database.,SELECT COUNT(*) FROM films;
|
9 |
+
7,Retrieve the average rating of all films in the database.,SELECT AVG(rating) FROM films;
|
10 |
+
8,Retrieve the details of the top 10 highest-rated films.,SELECT * FROM films ORDER BY rating DESC LIMIT 10;
|
11 |
+
9,Retrieve the details of films released after a certain year.,SELECT * FROM films WHERE release_year > 2020;
|
12 |
+
10,Retrieve the details of films with a rating within a specific range.,SELECT * FROM films WHERE rating BETWEEN 3.0 AND 4.5;
|
13 |
+
11,Retrieve the details of films with a specific name.,SELECT * FROM films WHERE film_name = 'The Matrix';
|
14 |
+
12,Retrieve the highest rating among all films.,SELECT MAX(rating) FROM films;
|
15 |
+
13,Retrieve the lowest release year among all films.,SELECT MIN(release_year) FROM films;
|
16 |
+
14,Retrieve the total count of films watched.,SELECT COUNT(*) FROM films WHERE watched_time IS NOT NULL;
|
17 |
+
15,Calculate the average rating of films released after 2000.,SELECT AVG(rating) FROM films WHERE release_year > 2000;
|
18 |
+
16,Count the number of films released each year.,"SELECT release_year, COUNT(*) FROM films GROUP BY release_year;"
|
19 |
+
17,Calculate the total sum of ratings for all films.,SELECT SUM(rating) FROM films;
|
20 |
+
18,Find the average rating of films watched in 2022.,"SELECT AVG(rating) FROM films WHERE strftime('%Y', watched_time) = '2022';"
|
21 |
+
19,Retrieve the number of films with a review containing more than 100 characters.,SELECT COUNT(*) FROM films WHERE LENGTH(review) > 100;
|
22 |
+
20,Calculate the total count of films watched per month.,"SELECT strftime('%m', watched_time) AS month, COUNT(*) FROM films WHERE watched_time IS NOT NULL GROUP BY month;"
|
23 |
+
21,Retrieve the release year with the highest number of films.,"SELECT release_year, COUNT(*) FROM films GROUP BY release_year ORDER BY COUNT(*) DESC LIMIT 1;"
|
24 |
+
22,Calculate the average rating of films released in each year.,"SELECT release_year, AVG(rating) FROM films GROUP BY release_year;"
|
25 |
+
23,Find the year with the highest average rating.,"SELECT release_year, AVG(rating) FROM films GROUP BY release_year ORDER BY AVG(rating) DESC LIMIT 1;"
|
26 |
+
24,Retrieve the number of films released in the last decade.,SELECT COUNT(*) FROM films WHERE release_year BETWEEN 2014 AND 2024;
|
27 |
+
25,Calculate the total count of films with non-null ratings.,SELECT COUNT(*) FROM films WHERE rating IS NOT NULL;
|
28 |
+
26,Retrieve the details of films with a rating higher than the average rating of all films.,SELECT * FROM films WHERE rating > (SELECT AVG(rating) FROM films);
|
29 |
+
27,Retrieve the details of films released after the year of the film with the highest rating.,SELECT * FROM films WHERE release_year > (SELECT release_year FROM films ORDER BY rating DESC LIMIT 1);
|
30 |
+
28,Retrieve the details of films with a rating higher than the average rating of films released in 2022.,SELECT * FROM films WHERE rating > (SELECT AVG(rating) FROM films WHERE release_year = 2022);
|
31 |
+
29,Retrieve the details of films with a rating higher than the lowest rating of films released in 2022.,SELECT * FROM films WHERE rating > (SELECT MIN(rating) FROM films WHERE release_year = 2022);
|
32 |
+
31,Retrieve the details of films with a rating higher than the average rating of films released in the same year as 'The Matrix'.,SELECT * FROM films WHERE rating > (SELECT AVG(rating) FROM films WHERE release_year = (SELECT release_year FROM films WHERE film_name = 'The Matrix'));
|
33 |
+
32,"Retrieve the details of films with a rating higher than the average rating of films watched on January 1, 2022.","SELECT * FROM films WHERE rating > (SELECT AVG(rating) FROM films WHERE strftime('%Y-%m-%d', watched_time) = '2022-01-01');"
|
34 |
+
33,Retrieve the details of films released in the same year as the film with the lowest rating.,SELECT * FROM films WHERE release_year = (SELECT release_year FROM films WHERE rating = (SELECT MIN(rating) FROM films));
|
35 |
+
34,Retrieve the details of films with a rating higher than the average rating of films released after 2000.,SELECT * FROM films WHERE rating > (SELECT AVG(rating) FROM films WHERE release_year > 2000);
|
36 |
+
35,Retrieve the details of films with a rating higher than the average rating of films released before 2000.,SELECT * FROM films WHERE rating > (SELECT AVG(rating) FROM films WHERE release_year < 2000);
|
37 |
+
36,Retrieve the details of films with release years formatted as 'YYYY-MM-DD'.,"SELECT film_name, strftime('%Y-%m-%d', release_year) AS formatted_release_year FROM films;"
|
38 |
+
37,Retrieve the details of films with their names converted to uppercase.,SELECT UPPER(film_name) FROM films;
|
39 |
+
38,Retrieve the details of films with their release years shifted by 5 years into the future.,"SELECT film_name, release_year + 5 AS future_release_year FROM films;"
|
40 |
+
39,Retrieve the details of films with their ratings rounded to the nearest integer.,SELECT ROUND(rating) FROM films;
|
41 |
+
40,Retrieve the details of films with their review lengths calculated.,"SELECT film_name, LENGTH(review) AS review_length FROM films;"
|
42 |
+
41,Retrieve the details of films with their review contents replaced with 'No review available' if the review is null.,"SELECT film_name, COALESCE(review, 'No review available') AS review_content FROM films;"
|
43 |
+
42,Retrieve the details of films with their ratings multiplied by 2.,"SELECT film_name, rating * 2 AS multiplied_rating FROM films;"
|
44 |
+
43,Retrieve the details of films with their release years truncated to the nearest decade.,"SELECT film_name, CAST(release_year / 10 * 10 AS INTEGER) AS truncated_release_year FROM films;"
|
45 |
+
44,Retrieve the details of films with their ratings ranked in descending order.,"SELECT film_name, rating, RANK() OVER (ORDER BY rating DESC) AS rating_rank FROM films;"
|
46 |
+
45,Retrieve the details of films with their release years converted to Julian day numbers.,"SELECT film_name, julianday(release_year) AS julian_release_year FROM films;"
|
47 |
+
46,List films with release years formatted as 'YYYY-MM-DD'.,"SELECT film_name, strftime('%Y-%m-%d', release_year) AS formatted_release_year FROM films;"
|
48 |
+
47,Fetch films with their names converted to uppercase.,SELECT UPPER(film_name) FROM films;
|
49 |
+
48,Retrieve films with release years shifted by 5 years into the future.,"SELECT film_name, release_year + 5 AS future_release_year FROM films;"
|
50 |
+
49,Show films with ratings rounded to the nearest integer.,SELECT ROUND(rating) FROM films;
|
51 |
+
50,Display films with their review lengths calculated.,"SELECT film_name, LENGTH(review) AS review_length FROM films;"
|
52 |
+
51,Bring films with review contents replaced with 'No review available' if the review is null.,"SELECT film_name, COALESCE(review, 'No review available') AS review_content FROM films;"
|
53 |
+
52,List films with ratings multiplied by 2.,"SELECT film_name, rating * 2 AS multiplied_rating FROM films;"
|
54 |
+
53,Fetch films with release years truncated to the nearest decade.,"SELECT film_name, CAST(release_year / 10 * 10 AS INTEGER) AS truncated_release_year FROM films;"
|
55 |
+
54,Show films with ratings ranked in descending order.,"SELECT film_name, rating, RANK() OVER (ORDER BY rating DESC) AS rating_rank FROM films;"
|
56 |
+
55,Display films with release years converted to Julian day numbers.,"SELECT film_name, julianday(release_year) AS julian_release_year FROM films;"
|
57 |
+
56,Find films with the longest review length.,SELECT * FROM films WHERE LENGTH(review) = (SELECT MAX(LENGTH(review)) FROM films);
|
58 |
+
57,Retrieve films with release years between the earliest and latest years in the database.,SELECT * FROM films WHERE release_year BETWEEN (SELECT MIN(release_year) FROM films) AND (SELECT MAX(release_year) FROM films);
|
59 |
+
58,List films with release years matching those of the highest-rated films.,SELECT * FROM films WHERE release_year IN (SELECT release_year FROM films WHERE rating = (SELECT MAX(rating) FROM films));
|
60 |
+
59,Show films with ratings within 1 point of the maximum rating.,SELECT * FROM films WHERE rating >= (SELECT MAX(rating) FROM films) - 1;
|
61 |
+
60,Retrieve films with ratings at least 1 point lower than the maximum rating.,SELECT * FROM films WHERE rating < (SELECT MAX(rating) FROM films) - 1;
|
62 |
+
61,Find films with release years matching those of the lowest-rated films.,SELECT * FROM films WHERE release_year IN (SELECT release_year FROM films WHERE rating = (SELECT MIN(rating) FROM films));
|
63 |
+
62,Display films with release years not found in the list of distinct release years.,SELECT * FROM films WHERE release_year NOT IN (SELECT DISTINCT release_year FROM films);
|
64 |
+
63,Fetch films with reviews containing words longer than the average word length in reviews.,"SELECT * FROM films WHERE LENGTH(SUBSTR(review, INSTR(review || ' ', ' ') + 1)) > (SELECT AVG(LENGTH(SUBSTR(review, INSTR(review || ' ', ' ') + 1))) FROM films);"
|
65 |
+
64,List films with release years that are prime numbers.,"SELECT * FROM films WHERE release_year IN (2, 3, 5, 7, 11, 13, 17, 19, 23, 29, 31, 37, 41, 43, 47, 53, 59, 61, 67, 71, 73, 79, 83, 89, 97);"
|
66 |
+
65,Retrieve films with release years that are leap years.,SELECT * FROM films WHERE release_year % 4 = 0 AND (release_year % 100 != 0 OR release_year % 400 = 0);
|
67 |
+
66,Find films released in the same year as other films.,"SELECT f1.film_name AS film1, f2.film_name AS film2, f1.release_year FROM films f1 JOIN films f2 ON f1.release_year = f2.release_year AND f1.id != f2.id;"
|
68 |
+
72,Retrieve films with similar ratings released in the same year.,"SELECT f1.film_name AS film1, f2.film_name AS film2, f1.release_year FROM films f1 JOIN films f2 ON f1.release_year = f2.release_year AND f1.rating = f2.rating AND f1.id != f2.id;"
|
69 |
+
81,Find films with the rating increased by 1.,"SELECT film_name, rating + 1 AS increased_rating FROM films;"
|
70 |
+
82,Retrieve films with a review or 'No review available' if the review is null.,"SELECT film_name, coalesce(review, 'No review available') AS review_content FROM films;"
|
71 |
+
85,Display films with ratings formatted to two decimal places.,"SELECT film_name, format(rating, '0.00') AS formatted_rating FROM films;"
|
72 |
+
86,Retrieve films with 'The' in the title using a wildcard search.,"SELECT * FROM films WHERE glob(film_name, '*The*');"
|
73 |
+
87,Find films where the release year is represented in hexadecimal.,"SELECT film_name, hex(release_year) AS hex_release_year FROM films;"
|
74 |
+
88,"Retrieve films with the rating if not null, otherwise display 'N/A'.","SELECT film_name, ifnull(rating, 'N/A') AS rating FROM films;"
|
75 |
+
89,Identify films with a rating greater than 4 as 'High' or 'Low'.,"SELECT film_name, iif(rating > 4, 'High', 'Low') AS rating_classification FROM films;"
|
76 |
+
90,Find films with 'Matrix' in the title using a substring search.,"SELECT * FROM films WHERE instr(film_name, 'Matrix') > 0;"
|
77 |
+
91,Retrieve the last inserted row ID.,SELECT last_insert_rowid() AS last_row_id;
|
78 |
+
92,List films with the length of the review.,"SELECT film_name, length(review) AS review_length FROM films;"
|
79 |
+
93,Fetch films with titles starting with 'The'.,SELECT * FROM films WHERE film_name like 'The%';
|
80 |
+
94,Display films with ratings rounded to two decimal places if they exceed 3.,"SELECT film_name, round(ifnull(rating, 0), 2) AS formatted_rating FROM films WHERE rating > 3;"
|
81 |
+
95,Retrieve films with leading whitespaces removed from the title.,SELECT ltrim(film_name) AS trimmed_title FROM films;
|
82 |
+
96,"Retrieve films with the review if available, otherwise display 'No review available'.","SELECT film_name, COALESCE(review, 'No review available') AS review_content FROM films;"
|
83 |
+
98,"Display films with the release year if available, otherwise show 'N/A'.","SELECT film_name, COALESCE(release_year, 'N/A') AS release_year FROM films;"
|
84 |
+
99,List films with either the rating or 'Not rated' if the rating is null.,"SELECT film_name, COALESCE(rating, 'Not rated') AS film_rating FROM films;"
|
85 |
+
109,Convert hexadecimal string '4D61726B' to its binary value.,SELECT unhex('4D61726B');
|
86 |
+
110,Convert hexadecimal string '4D61726B' to its binary value and specify the output length as 4.,"SELECT unhex('4D61726B', 4);"
|
87 |
+
111,Get the Unicode code point of the first character in the film_name column.,SELECT unicode(film_name) FROM films;
|
88 |
+
112,Estimate the likelihood of a condition being false.,SELECT unlikely(rating < 3) FROM films;
|
89 |
+
113,Convert the film_name column to uppercase.,SELECT upper(film_name) FROM films;
|
90 |
+
114,Generate a zero-filled blob of length 100.,SELECT zeroblob(100);
|