Presentation is loading. Please wait.

Presentation is loading. Please wait.

Copyright © 2004 Pearson Education, Inc.. Chapter 8 SQL-99: Schema Definition, Basic Constraints, and Queries.

Similar presentations


Presentation on theme: "Copyright © 2004 Pearson Education, Inc.. Chapter 8 SQL-99: Schema Definition, Basic Constraints, and Queries."— Presentation transcript:

1 Copyright © 2004 Pearson Education, Inc.

2 Chapter 8 SQL-99: Schema Definition, Basic Constraints, and Queries

3 Elmasri and Navathe, Fundamentals of Database Systems, Fourth Edition Copyright © 2004 Pearson Education, Inc. Slide 8-3 FIGURE 8.1 SQL CREATE TABLE data definition statements for defining the COMPANY schema from Figure 5.7.

4 Elmasri and Navathe, Fundamentals of Database Systems, Fourth Edition Copyright © 2004 Pearson Education, Inc. Slide 8-4 FIGURE 8.1 (continued) SQL CREATE TABLE data definition statements for defining the COMPANY schema from Figure 5.7.

5 Elmasri and Navathe, Fundamentals of Database Systems, Fourth Edition Copyright © 2004 Pearson Education, Inc. Slide 8-5 FIGURE 8.1 (continued) SQL CREATE TABLE data definition statements for defining the COMPANY schema from Figure 5.7.

6 Elmasri and Navathe, Fundamentals of Database Systems, Fourth Edition Copyright © 2004 Pearson Education, Inc. Slide 8-6 FIGURE 8.2 Example illustrating how default attribute values and referential triggered actions are specified in SQL.

7 Elmasri and Navathe, Fundamentals of Database Systems, Fourth Edition Copyright © 2004 Pearson Education, Inc. Slide 8-7 FIGURE 8.3 Results of SQL queries when applied to the COMPANY database state shown in Figure 5.6. (a) Q0. (b) Q1. (c) Q2. (d) Q8. (e) Q9. (f) Q10. (g) Q1C.

8 Elmasri and Navathe, Fundamentals of Database Systems, Fourth Edition Copyright © 2004 Pearson Education, Inc. Slide 8-8 FIGURE 8.4 Results of additional SQL queries when applied to the COMPANY database state shown in Figure 5.6. (a) Q11. (b) Q11A. (c) Q16. (d) Q18.

9 Elmasri and Navathe, Fundamentals of Database Systems, Fourth Edition Copyright © 2004 Pearson Education, Inc. Slide 8-9 FIGURE 8.5 The results of SQL multiset operations. (a) Two tables, R(A) and S(A). (b) R(A) UNION ALL S(A). (c) R(A) EXCEPT ALL S(A). (d) R(A) INTERSECT ALL S(A).

10 Elmasri and Navathe, Fundamentals of Database Systems, Fourth Edition Copyright © 2004 Pearson Education, Inc. Slide 8-10 FIGURE 8.6 Results of GROUP BY and HAVING. (a) Q24. (b) Q26.

11 Elmasri and Navathe, Fundamentals of Database Systems, Fourth Edition Copyright © 2004 Pearson Education, Inc. Slide 8-11 FIGURE 8.6 (continued) Results of GROUP BY and HAVING. (b) Q26.

12 Elmasri and Navathe, Fundamentals of Database Systems, Fourth Edition Copyright © 2004 Pearson Education, Inc. Slide 8-12 FIGURE 8.6 (continued) Results of GROUP BY and HAVING. (b) Q26.


Download ppt "Copyright © 2004 Pearson Education, Inc.. Chapter 8 SQL-99: Schema Definition, Basic Constraints, and Queries."

Similar presentations


Ads by Google