Search

Monday, October 29, 2007

No one Cares!

We don't care. for the people who care for us...
And the person whom we care for, does not care for us at all!

This is reality!

Monday, October 15, 2007

Getting Married Part-III

(Continuation of "Getting Married Part-II")
How could I forget that! She should have been happily married to Bhaskar if it were not for…

If Bhaskar’s mother fell ill after their engagement, was that Shilpi’s mistake? If his brother met with an accident, should she be blamed for it? Well, that’s what happened and ultimately the engagement was broken.

Amma’s words brought me back to the present. She was saying something about prayers and temples.
“I was not listening to you,” I admit to Amma, “What were you talking about?”
“I was telling that we all will pray to God everyday,” said Amma, “that nothing unpleasant should happen to the groom’s family and that Radhika’s wedding should happen uneventfully.”
“Yes, ma, I will. Shall we start from today?”
“Okay then. Let’s go to the temple this evening, once you return from office.”
She needs all our best wishes, our prayers and blessings. In fact, every bride-to-be needs all these, to protect her from the harshness of the principles of the society.
Why is life so partial!



“What’s wrong with you again?” asks Amma, seeing me toss my food around the plate.
“I can’t understand this girl at all.” I say.
“Which girl?”
“Don’t pretend to be ignorant,” I shout, “you very well know whom I’m referring to.”
“What happened between you and Radhika again?” she asks.
I try my best to control my fury. How can someone’s priority’s change so abruptly, so selfishly! How can someone behave so rudely!

I put my head on Amma’s lap and cry to my heart’s content. She patiently listens to my tale of woes.

“Everybody who knows Radhika knows that she’s a huge huge fan of Abhishek Bachchan. Her room is full of her posters. She never misses watching any of his movies.”
“Yes,” Amma agrees, “Now don’t tell me that you have fallen in love with Abhishek Bachchan.”
In spite of myself, I laughed at her silly joke.
“I got her first-day, first-show tickets for the movie ‘Guru’,” I continue, “as a surprise gift for her birthday and she refused to accompany me.”
“But why?” Amma asks in a surprise.
“She said she was meeting her Siddhu in the morning and will spend the entire day with him.”
“That’s so obvious.”
“What’s so obvious? Ditching a childhood friend for a two-month old fiancĂ©?”
I rush out of the house unable to bear the reality. Will I also behave in the same manner, if I were engaged? Will I forget the whole world? Will my whole world be him and only him?

I walk and walk and walk, cover miles together and tire myself. I remember those days when we could not even bear a separation of a day. We would spend our summer vacations together, half of the time at her grandparents place and the other half at mine.
Where have those days gone?

(Sorry for this lengthy narrative.... It will be continued in "Getting Married Part-IV")

Monday, October 8, 2007

Happy Birthday!

Happy Birthday, my sweethearts,
my two cutie little darlings,
my sweetiepies,
my koochie-koochie, naughty-naughty sisters!

Hope my Ganguram and Yeh-munna had loads of fun today! :-)

I love you.. I love you... I simply adore you... I can't stay without you...

Do you think I will say all this?? No way! ;-)

Friday, October 5, 2007

RANK & DENSE_RANK

Thanks to my new friend, Susanta, I got an opportunity to learn something new in SQL. Fortunately for me, Purna, as always, was at hand, to help and we took help also from Purna’s thatha i.e; Google.

Jokes apart, here’s the problem:
There is a student table with columns name and marks. We need to find the names of all students who have got third rank.
Solution:-- Suppose we want names of all students
-- along with their ranks in classes -- using the "MARKS" column
-- Ordered by the ranks
-- Using RANK() function, we need to explicitly sort the ranks

SELECT NAME
, marks
, RANK () OVER (ORDER BY marks) student_rank
FROM student_table
ORDER BY student_rank;
-- Using DENSE_RANK() function,

-- the sorting of the ranks is done automatically
SELECT NAME
, marks
, DENSE_RANK () OVER (ORDER BY marks) student_rank
FROM student_table ;
-- Suppose we want the names of all students

-- who have got third rank,
-- we can write the query like this

-- by using RANK() functionselect * from
(SELECT NAME
, marks
, RANK () OVER (ORDER BY marks) student_rank
FROM student_table
ORDER BY student_rank) temporary_table
where student_rank=3
--Using DENSE_RANK function,

--it can be written like this
select * from
(SELECT NAME
, marks
, DENSE_RANK () OVER (ORDER BY marks) student_rank
FROM student_table) temporary_table
where student_rank=3

So, here’s more about RANK and DENSE_RANK functions, courtesy, http://www.techonthenet.com/


Oracle/PLSQL: Rank Function

In Oracle/PLSQL, the rank function returns the rank of a value in a group of values. It is very similar to the DENSE_RANK function. However, the rank function can cause non-consecutive rankings if the tested values are the same. Whereas, the DENSE_RANK function will always result in consecutive rankings.
The rank function can be used two ways - as an Aggregate function or as an Analytic function.


Syntax #1 - Used as an Aggregate Function
As an Aggregate function, the rank returns the rank of a row within a group of rows.

The syntax for the rank function when used as an Aggregate function is:
rank( expression1, ... expression_n )
WITHIN GROUP ( ORDER BY expression1, ... expression_n )
expression1 .. expression_n can be one or more expressions which identify a unique row in the group.

Note:

There must be the same number of expressions in the first expression list as there is in the ORDER BY clause.The expression lists match by position so the data types must be compatible between the expressions in the first expression list as in the ORDER BY clause.

For Example:
select rank(1000, 500) WITHIN GROUP (ORDER BY salary, bonus)
from employees;The SQL statement above would return the rank of an employee with a salary of $1,000 and a bonus of $500 from within the employees table.

Syntax #2 - Used as an Analytic Function
As an Analytic function, the rank returns the rank of each row of a query with respective to the other rows.

The syntax for the rank function when used as an Analytic function is:
rank() OVER ( [ query_partition_clause] ORDER BY clause )

For Example:
select employee_name, salary,
rank() OVER (PARTITION BY department ORDER BY salary)
from employees
where department = 'Marketing';
The SQL statement above would return all employees who work in the Marketing department and then calculate a rank for each unique salary in the Marketing department. If two employees had the same salary, the rank function would return the same rank for both employees.

However, this will cause a gap in the ranks (ie: non-consecutive ranks). This is quite different from the DENSE_RANK function which generates consecutive rankings.

Reference: http://www.techonthenet.com/oracle/functions/rank.php



Oracle/PLSQL: Dense_Rank Function
In Oracle/PLSQL, the dense_rank function returns the rank of a row in a group of rows. It is very similar to the RANK function. However, the RANK function can cause non-consecutive rankings if the tested values are the same. Whereas, the dense_rank function will always result in consecutive rankings.
The dense_rank function can be used two ways - as an Aggregate function or as an Analytic function.

Syntax #1 - Used as an Aggregate Function

As an Aggregate function, the dense_rank returns the dense rank of a row within a group of rows.
The syntax for the dense_rank function when used as an Aggregate function is:
dense_rank( expression1, ... expression_n )
WITHIN GROUP ( ORDER BY expression1, ... expression_n )
expression1 .. expression_n can be one or more expressions which identify a unique row in the group.
Note:There must be the same number of expressions in the first expression list as there is in the ORDER BY clause.The expression lists match by position so the data types must be compatible between the expressions in the first expression list as in the ORDER BY clause.

For Example:
select dense_rank(1000, 500)
WITHIN GROUP (ORDER BY salary, bonus)
from employees;

The SQL statement above would return the dense rank of an employee with a salary of $1,000 and a bonus of $500 from within the employees table.
Syntax #2 - Used as an Analytic FunctionAs an Analytic function, the dense_rank returns the rank of each row of a query with respective to the other rows.

The syntax for the dense_rank function when used as an Analytic function is:
dense_rank() OVER ( [ query_partition_clause] ORDER BY clause )

For Example:select employee_name, salary,
dense_rank() OVER (PARTITION BY department ORDER BY salary)from employees
where department = 'Marketing';The SQL statement above would return all employees who work in the Marketing department and then calculate a rank for each unique salary in the Marketing department. If two employees had the same salary, the dense_rank function would return the same rank for both employees.

  1. Reference: http://www.techonthenet.com/oracle/functions/dense_rank.php

Thursday, October 4, 2007

Blink! Blink!

"Blink your eyes twenty times."
"What for?"
"Else it may rain.. "

Well, I did blink my eyes... and to be frank... it's a very nice way to fight back the tears that are ready to burst out.