Please consider offering answers and suggestions to help other students!
And if you fix a problem by following a suggestion here,
it would be great if other interested students could see a short
"Great, fixed it!" followup message.
WHERE is used to filter data before aggregation
HAVING is used to filter data after aggregation (after GROUP BY clause)
As far as I remembered, you can actually use both WHERE and HAVING at the same time. Just note that WHERE will filter the data befor...
Hi Dr Nasim,
I am confused about Q10.
What is the problem with the following query?
SELECT job id, po date FROM pos WHERE po date '1990-01-03' GROUP BY job id;
A. The date is mentioned incorrectly
B. po date is not used in group by and is also not an a...
Hi,
This has also been updated, there is an issue with the way the conditions in the having are evaluated.
HAVING count(cust id) 2 AND city OR phone IS NOT NULL
should be
HAVING COUNT(cust id) 2 AND (city IS NOT NULL OR phone IS NOT NULL)
You need to ...
Hello,
While I was preparing for the mid-term exam, in one of the slides I found the statement
If SELECT list includes an aggregate function and there is no GROUP BY clause, SELECT list cannot reference a column out with an aggregate function. For e...
Hi,
Additionally, not using the GUI tools to generate SQL and automatically do a lot of the tasks can be beneficial with knowing how the SQL works.
Thanks,
Adam.
ANONYMOUS wrote
Personally, I would pick the option C. The FK is explained in the relationship and thats the reason why it is not shown as attributes.
Note I might be wrong.
Hi,
This has also been updated, there is an issue with the way the conditions in the having are evaluated.
HAVING count(cust id) 2 AND city OR phone IS NOT NULL
should be
HAVING COUNT(cust id) 2 AND (city IS NOT NULL OR phone IS NOT NULL)
You need to ...
I am really struggling with this whether the correct answer is C or D?
Which of the following statements is true regarding the representation of foreign
keys in an Entity-Relationship Diagram (ERD) using UML notation?
A. Foreign keys are explicitly sho...
Hi, im aware that the porject is worth 20 of this unit and im also aware that afer the porject we will have a take home test. My question is, is the test worth half of the project?, or is it worth no mark but is just require for the student to do an...
Hi,
The GROUP BY statement in SQL is used to arrange identical data into groups. This statement is often used with aggregate functions (like COUNT, SUM, MAX, MIN, AVG) to group the result-set by one or more columns. Here s what happens when you use ...