Instruction
First, let's get to know our data. We'll use two simple tables with information from an art museum. On the right side of this screen, there is a button named . Click it to study the structure of the tables.
The Artist table includes:
- internal identifiers for each artist (the
Idcolumn), - each artist's first and last name (
FirstNameandLastName), - artists' birth and death dates (
BirthDateandDeathDate), - each artist's nationality (
Nationality).
The Painting table includes:
- internal IDs for each painting (the
Idcolumn), - artist IDs (
ArtistId), - painting titles (
Title), - year of creation (
Painted), - an expert rating of the painting (
Rating).
Are you ready for the first exercise?
Exercise
For each painting created after 1800, show its title and the year in which it was painted (the Painted column). Include paintings for which the creation date is unknown.
Stuck? Here's a hint!
Use a WHERE clause to filter paintings created after 1800. To check whether a column is NULL, you'll need an IS NULL statement.
If you want to refresh your knowledge of SQL Basics in SQL Server, look at our SQL Basics in SQL Server course. You'll find relevant help in Part 2: Selecting from one table.



