77.2k views
1 vote
5.17 LAB - Select horses with logical operatorsThe Horse table has the following columns:ID - integer, primary keyRegisteredName - variable-length stringBreed - variable-length stringHeight - decimal numberBirthDate - dateWrite a SELECT statement to select the registered name, height, and birth date for only horses that have a height between 15.0 and 16.0 (inclusive) or have a birth date on or after January 1, 2020.361278.2033072.qx3zqy7LAB ACTIVITY5.17.1: LAB - Select horses with logical operators0 / 10Main.sqlLoad default template...12-- Your SELECT statement goes here

User Kougami
by
8.0k points

1 Answer

2 votes

This statement selects the registered name, height, and birth date from the "Horse" table where the height is between 15.0 and 16.0 (inclusive) or the birth date is on or after January 1, 2020.

SELECT RegisteredName, Height, BirthDate: This part of the statement specifies the columns you want to retrieve from the "Horse" table. In this case, you're interested in the "RegisteredName," "Height," and "BirthDate" columns.

FROM Horse: This specifies the table from which you're selecting the data, which is the "Horse" table in this case.

WHERE (Height BETWEEN 15.0 AND 16.0) OR (BirthDate >= '2020-01-01'): This is the filtering condition. It restricts the rows returned to those that meet specific criteria.

SELECT

RegisteredName,

Height,

BirthDate

FROM

Horse

WHERE

(Height BETWEEN 15.0 AND 16.0)

OR

(BirthDate >= '2020-01-01');

User Leaksterrr
by
8.6k points

No related questions found