Introduction to database objects
In the previous chapter, you learned how to back up and restore a database, create a database and tables with SQL commands, and set their properties. You also learned how to add, read, write, modify, and delete records using SQL commands before learning about foreign keys and indexes, and why they are essential. Finally, you learned about multi-table queries and various table joins. You will be using your knowledge of these subjects in this chapter to work with stored procedures, views, and functions.
Views are database objects that allow you to save a particular query as a table. This allows you to save results so that they can be used later. Views allow people with little SQL experience to access complex datasets that have been constructed from SQL queries. Functions can be used to create custom programming logic for your database. This is helpful in situations where you have code repeated in multiple areas and you want to avoid copying code multiple...