insert into table_name (column1, column2, ...) values (value1, value2, ...);
insert into movies_basic (title, genre, release_year, director, studio, critic_rating) values ('challenge of the emperor', 'adventure', 2010, 'Miley Watson', 'Unknown', 7.2);
insert into movies_basic (title, genre, release_year, director, studio, critic_rating) values ('dishonor of power', ...), ('night of the maze', ...);
where
clause to filter the rows to update.update table_name set column1 = value1, column2 = value2, ... where condition;
update movies_basic set director = 'Mike Watson' where director = 'Miley Watson';
where
clause, all rows in the table will be updated, making it very important to use the where
clause carefully.where
clause with a select
query before running the update
statement.select * from movies_basic where director = 'Miley Watson';
where
clause.where
clause to specify which rows to delete.delete from table_name where condition;
delete from movies_basic where release_year < 1927;
where
clause, all rows in the table will be deleted, which is possible but should be done cautiously.alter table table_name auto_increment = value;
.alter table movies_basic auto_increment = 54;
truncate
statement.truncate
resets the auto-increment counter and drops and recreates the table.truncate table table_name;
insert into movies_basic (title, genre, release_year, director, studio, critic_rating) values ('run for the forest', ...), ('luck of the night', ...), ('invader glory', ...);