Skip to content
This repository was archived by the owner on Feb 6, 2023. It is now read-only.

Fix code for stored procs. #12

Merged
merged 1 commit into from
Jun 25, 2019
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 5 additions & 2 deletions md/big_data/intro-to-sql.md
Original file line number Diff line number Diff line change
Expand Up @@ -467,11 +467,14 @@ Here we are able to increment the years by setting years = to whatever it's own
Now that we know how to do inserts and updates, it may be useful for us to create a stored procedure for something that will be done regularly. The devs have asked us to put this update statement in a Stored Procedure.

```
DELIMITER //
CREATE PROCEDURE zipcode.increment_years_experience ()
BEGIN
UPDATE zipcode.teacher_meta
SET years = years+1;
END;
SET years = years+1
WHERE ID <> 0;
END //
DELIMITER ;
```

This procedure can be called instead of a developer trying to write their own update statement. This gives us control over the data and ensures it's quality remains up to a standard.
Expand Down