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

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!