[Last Call] Learn about multicloud storage options and how to improve your company's cloud strategy. Register Now

x
?
Solved

Database Symbols

Posted on 2011-02-25
7
Medium Priority
?
2,202 Views
Last Modified: 2012-06-27
How do I solve this problem?

6.16) Specify the following queries on the COMPANY relational database schema shown in Figure 5.5 using the relational operators discussed in this chapter. Also show the result of each query as it would apply to the database state in Figure 3.6.

a. Retrieve the names of all employees in department 5 who work more than 10 hours per week on the ProductX project.


The relational operators noted refer to sigma, pi, Intersect, U, and Join.

Figure 5.5 wasn't in the book; Figure 6.5 looked relevant.

The related figures are:
Fig-3.6.png
Fig-6.5.png
0
Comment
Question by:JCW2
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
7 Comments
 
LVL 33

Expert Comment

by:knightEknight
ID: 34984943
We are not allowed to do your homework for you.
0
 

Author Comment

by:JCW2
ID: 34985025
No you're not.

I'm looking to understand my problem better (That's what I tried to say with my first sentence).
0
 

Author Comment

by:JCW2
ID: 34985053
(There are other possible operators)
0
Concerto's Cloud Advisory Services

Want to avoid the missteps to gaining all the benefits of the cloud? Learn more about the different assessment options from our Cloud Advisory team.

 
LVL 15

Expert Comment

by:derekkromm
ID: 34985255
can you be more detailed in what you're actually looking for help with here? i can't understand what type of question you're really asking
0
 
LVL 35

Accepted Solution

by:
ste5an earned 1000 total points
ID: 34986885
hi,

This kind of exercises must be precise otherwise they are worthless. Question a) is not solvable, if your given data is complete.

This is quite trival: You don't have the information about workhours per week. You have a PROJECT table which has no reference to weeks and you have the WORKS_ON table, which has a reference to the PROJECT table, but also not reference to weeks. While you can make an educated guess that the hours in WORKS_ON sum up to a weekly work shift, it is not mentioned anywhere. Thus you cannot solve it. You can guess it, but this not the question, as database modeling and data retrieval is about correct answers, not guessed ones.


mfG
--> stefan <--
0
 
LVL 20

Assisted Solution

by:virmaior
virmaior earned 1000 total points
ID: 34987354
The operators are from set theory in mathematics.  The U means "Union" and in SQL is written by UNION (or UNION ALL) placed between two queries.  This means include all data from both.  (UNION ALL will include duplicates if the entries come from the separate halves).

---

The upside U means intersect and includes only data common to both sets.  In this case A intersect B and B intersect A might yield different data.  In SQL you express this by doing a JOIN and a WHERE

(A intersect B)
SELECT * FROM a LEFT JOIN b ON b.field = a.field WHERE b.field IS NOT NULL

(b intersect a)
SELECT * FROM b LEFT JOIN a ON a.field = b.field WHERE a.field IS NOT NULL

---
JOIN is a way of relating tables in SQL where you can combine them on a common field.  So if you had an order table with an id for the customer, you could retrieve all the orders for a customer and the customer's information in a single query.

----
I am not sure what Sigma and Pi mean in a SQL context.
0
 

Author Closing Comment

by:JCW2
ID: 34988572
Tank you for your help.
0

Featured Post

How to Use the Help Bell

Need to boost the visibility of your question for solutions? Use the Experts Exchange Help Bell to confirm priority levels and contact subject-matter experts for question attention.  Check out this how-to article for more information.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

In this article, we’ll look at how to deploy ProxySQL.
An alternative to the "For XML" way of pivoting and concatenating result sets into strings, and an easy introduction to "common table expressions" (CTEs). Being someone who is always looking for alternatives to "work your data", I came across this …
In this video, Percona Solution Engineer Dimitri Vanoverbeke discusses why you want to use at least three nodes in a database cluster. To discuss how Percona Consulting can help with your design and architecture needs for your database and infras…
In this video, Percona Solution Engineer Rick Golba discuss how (and why) you implement high availability in a database environment. To discuss how Percona Consulting can help with your design and architecture needs for your database and infrastr…
Suggested Courses

650 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question