1answer.
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]
3 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]3 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
Who is the CEO of Quora?
irina [24]
Adam D'Angelo is the CEO and co-founder of Quora, an online knowledge market. He was also chief technology officer and <span>vice president of engineering for Facebook.</span>
5 0
2 years ago
The user does not need to highlight data within an Excel worksheet in order to remove conditional formatting. True or false
san4es73 [151]

True

Excel 2019 makes it easy to remove conditional formatting since users do not need to highlight data in order to remove it.

5 0
3 years ago
Exercise : Randomizer In this exercise, we are going to create a static class Randomizer that will allow users to get random int
Nutka1998 [239]

Answer:

Here the code is by using java.

Explanation:

//Randomizer.java

public class Randomizer {

public static int nextInt() {

//get random number from 1-10

int randInteger = (int) (Math.random() * (11) + 1);

//if number is greater than 10 or less than 1

while (randInteger > 10 || randInteger < 1) {

randInteger = (int) (Math.random() * (11) + 1);

}

return randInteger;

}

public static int nextInt(int min, int max) {

//formula to get random number from min-max

int randInteger = (int) (Math.random() * (max + 1) + min);

while (randInteger > max || randInteger < min) {

randInteger = (int) (Math.random() * (max + 1) + min);

}

return randInteger;

}

}

//RandomizerTester.java

public class RandomizerTester {

public static void main(String[] args) {

System.out.println("Results of Randommizer.nextInt()");

for (int i = 0; i < 10; i++) {

System.out.println(Randomizer.nextInt());

}

int min = 5;

int max = 10;

System.out.println("\n Results of Randomizer.nextInt(5,10)");

for (int i = 0; i < 10; i++) {

System.out.println(Randomizer.nextInt(min, max));

}

}

}

OUTPUT:

Results of Randommizer.nextInt()

9

2

3

8

5

9

4

1

9

2

Results of Randomizer.nextInt(5,10)

9

8

9

7

5

10

5

10

7

7

4 0
2 years ago
It skills which move well between industries are considered?
Butoxors [25]

Answer:

They are termed as ethics. But remember different industries have a different set of ethics or rules that they expect their employees to follow. However, some that go well with all are common to all. And they are the standard ethics that are followed by all the industries. Failing to these is never expected.

Explanation:

Please check the answer section.

6 0
2 years ago
Write a C program (doublecopy) that allows a user to extract some part of an existing file (fileSource) and copy it twice to a n
Slav-nsk [51]

Answer:

Check the explanation

Explanation:

#include <stdio.h>

#include <sys/stat.h>

#include <stdlib.h>

#include <fcntl.h>

#include <errno.h>

#include <unistd.h>

extern int errno;

struct stat st;

int main(int argc, char **argv){

  int num1 = atoi(argv[1]); // Getting num1 from user

  int num2 = atoi(argv[2]); // Getting num2 from user

  char *fileSource = argv[3];

  char *fileTarget = argv[4];

 

  int source_fd = open(fileSource, O_RDONLY); // opening the file in read only mode

  int target_fd = open(fileTarget, O_WRONLY | O_CREAT); // opening the target file in Writeonly mode if file is not found it will create

   

  char *ch = (char *) calloc(num2+num1, sizeof(char));

 

  stat(fileSource, &st);

  if(st.st_size < (num1 + num2)){

      printf("File Size is smaller than the specified bytes\n");

      read(source_fd, ch, st.st_size); // reading the file upto the end

      write(target_fd, ch, st.st_size); // write to the file

      write(target_fd, ch, st.st_size); // two times writing to the file

  }else{

      if(lseek(source_fd, (off_t)num1, SEEK_SET) < 0 ) // moving the cursor to after the specified bytes from the start

      {

          printf("Some Error occured while seeking the file");

          return -1;

      }

      read(source_fd, ch, num2); // reading num2 bytes from the source

      write(target_fd, ch, num2); // writing two times to the target

      write(target_fd, ch, num2);

     

  }

 

  return 0;

 

}

1 2 #include <stdio.h> #include <sys/stat.h> #include <stdlib.h> #include <fcntl.h> #include <errno.h> #include <unistd.h> 4

The code screenshot and code output are attached below.

3 0
2 years ago
Other questions:
  • A popular use of cd-rw and cd-r discs is to create audio cds. what is the process of copying audio and/or video data from a purc
    11·1 answer
  • Which database is more secure: the java-based apache derby or mysql?
    6·1 answer
  • Which of the following is considered a benefit when using slab allocator?
    6·1 answer
  • Please help! would appreciate it very much!
    13·1 answer
  • What is the value of i printed? j = i = 1 i += j + j * 5 print("What is i?", i)
    11·1 answer
  • Okay, guys, I know this one will be very hard however while trying to finish this assignment I got overwhelmed and lost by the s
    9·1 answer
  • What would a digitizing application create?
    13·2 answers
  • Credence is a student in college.
    13·2 answers
  • Para ti que es el sexting​
    11·1 answer
  • Which best explains a password attached to a document?
    6·2 answers
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!