Updates VIEW
student_notes
, increases author's points by one in
students
table based on note's ID. First we need to create the VIEW
CREATE VIEW IF NOT EXISTS student_notes AS
SELECT 
    students.first_name,
    students.last_name,
    students.points,
    notes.*
FROM students
JOIN notes ON notes.student_id = students.id
Then we update the VIEW as a regular table
UPDATE `student_notes` 
SET points = points + 1 
WHERE id = 1;
by Valeri Tandilashvili
4 years ago
MySQL
Views
Full MySQL Course for Beginners
1
Pro tip: use ```triple backticks around text``` to write in code fences