Suggest an editImprove this articleRefine the answer for “Can you insert data into a view?”. Your changes go to moderation before they’re published.Approval requiredContentWhat you’re changing🇺🇸EN🇺🇦UAPreviewTitle (EN)Short answer (EN)Yes, **sometimes**, but **not always**: you can insert data into a view (`INSERT`, `UPDATE`, `DELETE`) **only if it's based on a single table** and doesn't contain complex constructs - such as `JOIN`, `GROUP BY`, `DISTINCT`, `SUM()`, and the like. **Key point:** if a view uses `JOIN` or aggregates, you can't insert data - the database can't tell **which table to write to**, so simple views can be modified, while complex ones can only be read.Shown above the full answer for quick recall.Answer (EN)ImageYes, **sometimes**, but **not always**. You can insert data into a view (`INSERT`, `UPDATE`, `DELETE`) **only if it's based on a single table** and doesn't contain complex constructs - such as `JOIN`, `GROUP BY`, `DISTINCT`, `SUM()`, and the like. ### Example: it works ```sql CREATE VIEW simple_users AS SELECT id, name, email FROM users; INSERT INTO simple_users (id, name, email) VALUES (5, 'Ivan', 'ivan@example.com'); ``` But if a view uses `JOIN` or aggregates, you can't insert data - the database can't tell **which table to write to**. So simple views can be modified, while **complex ones can only be read**.For the reviewerNote to the moderator (optional)Visible only to the moderator. Helps review go faster.