Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Create user-defined functions that replicate the following: 1. CONCAT(HotelHNumber,' ' , HotelStreet,' ' , HotelCity,' ' , HotelState, ' ' , HotelZip) 2. CONCAT(CustomerHNumber,' '

Create user-defined functions that replicate the following:

1. CONCAT(HotelHNumber,' ' , HotelStreet,' ' , HotelCity,' ' , HotelState, ' ' , HotelZip)

2. CONCAT(CustomerHNumber,' ' , CustomerStreet,' ' , CustomerCity,' ' , CustomerState, ' ' , CustomerZip)

The goal is to make a function that automatically takes those inputs and turns them into a full address.

Two tables for reference:

imageimage

CREATE TABLE Customer ( CustomerID INT FirstName VARCHAR(30) LastName VARCHAR(30) CustomerPhone VARCHAR(12) Customer Email VARCHAR (35) CustomerHNumber INT CustomerStreet VARCHAR (30) CustomerCity VARCHAR (30) CustomerState CHAR(2) CustomerZip INT ); NOT NULL NOT NULL, NOT NULL, NOT NULL NOT NULL, NOT NULL, NOT NULL, NOT NULL, NOT NULL, NOT NULL IDENTITY PRIMARY KEY, UNIQUE CHECK (CustomerPhone LIKE '[0-9][0-9][0-9]-[0-9][0-9][0-9]-[0-9][0-9][0-9][0-9]'), --phone number format CHECK (CustomerState LIKE '[A-Z][A-Z]'), --only allows state abbreviation CHECK (CustomerZip LIKE '[0-9][0-9][0-9][0-9][0-9]') --zip code is always 5 digits

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

Statistics For Business And Economics

Authors: Paul Newbold, William Carlson, Betty Thorne

8th Edition

0132745658, 978-0132745659

More Books

Students also viewed these Databases questions

Question

Briefly describe computer- assisted approaches to production.

Answered: 1 week ago