Complete the code to create an index named 'products' in Elasticsearch.
PUT /[1]POST instead of PUT to create an index.The code PUT /products creates an index named 'products' in Elasticsearch.
Complete the query to search for documents where the field 'name' matches 'laptop'.
{
"query": {
"match": {
"[1]": "laptop"
}
}
}The match query searches the field 'name' for the term 'laptop'.
Fix the error in the SQL query that selects all rows from the 'products' table.
SELECT * FROM [1];The table name is 'products', so the correct query is SELECT * FROM products;.
Fill both blanks to create a dictionary comprehension that maps product names to their prices for products costing more than 100.
{product['[1]']: product['[2]'] for product in products if product['price'] > 100}The comprehension maps the 'name' to 'price' for products with price greater than 100.
Fill all three blanks to create a dictionary comprehension that maps uppercase product names to their prices for products with stock greater than 0.
{product['[1]'].upper(): product['[2]'] for product in products if product['[3]'] > 0}The comprehension maps uppercase 'name' to 'price' for products with 'stock' greater than zero.