Skip to Content
Learn SQL in a Month of Lunches
book

Learn SQL in a Month of Lunches

by Jeff Iannucci
February 2025
Beginner content levelBeginner
304 pages
8h 8m
English
Manning Publications
Content preview from Learn SQL in a Month of Lunches

20 Reusing queries with views and stored procedures

Through 19 chapters, we’ve written a lot of SQL queries. We’ve used filters, functions, aggregations, and more to find specific data. We’ve even added, updated, and removed data, and we’ve used variables to enable our scripts to do the same things over and over with different values.

In this chapter, we’ll bring a lot of that work together by moving from executing SQL scripts to saving scripts as objects in the database—scripts that anyone who has the necessary permissions can execute. Depending on the relational database management system (RDBMS) we’re using, we can use a few objects to store these scripts. For now, we’ll focus on two nearly universal objects: views and stored procedures.

Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Start your free trial

You might also like

SQL Queries for Mere Mortals: A Hands-On Guide to Data Manipulation in SQL, 4th Edition

SQL Queries for Mere Mortals: A Hands-On Guide to Data Manipulation in SQL, 4th Edition

John L. Viescas
SQL Cookbook, 2nd Edition

SQL Cookbook, 2nd Edition

Anthony Molinaro, Robert de Graaf

Publisher Resources

ISBN: 9781633438576Supplemental ContentPublisher SupportOtherPublisher WebsiteSupplemental ContentPurchase Link