QBE Queries: Get Answers for RADL DB

  • Context: MHB 
  • Thread starter Thread starter mathmari
  • Start date Start date
Click For Summary

Discussion Overview

The discussion revolves around constructing QBE (Query By Example) queries for the RADL database, focusing on retrieving employee names, order numbers, and total order volumes. Participants explore the syntax and requirements for these queries, including conditions and potential ambiguities in the original problem statements.

Discussion Character

  • Exploratory
  • Technical explanation
  • Debate/contested

Main Points Raised

  • One participant provides an SQL query and seeks to translate it into QBE, questioning whether additional conditions or groupings are necessary.
  • Several participants express uncertainty about QBE syntax, particularly regarding the use of underscores and keywords in variable names.
  • There is a discussion about the interpretation of a task that mentions "Auftragssummen" (order sums) versus "Auftragsnummern" (order numbers), with participants debating whether it is a typo or a different requirement.
  • One participant suggests that the "total volume" in question 3 could be interpreted as the sum of quantities (anzahls) of orders.
  • Another participant agrees with the interpretation of needing to sum prices per customer for question 2, but there is still uncertainty about the specific tables to use.

Areas of Agreement / Disagreement

Participants generally express uncertainty and explore multiple interpretations of the requirements, particularly regarding the phrasing of the tasks and the correct QBE syntax. No consensus is reached on the correct QBE expressions or the interpretation of the task statements.

Contextual Notes

Participants note potential ambiguities in the original problem statements and the need for clarification on the use of specific terms and syntax in QBE queries.

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
Hey mathmari!

Unfortunately I'm not familiar with QBE queries, and the wiki article does not seem to contain enough information. (Worried)
 
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:
Looks about right. (Nod)

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. 🤔
 
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:
 
  • #10
Looks about right to me. (Nod)
 

Similar threads

  • · Replies 67 ·
3
Replies
67
Views
4K
  • · Replies 35 ·
2
Replies
35
Views
3K