Page 224
Using the Class_Summary view, the user can simply select the desired columns without specifying any join conditions. Listing 8.39 illustrates how a user can select those classes whose titles include the phrase INTRO.
Listing 8.39. Selecting from a view.
SQL> select Class_ID, Class_Building, Class_Room, 2 Department_ID, Course_ID, Title, Last_Name 3 from Class_Summary 4 where 5 Title like `%INTRO%'; CLASS_ CLASS_BUILDING CLAS DEPART COURS TITLE LAST_NAME ------ -------------- ---- ------ ----- -------------------- --------- 109100 FLUGLE HALL 180 BIO 101 INTRO TO BIOLOGY WEISS 108300 FLUGLE HALL 150 ENGL 101 INTRO TO ENGLISH LIT CHERNOW
This lesson focused on these features of SQL:
On Day 9, "Programming an Oracle Database with PL/SQL," you learn about the
basic elements of PL/SQL such as flow-of-control statements, variable declaration, and
procedure and function declarations.
Page 225
Q Can two tables, A and B, be joined by columns if the first column's datatype in table A is not the same as the second column's datatype in table B?
A Yes, it's possible. For example, you can use a conversion function, such as TO_CHAR, TO_DATE, or TO_NUMBER, to convert the first column so that the datatype returned by the function is the same as the second column's datatype.
The purpose of the Workshop is to allow you to test your knowledge of the material discussed in the lesson. See whether you can correctly answer the questions in the quiz and complete the exercise before you continue with tomorrow's lesson.
The number of instructors is 18. The number of classes being offered is 10. However, the number of distinct Instructor_IDs in the Class table is nine. Using these tables and SQL, provide a complete explanation.
Page 226