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.
It seems like sqlite doesn't allow parenthesis for select statement when performing UNION EXCEPT INTERSECT operators?
Without parenthesis, after UNION we get IRN and IWS, next it will perform EXCEPT and the result will be IWS, lastly it will do INTERS...
I think youou can solve the problem both ways,using a subquery with NOT IN,or using a LEFT JOIN to achieve the same result. But the hint encourages the use of a subquery to practice that method.
You can have a try with both approaches in your terminal...
Hello,
In the case study for the project, it say "The current location (depot) of vehicles available for hire is recorded". Does this mean at every depot, there is a attribute that is a list where every depot with available hire car is recorded? Or ...
"Where" filters rows before any grouping or aggregation is done,you cannot use aggregate functions (like AVG, COUNT, etc.) directly in the "WHERE" clause because the aggregation happens after the filtering is done. "Having" is used specifically to fi...
Hi,
Lab4 Q3 states "Hint use a subquery to calculate the average quantity, you will need to use HAVING also (this is because in SQL the WHERE is applied before GROUP BY, meaning it cannot reference aggregate functions such as an average)"
To get the ex...
Hello Professor,
I have 2 questions from the case study.
1) ( x) x dollar digits and 2 cent digits --- Does that mean decimal(5,2)?
2) Case study talks about credit card details - should I create these columns in client table or hire table or a new ta...
I think it's the problem with the question. Even if the result returned by except is nothing, that is, it is equivalent to performing a union operation on IRN and IWS, it will also return two results. This is very simple logic.
If it is not required then I am not going to put it in. I guess I was just thinking about it from a business perspective and I thought, is this the missing link? That leads to a HD? The obvious one that we need to put it. Point of Sale I guess is ...
With Q1, it says to use a sub query, Do we have to do it that way or can we just use a join and compare the columns with the same cust id, then collect the data that has the creditcode of C that way
yeah, I know what you mean. Our expected output based on the given data should be both IRN and IWS. But when we're intersecting the results of two queries,there are no common item ids between these two, this part of the query is returning nothing,as ...
I have the same question and you answer is a little bit confusing since based on the given data, each item id (IRN or IWS) appear with only one description for each (shown in the attached image) in the items table. Therefore, my understanding of ques...
I think it s great that you are considering the billing and invoicing aspect. It makes sense to include an invoice or billing table to link all the relevant data together (e.g., client, vehicle, tariffs, number of days hired, insurance details),whi...
1.Yes, there can be relationships between multiple entities.For example, as per the case study, a vehicle can be related to a depot (where it is stored or picked up) and a client (who hires it).You are free to infer and add additional relationships a...
Based on the limited data provided, we would get the output "IWS." For this question, we need to select the item ids that are either IRN (associated with 'INK-RESIN') or IWS (associated with 'INK-WRSOL'), and then remove(we should use another operati...
" Question Find the item ids that are either 'INK-RESIN' or 'INK-WRSOL' but not both in the po items table.
Hint you need to use UNION and INTERSECT operations. "
If you see the dataset from items table as below, IRN and IWS have one entry each for 'I...
I understand that relationship attributes are a separate concept to Multiplicity, but I did find a useful video that explains this in detail https www.youtube.com watch?v psgMeCyXDxc
However, this takes the worksheet exercise to a new level because...
If I have understood your question correctly, then I am afraid your interpretation is not correct.
Multiplicity means how many times an entity can participate in a relationship.
In the class we did an example on newspapers and propertyForRent as two ...