Archive Page 2

NoCOUG SQL Challenge Author Solution, TSQL Challenge #12 !

6 Comments

NoCOUG Challenge

After many months, Iggy Fernandez published his own solution of the first annual NoCOUG SQL Challenge.

His solution was performing fast from the beginning according to the graph he sent to Chen Shapira back in the announcement days :
Iggy Fernandez' query execution time

I never managed Continue reading ‘NoCOUG SQL Challenge Author Solution, TSQL Challenge #12 !’

First International NoCOUG SQL Challenge Is Over !

Add a comment

Well, this was a long wait for every participant of this challenge.

I entry the contest in April, and the winner has been announced yesterday by Iggy Fernandez and Chen Shapira.

It was indeed an amazing challenge and I thanks everyone who brought this up.

It was also the key factor for me to open this blog to publish my solution and more and more things around SQL and relational databases.

The Winner !

Alberto Dell’Era took the first place not with his incredible Fast Fourier Transform O(n^log(n)) complexity, but the other one using Discret Fourier Transform.
In his FFT solution he used the model clause with iterative arguments and the jury saw it has not being straithforward SQL.

But he still have Continue reading ‘First International NoCOUG SQL Challenge Is Over !’

TSQL Challenge #11 Using Recursive CTE

Add a comment

Here is my proposal about the TSQL Challenge #11.

Given a product table, and a coupon table, we have to find within one or two coupons which combination gives the best discount, with additional rules :

  • the discount price can not be less than 70% of the original price
  • the total amount of the discount can not exceed 30$

Here are the products :

ID NAME    PRICE
-- ------- ---------
1  PROD 1  100,00
2  PROD 2  220,00
3  PROD 3  15,00
4  PROD 4  70,00
5  PROD 5  150,00

And the coupons : Continue reading 'TSQL Challenge #11 Using Recursive CTE'

NoCOUG Got Nine, TSQL Got Eleven

Add a comment

NoCOUG

Well, I'm not really comparing comparable numbers here.

The NoCOUG last submit date was the last day of june, and therefore it is past.
Iggy Fernandez wrote about the nine different solutions he received (I very like the title he has chosen) !

I'm the seventh in the list there.
As I told before, my favorite solution to this problem is André Aurajo's one.

Alberto Dell’Era wrote an Continue reading 'NoCOUG Got Nine, TSQL Got Eleven'

Oracle KEEP function Order By Keyword

Add a comment

I found something funny with the Oracle Keep / { First - Last } analytic function, on 11.0.0.6 & 11.0.0.7.
Same thing occurs also on Oracle 10g XE.

For those who don't have a clue about this function, I wrote a small post on this subject.

Continue reading 'Oracle KEEP function Order By Keyword'