Question

List the customer number from the ORDERS table for each customer who has placed an order...

List the customer number from the ORDERS table for each customer who has placed an order with the justlee books. List each customer only once

Homework Answers

Answer #1

SQL query is -->

SELECT DISTINCT( customer_number ) FROM ORDERS WHERE column_name = "Justlee books";

SELECT is used to select the rows

DISTINCT is used to give different result

FROM is used for selecting table

WHERE is used for condition.

Here, in this question, suppose, column_name is the name of the column which contains the rows of who has placed order with justlee books. If name of the column is book_type, then sql would be -->

SELECT DISTINCT( customer_number ) FROM ORDERS WHERE book_type = "Justlee books";

Know the answer?
Your Answer:

Post as a guest

Your Name:

What's your source?

Earn Coins

Coins can be redeemed for fabulous gifts.

Not the answer you're looking for?
Ask your own homework help question
Similar Questions
Problem 1 The table in worksheet "Problem 1" is a list of orders from a company...
Problem 1 The table in worksheet "Problem 1" is a list of orders from a company that sells sports products. Each row is an order. Only one type of product is sold in each order, but the quantity and price of each unit vary across orders. Information about each order includes location, customer, segment, product sold, order date, the list price per unit, the price each unit was actually sold in the order (unit price), quantity of units sold, revenue...
CREATE TABLE Customers (Customer# NUMBER(4), LastName VARCHAR2(10) NOT NULL, FirstName VARCHAR2(10) NOT NULL, Address VARCHAR2(20), City...
CREATE TABLE Customers (Customer# NUMBER(4), LastName VARCHAR2(10) NOT NULL, FirstName VARCHAR2(10) NOT NULL, Address VARCHAR2(20), City VARCHAR2(12), State VARCHAR2(2), Zip VARCHAR2(5), Referred NUMBER(4), Region CHAR(2), Email VARCHAR2(30), CONSTRAINT customers_customer#_pk PRIMARY KEY(customer#), CONSTRAINT customers_region_ck CHECK (region IN ('N', 'NW', 'NE', 'S', 'SE', 'SW', 'W', 'E')) ); CREATE TABLE Orders (Order# NUMBER(4), Customer# NUMBER(4), OrderDate DATE NOT NULL, ShipDate DATE, ShipStreet VARCHAR2(18), ShipCity VARCHAR2(15), ShipState VARCHAR2(2), ShipZip VARCHAR2(5), ShipCost NUMBER(4,2), CONSTRAINT orders_order#_pk PRIMARY KEY(order#), CONSTRAINT orders_customer#_fk FOREIGN KEY (customer#) REFERENCES customers(customer#)); In...
Rita placed an order for 300 shares of each of four separate IPOs (Orders A, B,...
Rita placed an order for 300 shares of each of four separate IPOs (Orders A, B, C, and D) with an offer price of $16 each. She received 100 shares of Order B, 200 shares of Order D, and 300 shares of the other orders. At the end of the first day, Order A was overpriced by $2 a share, Order B was underpriced by $4 a share, Order C was correctly priced, and Order D was overpriced by $1...
CREATE TABLE Orders (Order# NUMBER(4), Customer# NUMBER(4), OrderDate DATE NOT NULL, ShipDate DATE, ShipStreet VARCHAR2(18), ShipCity...
CREATE TABLE Orders (Order# NUMBER(4), Customer# NUMBER(4), OrderDate DATE NOT NULL, ShipDate DATE, ShipStreet VARCHAR2(18), ShipCity VARCHAR2(15), ShipState VARCHAR2(2), ShipZip VARCHAR2(5), ShipCost NUMBER(4,2), CONSTRAINT orders_order#_pk PRIMARY KEY(order#), CONSTRAINT orders_customer#_fk FOREIGN KEY (customer#) REFERENCES customers(customer#)); INSERT INTO ORDERS VALUES (1000,1005,TO_DATE('31-MAR-09','DD-MON-YY'),TO_DATE('02-APR-09','DD-MON-YY'),'1201 ORANGE AVE', 'SEATTLE', 'WA', '98114' , 2.00); INSERT INTO ORDERS VALUES (1001,1010,TO_DATE('31-MAR-09','DD-MON-YY'),TO_DATE('01-APR-09','DD-MON-YY'), '114 EAST SAVANNAH', 'ATLANTA', 'GA', '30314', 3.00); INSERT INTO ORDERS VALUES (1002,1011,TO_DATE('31-MAR-09','DD-MON-YY'),TO_DATE('01-APR-09','DD-MON-YY'),'58 TILA CIRCLE', 'CHICAGO', 'IL', '60605', 3.00); INSERT INTO ORDERS VALUES (1003,1001,TO_DATE('01-APR-09','DD-MON-YY'),TO_DATE('01-APR-09','DD-MON-YY'),'958 MAGNOLIA LANE', 'EASTPOINT', 'FL', '32328', 4.00);...
Read the narrative below of an ordering process: The mailroom receives customer orders from customers, where...
Read the narrative below of an ordering process: The mailroom receives customer orders from customers, where clerks sort orders from the rest of the mail, group them into bathes, and forwards the orders to the order entry department. A clerk in the order entry department first checks that the batch is complete. The clerk looks up the customer number in a customer file and then keys the essential customer information into a network computer. The computer then checks the customer...
Using CIS495 sample database, write the SQL query: a. In the orderdetails table, list the unique...
Using CIS495 sample database, write the SQL query: a. In the orderdetails table, list the unique order which has more than 3 productCode in each order. b. List the customer name and address who purchase more than 5 items (ProductCode) in the order.  
Saul wants to buy a new writer's desk, but he doesn't want to spend more than...
Saul wants to buy a new writer's desk, but he doesn't want to spend more than $350. Write a select statement to find products matching these requirements For each customer, list the customer name and city and state in this format: City, State (one column) Display only those orders where more than one different product has been ordered Find the average price of bookcases A. List all the customers and list the number of different shipping addresses for each. Customers...
An order is placed to a clothing distribution center on average every 10 seconds, but the...
An order is placed to a clothing distribution center on average every 10 seconds, but the time between orders has uncertain variability associated with it. Orders are independent. The fulfilment manager needs to collect orders that have been received and release them to an order picker who will retrieve the order’s items from storage locations. a. If the manager releases all orders received in 1 minute to an order picker, what is the average number of orders and the CV...
Adams, Inc. customers mail in their orders to the Adams customer service center where clerks open...
Adams, Inc. customers mail in their orders to the Adams customer service center where clerks open the orders and review them for accuracy. The clerks then key orders into the computer at which time the computer performs certain edits of the data such as reasonableness tests. As the clerk is entering data the computer populates the order input screen with data from the applicable customer and inventory master data. The computer displays the completed order and the clerk reviews the...
in mysql 3. Write a SELECT statement that returns one row for each customer that has...
in mysql 3. Write a SELECT statement that returns one row for each customer that has orders with these columns:   The email_address column from the Customers table   The sum of the item price in the Order_Items table multiplied by the   quantity in the Order_Items table   The sum of the discount amount column in the Order_Items table   multiplied by the quantity in the Order_Items table   Sort the result set in descending sequence by the item price total for each customer.  
ADVERTISEMENT
Need Online Homework Help?

Get Answers For Free
Most questions answered within 1 hours.

Ask a Question
ADVERTISEMENT