620 likes | 732 Views
Chapter 7. Advanced SQL Database Systems: Design, Implementation, and Management, Sixth Edition, Rob and Coronel. In this chapter, you will learn:. About the relational set operators UNION, UNION ALL, INTERSECT, and MINUS How to use the advanced SQL JOIN operator syntax
E N D
Chapter 7 Advanced SQL Database Systems: Design, Implementation, and Management, Sixth Edition, Rob and Coronel
In this chapter, you will learn: • About the relational set operators UNION, UNION ALL, INTERSECT, and MINUS • How to use the advanced SQL JOIN operator syntax • About the different types of subqueries and correlated queries • How to use SQL functions to manipulate dates, strings, and other data Database Systems: Design, Implementation, & Management, 6th Edition, Rob & Coronel
In this chapter, you will learn: (continued) • How to create and use updatable views • How to create and use triggers and stored procedures • How to create embedded SQL Database Systems: Design, Implementation, & Management, 6th Edition, Rob & Coronel
UNION Query Result Database Systems: Design, Implementation, & Management, 6th Edition, Rob & Coronel
UNION ALL Query Result Database Systems: Design, Implementation, & Management, 6th Edition, Rob & Coronel
INTERSECT Query Result Database Systems: Design, Implementation, & Management, 6th Edition, Rob & Coronel
MINUS Query Results Database Systems: Design, Implementation, & Management, 6th Edition, Rob & Coronel
INTERSECT Alternative Database Systems: Design, Implementation, & Management, 6th Edition, Rob & Coronel
MINUS Alternative Database Systems: Design, Implementation, & Management, 6th Edition, Rob & Coronel
SQL Join Expression Styles Database Systems: Design, Implementation, & Management, 6th Edition, Rob & Coronel
NATURAL JOIN Result Database Systems: Design, Implementation, & Management, 6th Edition, Rob & Coronel
JOIN USING Result Database Systems: Design, Implementation, & Management, 6th Edition, Rob & Coronel
JOIN ON Result Database Systems: Design, Implementation, & Management, 6th Edition, Rob & Coronel
Outer Joins • Returns not only rows matching join condition but also rows with unmatched values • Three types: • Left • Right • Full Database Systems: Design, Implementation, & Management, 6th Edition, Rob & Coronel
LEFT JOIN Result Database Systems: Design, Implementation, & Management, 6th Edition, Rob & Coronel
RIGHT JOIN Result Database Systems: Design, Implementation, & Management, 6th Edition, Rob & Coronel
FULL JOIN Result Database Systems: Design, Implementation, & Management, 6th Edition, Rob & Coronel
SELECT Subquery Examples Database Systems: Design, Implementation, & Management, 6th Edition, Rob & Coronel
WHERE Subquery Examples Database Systems: Design, Implementation, & Management, 6th Edition, Rob & Coronel
IN Subquery Example Database Systems: Design, Implementation, & Management, 6th Edition, Rob & Coronel
HAVING Subquery Example Database Systems: Design, Implementation, & Management, 6th Edition, Rob & Coronel
Multirow Subquery Operator Example Database Systems: Design, Implementation, & Management, 6th Edition, Rob & Coronel
FROM Subquery Example Database Systems: Design, Implementation, & Management, 6th Edition, Rob & Coronel
Inline Subquery Example Database Systems: Design, Implementation, & Management, 6th Edition, Rob & Coronel
Correlated Subquery Examples Database Systems: Design, Implementation, & Management, 6th Edition, Rob & Coronel
EXISTS Correlated Subquery Examples Database Systems: Design, Implementation, & Management, 6th Edition, Rob & Coronel
Selected MS Access/SQL Server Date/Time Functions Database Systems: Design, Implementation, & Management, 6th Edition, Rob & Coronel
Selected Oracle Date/Time Functions Database Systems: Design, Implementation, & Management, 6th Edition, Rob & Coronel
Selected Oracle Date/Time Functions (continued) Database Systems: Design, Implementation, & Management, 6th Edition, Rob & Coronel
Selected Oracle Numeric Functions Database Systems: Design, Implementation, & Management, 6th Edition, Rob & Coronel
Selected Oracle String Functions Database Systems: Design, Implementation, & Management, 6th Edition, Rob & Coronel
Selected Oracle Conversion Functions Database Systems: Design, Implementation, & Management, 6th Edition, Rob & Coronel
Selected Oracle Conversion Functions (continued) Database Systems: Design, Implementation, & Management, 6th Edition, Rob & Coronel
Oracle Sequence Database Systems: Design, Implementation, & Management, 6th Edition, Rob & Coronel
Oracle Sequence Examples Database Systems: Design, Implementation, & Management, 6th Edition, Rob & Coronel
The PRODMASTER and PRODSALES Tables Database Systems: Design, Implementation, & Management, 6th Edition, Rob & Coronel
The Oracle UPDATE Error Message Database Systems: Design, Implementation, & Management, 6th Edition, Rob & Coronel
Creating an Updatable View in Oracle Database Systems: Design, Implementation, & Management, 6th Edition, Rob & Coronel
PRODMASTER Table Update, Using an Updatable View Database Systems: Design, Implementation, & Management, 6th Edition, Rob & Coronel
Anonymous PL/SQL Block Examples Database Systems: Design, Implementation, & Management, 6th Edition, Rob & Coronel
SHOW ERRORS • Can help diagnose errors found in PL/SQL blocks • Yields additional debugging information whenever an error is generated after an PL/SQL block is created or executed Database Systems: Design, Implementation, & Management, 6th Edition, Rob & Coronel
Anonymous PL/SQL Block with Variables and Loops Database Systems: Design, Implementation, & Management, 6th Edition, Rob & Coronel
PL/SQL Basic Data Types Database Systems: Design, Implementation, & Management, 6th Edition, Rob & Coronel
The PRODUCT Table Database Systems: Design, Implementation, & Management, 6th Edition, Rob & Coronel
Creating the TRG_PRODUCT_REORDER Trigger Database Systems: Design, Implementation, & Management, 6th Edition, Rob & Coronel
Verifying the TRG_PRODUCT_REORDER Trigger Execution Database Systems: Design, Implementation, & Management, 6th Edition, Rob & Coronel
The P_REORDER Value Mismatch After Update of the P_MIN Attribute Database Systems: Design, Implementation, & Management, 6th Edition, Rob & Coronel
Stored Procedures: Advantages • Substantially reduce network traffic and increase performance • No transmission of individual SQL statements over network • Help reduce code duplication by means of code isolation and code sharing • Minimize chance of errors and cost of application development and maintenance Database Systems: Design, Implementation, & Management, 6th Edition, Rob & Coronel
Creating the PRC_PROD_DISCOUNT Stored Procedure Database Systems: Design, Implementation, & Management, 6th Edition, Rob & Coronel
Results of the PRC_PROD_DISCOUNT Stored Procedure Database Systems: Design, Implementation, & Management, 6th Edition, Rob & Coronel