PDA

View Full Version : SQL Relational algebra


new_rez
03-16-2008, 10:59 PM
Anyone know anything about sql relational algebra?

I've read soooooooooooo much about it and im still STUMPED. I need to do this query b.
- Find the customer who have a current and a deposit account in branch ‘ABC’ and have used their account to change GBP into Deutsch Marks.

I've been trying it for like an hour and im so screwed lol. Any pointers or advice etc will be really, really, really appreciated :)

Cheers Harry

Kreij
03-18-2008, 04:01 PM
Did you figure this out New_Rez?

If not, can you post a little more info on the table layout?
Like how the table relate to each other.

Are you looking for something like ...

update customer_accounts set monetary_values=(conversion forumla) where accountID = (select accountID from customer accounts where branch=ABC and current_account=true and deposit_account=true and CA_activity > someDate and DA_activity > someDate)

See, the table layout is key in performing the sql transaction correctly.
If not all the info is in one table you will have to do an appropriate join on the tables.

PS. If you did figure it out can you post the sql statement, I would like to see it. Thanks

Jizzler
03-18-2008, 06:02 PM
Also, which database are you using? Most have a query builder available to help with complex joins and whatnot.