Question · SQL and MySQL course · Module 5: Modifying data (DML)

Condition with AND

Which command changes the price ONLY for books in kategorie with id 2 that are unavailable (dostepna = 0)?

Answer options

  • UPDATE ksiazki SET cena = 10 WHERE kategoria_id = 2 OR dostepna = 0;
  • UPDATE ksiazki SET cena = 10;
  • DELETE ksiazki WHERE kategoria_id = 2 AND dostepna = 0;
  • UPDATE ksiazki SET cena = 10 WHERE kategoria_id = 2 AND dostepna = 0;

You can check the correct answer by solving this task in the CodeWorlds game.