Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

You have the following tables with sample data: TABLE: customer CustNum CustName City CreditLimit 1 Foxbar TORONTO 1 0 0 0 2 Wright BORONTON 1

You have the following tables with sample data:
TABLE: customer
CustNum CustName City CreditLimit
1 Foxbar TORONTO 1000
2 Wright BORONTON 1000
3 Caleb HAMPTON 900
4 manish BRAMPTON 100
5 MannyCupat OAKVILLE 3000
6 Ironwood OAKVILLE 100
7 Kent BURLINGTON 2000
8 Moore TORONTO 1000
9 Felipe MISSISSAUGA 4500
10 Kwan TORONTO 0
11 Khoury MISSISSAUGA 1000
12 Brant OAKVILLE 1500
13 Wells BURLINGTON 0
TABLE: orders
OrderNum OrderDate CustNum
11997-09-052
21997-11-063
31997-12-017
41997-12-041
51997-12-086
61997-12-154
71997-12-175
81997-09-059
91997-09-056
101997-10-0110
111997-10-083
121997-10-195
131997-10-155
141997-10-178
151997-11-049
You want to display customers who have placed at least 2 orders. Which of the following queries will display the correct results? Select all that apply.
Question 10 options:
SELECT c.custnum,custname, ordernum
FROM customer c JOIN orders o
ON c.custnum=o.custnum
WHERE ordernum>=2
GROUP BY c.custnum,custname;
SELECT c.custnum,custname, COUNT(ordernum)
FROM customer c JOIN orders o
ON c.custnum=o.custnum
GROUP BY c.custnum,custname
WHERE COUNT(ordernum)>=2;
SELECT c.custnum,custname, COUNT(ordernum)
FROM customer c JOIN orders o
ON c.custnum=o.custnum
GROUP BY c.custnum,custname
HAVING COUNT(ordernum)>=2;
SELECT c.custnum,custname
FROM customer c JOIN orders o
ON c.custnum=o.custnum
GROUP BY c.custnum,custname
HAVING COUNT(ordernum)>=2;
SELECT c.custnum,custname, COUNT(ordernum)
FROM customer c JOIN orders o
ON c.custnum=o.custnum
GROUP BY c.custnum,custname;

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

Step: 3

blur-text-image

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 Machine Performance Modeling Methodologies And Evaluation Strategies Lncs 257

Authors: Francesca Cesarini ,Silvio Salza

1st Edition

3540179429, 978-3540179429

Students also viewed these Databases questions

Question

Ensure continued excellence in people management.

Answered: 1 week ago

Question

Enhance the international team by recruiting the best people.

Answered: 1 week ago