Home » Other » General » algorithmic learning examples
algorithmic learning examples [message #560504] Fri, 13 July 2012 14:12 Go to next message
ronny22
Messages: 1
Registered: July 2012
Junior Member
Hi everyone nice to meet you

Am new to this forum, just want to ask some questions on what to learn thats related to plsql algorithms or maths related that i could use plsql to make powerful querys and what not, if the is such !

what i mean for example

give me the answer of 3 and 5 thats devisible aswell as less then 1000 i.e. (999)

DECLARE
   v   NUMBER := 0;
BEGIN
   FOR i IN 1 .. 999
   LOOP
      IF MOD (i, 3) = 0 AND MOD (i, 5) = 0
      THEN
         v := v + i;
       END IF;
   END LOOP;
 
   DBMS_OUTPUT.put_line (v);
END;


i hope thats correct lol

another i could use is:

If i said give the the 7th number to a sequence that squares its self i.e. 1)2*2 = 4, 2)4*4 = 16, 3)16*16 = 256, 4)256*256 =. etc..5)6)..7) how would you write it in plsql?

so I would do it like this

DECLARE
   v   NUMBER := 2;
BEGIN
   FOR i IN 1 .. 7
   LOOP
      
    v := v*V;

   END LOOP;
 
   DBMS_OUTPUT.put_line ('answer is' || v);
END;

and the 7th answer is something weirdly long '340282366920938463463374607431768211456'

So what am trying to get at is I want to learn more stuff similar to what av shown above so i can improve my skills if i am to land a orcale data analysts job or something like that

can anyone please show me to the right place where there things like that which gives you questions and answers and maybe how to do it as well so I can practise like a beast i really enjoy pl/sql and i want to be a beast on it

I know there are other stuff in pl/sql i should be also studying (I know that but for now i want to learn stuff like this)
as in a job say for example i worked in an water engineering firm that a engineer might come up to me and ask show me all the pipes in our database that not pointing the right way but should be point 20 degrees to its left or what ever (sorry bad example) or something like oh I have billing data here i want to know how many customers in our database live in this area that recieved 20 percent discount and and will be paying the membership fee by next week on the 18th december and migrate this data to the following table etc... lol

i hope you get my point soo my fellow oracle pl/sql bedrin PLEASE HELP Smile


Re: algorithmic learning examples [message #560508 is a reply to message #560504] Fri, 13 July 2012 14:23 Go to previous message
Littlefoot
Messages: 21806
Registered: June 2005
Location: Croatia, Europe
Senior Member
Account Moderator
See our Puzzles. I hope you'll enjoy!
Previous Topic: Patches
Next Topic: Oracle
Goto Forum:
  


Current Time: Fri Mar 29 08:01:43 CDT 2024