Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

figuring out the code on this question: View called CustomerInfo (4 points): CustomerID The CustomerInfo view should include these columns: FullName (concatenate FirstName, MiddleName, &

 figuring out the code on this question:


  1. View called CustomerInfo (4 points):
    • CustomerID


The CustomerInfo view should include these columns:

  • FullName (concatenate FirstName, MiddleName, & LastName with spaces in between)
  • Address (concatenate StreetAdddress, City, State, & ZipCode with spaces in between)
  • PrimaryEmail (If customer has no email, show NULL for the customer's email address)


Hints:

  1. Start by SELECTing CustomerID and concatenating FullName & Address from Customers.
  2. JOIN into CustomerEmails.
    • We need the view to include Customers who don't have emails, so the join type is important here.
    • We also only want the Primary Email, so only include those rows from the CustomerEmails table.
    • Please keep in mind, you can have more than 1 predicate in joins. The ON clause might be a good place to specify you only want Primary Email rows from the CustomerEmails table.


OUTPUT:

image
CoursHeroTranscribedText

CustomerID FullName 1 2 3 4 5 6 7 8 9 10 Edgar Frank Codd Kim Drexler Ralph Kimpball Jane Muriel Anderson Jimmy McGill Sally Marie McFields Walter Hartwell White Nicole McDonald Gustavo Fring Elaine Benes Odonnel Address EmailAddress 12309 Normalization Street Los Angeles CA 90059 efcodd@gmail.com kdrexler@yahoo.com rkimball@hotmail.com 666 Samoa Street Albuquerque NM 87190 5368 Dimensional BLVD Chicago IL 60659 8519 Sego Lilly Lane Devner CO 80266 666 Samoa Street Albuquerque NM 87190 562 Ashton Street Seattle WA 98178 9674 Chemistry Lane Albuquerque NM 87106 2389 Sunflower Drive Orlando FL 32827 489 Affluence Road Albuquerque NM 87121 2839 Park Street New York NY 10075 NULL jmcgill@gmail.com smcfields@yahoo.com whwhite @hotmail.com nmcdomald@bing.com gusfring@mindyourbusiness.com ebenes@bing.com

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

Database Concepts

Authors: David M. Kroenke, David J. Auer

7th edition

133544621, 133544626, 0-13-354462-1, 978-0133544626

More Books

Students also viewed these Databases questions

Question

Explain the term foreign key and give an example.

Answered: 1 week ago