I have some questions about something that I'm working on in an assignment for my database class.

Here is the schema for the questions I'm working on, so that you know what to refer to:

Category(class, function, country, num_guns, max_altitude, max_fuel)
Planes(pname, class, year)
DogFights(dname, date)
Outcomes(pname, dname, result)

The first few questions I worked on I was able to get just fine since they were just using the projection and select operations, but I'm getting a little confused with the next few. I'm guessing that I will likely have to use the cross-product somewhere, but I just don't quite know how I would use it.

The questions are the following: What are the names of the planes that carried the least amount of fuel in the Battle over Pearl Harbor?

What are the names of planes that can carry more fuel than the Memphis Belle?

What are the names of all the planes that participated in a dog fight in which Hard Luck also participated?

Today in our clas, we did go over Cartesian products a little more in relation to relational algebra, and I have got a little bit of an understanding now. In the question just before the ones I posted here, it's asking what class of plane can fly the highest, and I figured it out using an example we did in class today. For that question I figured out the following:

`Category * 𝜌c(Category)

PA <- ∏class(category.max_altitude < c.max_altitude(Category * 𝜌c(Category))

∏class(category) - PA`

So for those questions I posted, would I just do something like this in conjunction with the projection and select operations?

  • 1
    $\begingroup$ Hello! We discourage posts that simply state a problem out of context, and expect the community to solve it. Assuming you tried to solve it yourself and got stuck, it may be helpful if you wrote your thoughts and what you could not figure out. It will definitely draw more answers to your post. Can you edit your post to ask about a specific conceptual issue you're uncertain about? As a rule of thumb, a good conceptual question should be useful even to someone who isn't looking at the problem you happen to be working on. $\endgroup$ – D.W. Sep 23 '15 at 5:04
  • $\begingroup$ I figured out that it's actually a cross-product or Cartesian product (and also renaming) I will be using in this case. That's why I've made the edit I did. I get the basic idea of how this works, but a little help here would still be useful. $\endgroup$ – Dan Czarnecki Sep 23 '15 at 16:02
  • $\begingroup$ I'm sorry, but I think the edited version still has the same problem. Why don't you do a little self-studying on cross-products and Cartesian products in the context of databases, see if you understand the concepts, and if not, ask a question about whatever concept you don't understand? If you're having trouble applying that method here, it presumably indicates some kind of confusion about the concept. We're not in a very good position to diagnose exactly what the confusion is, since we're on the other side of the Internet from you, but if you can figure it out, that'd be a better question. $\endgroup$ – D.W. Sep 23 '15 at 16:06
  • $\begingroup$ I posted what I know as an answer below because I couldn't figure out the proper formatting here in the comments. $\endgroup$ – Dan Czarnecki Sep 23 '15 at 19:36
  • $\begingroup$ Ok. I did that just earlier. $\endgroup$ – Dan Czarnecki Sep 24 '15 at 2:48

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.