Question: 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 1 options:
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
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;
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, ordernum
FROM customer c JOIN orders o
ON c.custnum=o.custnum
WHERE ordernum>=2
GROUP BY c.custnum,custname;

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!