Question
State SQL query to satisfy the requirements below: 1) Requirements Include the following columns: first_name as First Gender Age Using the birth_date column, return the
State SQL query to satisfy the requirements below:
1)
Requirements
- Include the following columns:
- first_name as First
- Gender
- Age
- Using the birth_date column, return the person's age in Years.
- The resulting data type for the birthday should be an integer.
Query
SELECT
___ AS 'First'
, ____AS 'Gender'
, CAST(FORMAT(______,'yyyy')ASint)-CAST(FORMAT(birth_date,'yyyy')ASint)as_____
FROM
_______
2)
Requirements
- Include the following columns:
- First Name
- Last Name
- Make
- Model
- Year
- Return all people from the people table regardless of if they own a vehicle or not.
- For only those people who own a vehicle, include the make, model, and year of the vehicle(s) they own (see above).
- Use the explicit syntax for your join(s).
- Use only left outer joins.
Query
SELECT
___.____ AS 'First Name'
, ___.last_name AS 'Last Name'
, vehicles.make AS 'Make'
, vehicles.model AS 'Model'
, vehicles.____ AS 'Year'
_____
people
_______
{1:SHORTANSWER=vehicle_owners~=*vehicle_owners*}
ON people._____ = vehicle_owners._____
_____
vehicles
ON vehicles._____ = vehicle_owners._____
3)
Requirements
- Return a list of every company where the people in the people table work.
- Do not include any duplicate company names.
Query
SELECT ____
______
_______
people
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started