Complete the code to create a new record using Sequelize.
const newUser = await User.[1]({ name: 'Alice', email: 'alice@example.com' });
The create method is used to add a new record to the database in Sequelize.
Complete the code to find all users with Sequelize.
const users = await User.[1]();The findAll method retrieves all records from the database table.
Fix the error in the update operation code.
await User.[1]({ name: 'Bob' }, { where: { id: 5 } });
The update method updates existing records matching the where condition.
Fill both blanks to delete a user by id using Sequelize.
await User.[1]({ where: { id: [2] } });
The destroy method deletes records matching the where condition. Here, the user with id 5 is deleted.
Fill all three blanks to find a user by primary key and update their email.
const user = await User.[1](10); if (user) { await user.[2]({ email: 'newemail@example.com' }); await user.[3](); }
findByPk finds a record by its primary key. Then update changes the email field. Finally, save saves the changes to the database.
