Complete the code to create a partitioned table by the column 'year'.
CREATE TABLE sales_data (id INT, amount FLOAT) PARTITIONED BY ([1] STRING);The partition column is 'year' to organize data by year for better query performance.
Complete the code to insert data into the partition for year 2023.
INSERT INTO sales_data PARTITION (year=[1]) SELECT id, amount FROM raw_sales WHERE year = 2023;
The partition value must be a string literal, so '2023' is correct.
Fix the error in the query to select data only from the 2022 partition.
SELECT * FROM sales_data WHERE year [1] '2022';
In SQL, the equality operator is a single '=' sign, not '=='.
Fill both blanks to create a dictionary comprehension that maps each word to its length if the length is greater than 3.
{word: [1] for word in words if [2]The dictionary maps words to their lengths (len(word)) and filters words with length greater than 3 (len(word) > 3).
Fill all three blanks to create a dictionary comprehension that maps uppercase keys to values only if the value is greater than 0.
result = [1]: [2] for [3], [2] in data.items() if [2] > 0}
Keys are converted to uppercase with k.upper(), values are v, and the loop variables are k and v.