Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

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

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image_2

Step: 3

blur-text-image_3

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Income Tax Fundamentals 2013

Authors: Gerald E. Whittenburg, Martha Altus Buller, Steven L Gill

31st Edition

1111972516, 978-1285586618, 1285586611, 978-1285613109, 978-1111972516

More Books

Students also viewed these Databases questions

Question

Is there administrative support?

Answered: 1 week ago