SQL Use the UNION operator to generate a result set consisti

SQL

Use the UNION operator to generate a result set consisting of two columns from the Vendors table: VendorName and VendorState. If the vendor is in California, the VendorState value should be “CA”, otherwise, the VendorState value should be “Outside CA”. Sort the final result set by VendorName.

The result set has 122 rows:

VendorName Vendor St. Abbey Office Furnishings CA 2 American Booksellers Assoc Outside CA 3 American Express CA 4 ASC Signs CA 5 Ascom Hasler Mailing Systems Outside CA Outside CA 6 AT&T; 7 Aztek Label CA 8 Baker & Taylor Books Outside CA 9 Bertelsmann Industry Svcs. Inc CA BFI Industries CA 10 11 Bill Jones CA

Solution

SELECT VendorName FROM Vendors

UNION

SELECT VendorState FROM Vendors

if you like this answer, please give a thumbs up and if you have some doubt just ask in the comment section below. I will try to help. Cheers

SQL Use the UNION operator to generate a result set consisting of two columns from the Vendors table: VendorName and VendorState. If the vendor is in California

Get Help Now

Submit a Take Down Notice

Tutor
Tutor: Dr Jack
Most rated tutor on our site