QBE Queries: Get Answers for RADL DB

  • Context:
  • Thread starter Thread starter mathmari
  • Start date Start date
Join the discussion
Ask a follow-up here, or get your own question answered by working scientists, mathematicians and engineers — people, not an autocomplete.
Real named experts · corrections over time · the nuance an AI answer skips
9 replies · 1K views
mathmari
Gold Member
MHB
Messages
4,984
Reaction score
7
Hey! :giggle:

Give QBE-queries as for the RADL-database.
1. Give a QBE-expression that lists the names of the employees that accepted the orders from the company Maier Ingrid.
2. Give a QBE-expression that gives the order numbers for each individual customer.
3. Give a QBE-expression that lists all orders, the supervising employees and the total volume.I have done the following :

1. In SQL we had the query :

SELECT p.name
FROM personal p, auftrag a, kunde k
WHERE (p.persnr = a.persnr) AND (a.kundnr = k.nr) AND (k.name = 'Maier Ingrid')

So is the QBE-query then :
1638788359984.png


:unsure:2. Do we write :
1638788760089.png


Or do we need only the first table? Or do we need also a condition with GROUP BY in case that one costumer has more than one order?

:unsure:3. Do we do that as follows?
1638790609601.png


:unsure:

To check if we have the correct expressions can nwe check that somehow? Do we maybe write it inside "Afrage" ?

1638797823303.png


:unsure:
 
Last edited by a moderator:
Physics news on Phys.org
Klaas van Aarsen said:
Unfortunately I'm not familiar with QBE queries, and the wiki article does not seem to contain enough information. (Worried)

I uploaded https://docdro.id/G2SyjbL the notes that I am looking at. From page 39 (on the pdf from page 65) there is about QBE. As I understand it, we write on the tables the columns that we want and if there are specific conditions. :unsure:
 
I've examined your notes. And it seems that the variables you introduced should be preceded by an underscore.
So it should be for instance _PNR instead of PNR. 🤔

Additionally we should mark the fields that we are interested in by a keyword followed by a dot.
At this time I'm not entirely sure what they mean by a keyword, but by their examples it should be like "P.".
So for question 1 I think we should have "P." in the column "name" in the table personal. 🤔
 
Klaas van Aarsen said:
I've examined your notes. And it seems that the variables you introduced should be preceded by an underscore.
So it should be for instance _PNR instead of PNR. 🤔

Additionally we should mark the fields that we are interested in by a keyword followed by a dot.
At this time I'm not entirely sure what they mean by a keyword, but by their examples it should be like "P.".
So for question 1 I think we should have "P." in the column "name" in the table personal. 🤔

So do we have for question 1 :

1638813007073.png


and for question 3 :
1638813027195.png


? :unsure:At question 2 I noted now that the original statement is : "Geben Sie einen QBE-Ausdruck an, der die Auftragssummen je einzelnem Kunden ausgibt.". I thought that it were " Auftragsnummern" instead of " Auftragssummen". Can it be " Auftragssummen" ? Or is it a typo? Does it mean to count all orders or all costs of each costumer? Or is it a typo and we should give all order numbers? :unsure:
 
Last edited by a moderator:
Klaas van Aarsen said:
It makes sense to me to want to see the sum of the prices of all orders per customer. That would be the sum of all gesamtpreis'es per customer. 🤔

So do we use the same tables as in question 3 ? Or do you mean an other gesamtpreis? :unsure:
 
mathmari said:
So do we use the same tables as in question 3 ? Or do you mean an other gesamtpreis?
I think so yes. 🤔

And in question 3 we need the "total volume", which I'd actually interpret as the sum of all anzahls. :unsure:
 
Klaas van Aarsen said:
I think so yes. 🤔

And in question 3 we need the "total volume", which I'd actually interpret as the sum of all anzahls. :unsure:

So do we have have for question 2 :
1638841321893.png


and for question 3 :
1638841428021.png


? :unsure: