
Statement 1: SELECT Count open parenthesis ArtWork I D close parenthesis AS NumPaintings FROM ArtWorks WHERE YearOfWork greater than 1900. Count open parenthesis ArtWork I D close parenthesis is labeled This aggregate function returns a count of the number of records. AS NumPaintings is labeled Defines an alias for the calculated value. YearOfWork greater than 1900 is labeled Count number of paintings after year 1900. Output 1: A table that consists of one column and one row is shown. The column heading, center aligned is as follows: NumPaintings. The row entry, left aligned is as follows: 745. The alignment of the row entry is left aligned. Note: This S Q L statement returns a single record with a single value in it.
Statement 2: SELECT Nationality comma Count open parenthesis Artist I D close parenthesis AS NumArtists FROM Artists GROUP BY Nationality. GROUP BY is labeled S Q L keywords to group
output by specified fields. Output 2: A table that consists of two columns and five rows are shown. The column headings, center aligned are as follows: Nationality, NumArtists. Row 1, Column Nationality: Belgium. Row 1, Column NumArtists: 4. Row 2, Column Nationality: England. Row 2, Column NumArtists: 15. Row 3, Column Nationality: France. Row 3, Column NumArtists: 36. Row 4, Column Nationality: Germany. Row 4, Column NumArtists: 27. Row 5, Column Nationality: Italy. Row 5, Column NumArtists: 53. The alignment of the row entries are left aligned. Note: This S Q L statement returns as many records as there are unique values in the group-by field.
Back