QBE Queries: Get Answers for RADL DB

  • MHB
  • Thread starter mathmari
  • Start date
In summary, the conversation is about creating QBE queries for a RADL-database. The first question involves listing the names of employees who accepted orders from a specific company. The second question is about giving the order numbers for each individual customer. The third question asks for a list of all orders, the supervising employees, and the total volume. The conversation also includes some discussion and clarification about the specific tables and fields to be used in the queries.
  • #1
mathmari
Gold Member
MHB
5,049
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
  • #2
Hey mathmari!

Unfortunately I'm not familiar with QBE queries, and the wiki article does not seem to contain enough information. (Worried)
 
  • #3
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:
 
  • #4
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. 🤔
 
  • #5
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:
  • #6
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. 🤔
 
  • #7
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:
 
  • #8
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:
 
  • #9
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)
 

Related to QBE Queries: Get Answers for RADL DB

1. What is a QBE query?

A QBE (Query by Example) query is a type of database query that allows users to search for data by providing an example of the data they are looking for. It is a user-friendly way to retrieve information from a database without needing to know complex query languages.

2. How does a QBE query work?

A QBE query works by allowing users to input an example of the data they are searching for, using a form or template. The query then searches the database for all records that match the example provided, and returns the results to the user.

3. What are the advantages of using QBE queries?

QBE queries are user-friendly and do not require knowledge of complex query languages. They also allow for more flexible and intuitive searches, as users can input specific examples of the data they are looking for. Additionally, QBE queries can help to reduce errors and improve efficiency in retrieving data from a database.

4. What are some common applications of QBE queries?

QBE queries are commonly used in database management systems, such as Microsoft Access, to retrieve data from a database. They are also used in online search engines, allowing users to search for information using keywords or phrases.

5. Are there any limitations to using QBE queries?

While QBE queries are user-friendly and efficient, they may not be suitable for complex or advanced searches. Some databases may also not support QBE queries, so it is important to check the capabilities of the database before using this type of query.

Similar threads

  • Set Theory, Logic, Probability, Statistics
2
Replies
67
Views
3K
  • Set Theory, Logic, Probability, Statistics
2
Replies
35
Views
2K
Back
Top