How to delete data from SQL database tables, and how to delete tables
To delete data from the table, useDELETE FROM
command.
This will delete all rows:
DELETE FROM people;
you can use itWHERE
The clause deletes only specific rows:
DELETE FROM people WHERE name='Flavio';
To delete the table instead of the data in the table, useDROP TABLE
command:
DROP TABLE people;
More database tutorials:
- MongoDB basic tutorial
- How is MongoDB different from SQL database
- Information system, data and information
- Data model
- Introduction to ER data model
- Relational model
- Relational algebra
- relational database
- What is a database? There is also a DBMS?
- Introduction to SQL
- How to install PostgreSQL on macOS
- Do you always need to provide a database for the application?
- How to install SQLite on macOS
- Introduction to PostgreSQL
- PostgreSQL user permissions
- How to list all users in PostgreSQL
- How to switch database using PostgreSQL
- How to list all databases using PostgreSQL
- How to use PostgreSQL to list the tables in the current database
- How to install MySQL on macOS
- Create user on MySQL
- PostgreSQL vs MySQL, comparison
- SQLite user permissions
- MySQL user permissions
- SQL, create table
- SQL, add data to the table
- SQL, how to use SELECT
- SQL, handle empty cells
- SQL, unique key and primary key
- SQL, how to update data
- SQL, how to update the table structure
- SQL, how to delete data and tables
- SQL connection
- SQL view
- How to insert multiple items in a MongoDB collection at once
- How to delete all items from MongoDB collection