answer.
Ask question
Login Signup
Ask question
All categories
  • English
  • Mathematics
  • Social Studies
  • Business
  • History
  • Health
  • Geography
  • Biology
  • Physics
  • Chemistry
  • Computers and Technology
  • Arts
  • World Languages
  • Spanish
  • French
  • German
  • Advanced Placement (AP)
  • SAT
  • Medicine
  • Law
  • Engineering
mrs_skeptik [129]
2 years ago
15

1. Create a view named customer_addresses that shows the shipping and billing addresses for each customer.

Computers and Technology
1 answer:
Verdich [7]2 years ago
5 0

Answer:

Answer given below

Explanation:

1.

CREATE VIEW CustomerAddresses AS

SELECT custo. CustomerID, EmailAddress , LastName ,FirstName,

bill.Line1 AS BillLine1, bill.Line2 AS BillLine2, bill.City AS BillCity, bill.State AS BillState, bill.ZipCode AS BillZip,

ship.Line1 AS ShipLine1, ship.Line2 AS ShipLine2, ship.City AS ShipCity, ship.State AS ShipState, ship.ZipCode AS ShipZip

FROM Customers custo , Addresses ship , Addresses bill

WHERE custo. BillingAddressID= bill.AddressID AND custo.ShippingAddressID= ship. AddressID;

2.

SELECT CustomerID, LastName, FirstName, BillLine1 FROM CustomerAddresses;

3.

CREATE VIEW OrderItemProducts

AS

SELECT Orders.OrderID, OrderDate, TaxAmount, ShipDate,

ItemPrice, DiscountAmount, (ItemPrice- DiscountAmount) AS FinalPrice,

Quantity, and (Quantity * (ItemPrice-DiscountAmount)) AS ItemTotal,

ProductName FROM

Orders, OrderItems, Products

WHERE

Orders.OrderID = OrderItems.OrderID AND

OrderItems.ProductID = Products. ProductID;

4.

CREATE VIEW ProductSummary

AS

SELECT distinct

ProductName, COUNT(OrderID) AS OrderCount, SUM(ItemTotal) AS OrderTotal

FROM

OrderItemProducts

GROUP BY ProductName;

5.

SELECT ProductName, OrderTotal

FROM ProductSummary P

WHERE 5> (select count(*) FROM ProductSummary S

WHERE P.OrderTotal<S.OrderTotal)

ORDER BY OrderTotal;

You might be interested in
1. Do you consider Facebook, MySpace, and LinkedIn forms of disruptive or sustaining technology? Why?
Mrrafil [7]
It mainly just depends on if you "misuse" them.
8 0
2 years ago
PLEASE HELP!!~~
Law Incorporation [45]

Answer:

A

Explanation:

7 0
2 years ago
Two middle-order batsmen are compared based on their performance in their previous cricket match.
Zolol [24]
How many points is this for
5 0
2 years ago
A team of students is collaborating on a program to obtain local weather data from a website, and predict weather-related school
love history [14]

Answer:

1. Using meaningful names for all variables and functions.

2. Use shorter blocks of codes wherever possible

Explanation:

Their code should be easy to read, this can be achieved by avoiding complex syntax, basically they should adopt the two methods stated in the answer

7 0
2 years ago
Write a program whose input is a string which contains a character and a phrase, and whose output indicates the number of times
otez555 [7]

Answer:

The program written in python is as follows

def countchr(phrase, char):

     count = 0

     for i in range(len(phrase)):

           if phrase[i] == char:

                 count = count + 1

     return count

phrase = input("Enter a Phrase: ")

char = input("Enter a character: ")

print("Occurence: ",countchr(phrase,char))

Explanation:

To answer this question, I made use of function

This line defines function countchr

def countchr(phrase, char):

This line initializes count to 0

     count = 0

This line iterates through each character of input phrase

     for i in range(len(phrase)):

This line checks if current character equals input character

           if phrase[i] == char:

The count variable is incremented, if the above condition is true

                 count = count + 1

The total number of occurrence is returned using this line

     return count

The main method starts here; This line prompts user for phrase

phrase = input("Enter a Phrase: ")

This line prompts user for a character

char = input("Enter a character: ")

This line prints the number of occurrence of the input charcater in the input phrase

print("Occurence: ",countchr(phrase,char))

4 0
2 years ago
Other questions:
  • What is a cursor?
    6·2 answers
  • To copy consecutive items, click the first item in the group, hold down _______, and click the last item
    7·2 answers
  • One reason for using social media is to develop social and professional contacts. True or false?
    9·2 answers
  • Choose all items that represent characteristics of a work samples.
    8·2 answers
  • A(n) ________ system collects data from various key business processes and stores the data in a single comprehensive data reposi
    9·1 answer
  • You are the IT security administrator for a small corporate network. Samuel Garcia (sgarcia) has been away on vacation and has f
    9·1 answer
  • 5.6 Look carefully at how messages and mailboxes are represented in the email system that you use. Model the object classes that
    14·1 answer
  • Write a program that reads students’ names followed by their test scores. The program should output each student’s name followed
    13·1 answer
  • Write a complete Java program that: Prompts an employee to enter the number of hours that they have worked in a given week and s
    14·1 answer
  • Write a script that inputs a line of encrypted text and a distance value and outputs plaintext using a Caesar cipher. The script
    11·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!