Database Reference
In-Depth Information
Figure 6.12
Data values in STUDENT_CLASS table.
Figure 6.13
Data values in CLASS_CLASSROOM table.
table name STUDENT are capitalized for clarity purposes. Also, you do not have to break the
SELECT statement into two lines. If you write the statement as SELECT * FROM STUDENT
in a single line, it is perfectly acceptable. Breaking an SQL statement into multiple lines makes it
easier to read. he query result is shown in Figure 6.14, which lists the data of every row and every
column in the table STUDENT.
To retrieve data in certain rows speciied with conditions, the WHERE clause is added to the
SELECT statement. he search condition is deined in the WHERE clause. For example, to query
the student ids of the students with the last name Cox and their advisors' ids, use the following
SQL statement that includes the WHERE clause:
SELECT StudentID, FacultyID
FROM STUDENT
WHERE LastName = 'Cox'
In this SQL statement, there are other two things that are diferent from the previous SQL
statement. In the SELECT clause, the columns StudentID and FacultyID are speciied to indi-
cate that only the data from the StudentID and FacultyID columns are selected. In the WHERE
Search WWH ::




Custom Search