Complete the code to define a text data type in a database.
CREATE TABLE users (name [1](50));
The VARCHAR data type is used to store text strings of variable length in a database.
Complete the code to set up a primary key in a database table.
CREATE TABLE products (id [1] PRIMARY KEY, name VARCHAR(100));
The INT data type is commonly used for primary keys because it stores whole numbers uniquely identifying each record.
Fix the error in the data type declaration for a date field.
CREATE TABLE events (event_date [1]);The correct data type for storing dates without time is DATE. DATETIME includes time, VARCHAR stores text, and NUMBER stores numbers.
Fill both blanks to create a table with an auto-incrementing integer ID and a boolean active status.
CREATE TABLE accounts (id [1] PRIMARY KEY [2], active BOOLEAN);
The INT data type is used for the ID, and AUTO_INCREMENT makes the ID increase automatically for each new record.
Fill all three blanks to create a dictionary comprehension that maps uppercase keys to values greater than zero.
result = [1]: [2] for k, v in data.items() if v [3] 0}
This comprehension creates a new dictionary where keys are uppercase versions of the original keys (k.upper()), values are the same (v), and only includes items where the value is greater than zero (> 0).