Easy Writes & indexes Free

SQL interview question: INSERT a New Row

Stock a New Product

A merchant just added a mechanical keyboard to their store, and it needs to go into the catalog.

Write a single INSERT statement adding a product with product_id 21, product_name 'Mechanical Keyboard', category 'Electronics', price 89.99, and rating 4.5.

Note: Your change is verified automatically and rolled back afterwards - the database never actually changes.

This challenge changes data. Your statement runs on a private copy of the database, then we check the resulting table.

Tables

products 20 rows
  • product_id integer PK
  • product_name text
  • category text
  • price real
  • rating real
product_idproduct_namecategorypricerating
1MacBook ProElectronics1999.994.8
2iPad AirElectronics599.994.8
3AirPods ProElectronics249.994.7

Keep going