Consider the following MOVIE table and write the SQL queries based on it. List MovieID, MovieName and Cost for all movies with ProductionCost greater than 10,000 and less than 1,00,000.
SELECT MovieID, MovieName, ProductionCost FROM MOVIE WHERE ProductionCost > 10000 AND ProductionCost < 100000;
Explanation
This question tests the understanding of SELECT statement with conditional filtering using comparison operators. The query needs to display three columns (MovieID, MovieName, ProductionCost) from the MOVIE table where ProductionCost falls within a specific range. The question specifies 'greater than 10,000 and less than 1,00,000', which means we need to use the AND operator with > and < comparison operators. Note that BETWEEN operator is not suitable here because BETWEEN is inclusive (includes boundary values), whereas the question asks for values strictly greater than and strictly less than the specified limits. The column name in the table is 'ProductionCost', so we use that in both SELECT and WHERE clauses.
Solution Steps
Step 1: Identify columns to display - MovieID, MovieName, ProductionCost
Step 2: Identify table name - MOVIE
Step 3: Apply filter condition - ProductionCost > 10000 AND ProductionCost < 100000
Step 4: Write complete query: SELECT MovieID, MovieName, ProductionCost FROM MOVIE WHERE ProductionCost > 10000 AND ProductionCost < 100000;