SQL Lab 7
select dob from animals; SELECT name, dob FROM animals WHERE MONTH(dob) = 6; # 1. Select all the animals born in June (assuming you don't now the month number of June) SELECT * FROM animals WHERE MONTHNAME(dob) = 'june'; # 2. Select all the animals born in the first 8 weeks of the year SELECT name, dob, WEEK(dob) AS week, WEEKOFYEAR(dob) AS week2, YEARWEEK(dob) AS week_year FROM animals where WEEKOFYEAR(dob) <= 8; # 3. Display the day (in numbers) and month of birth (in words) of all the turtles and cats born before 2007 (two columns). SELECT name, dob, DATE_FORMAT(dob, '%d')AS day_in_no, DATE_FORMAT(dob, '%M')AS month_in_words from animals where (species_id = 2 or species_id = 3) and (dob < "2007"); # 4. Display the day (in numbers) and month of birth (in words) of all the turtles and cats born before 2007 (one column). SELECT name, dob, DATE_FORMAT(dob, '%d of %M')AS format_date from animals where (speci...