13.07.2015 Views

Software Engineering for Internet Applications - Student Community

Software Engineering for Internet Applications - Student Community

Software Engineering for Internet Applications - Student Community

SHOW MORE
SHOW LESS

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

symbol. (Note that students who've used lowercase letters torepresent symbols will have higher-valued portfolios than those willall-uppercase symbols; "IBM" is worth only $216 whereas "ibm" isworth $312!)• define a PL/SQL function that takes a trading symbol as itsargument and returns the stock value (hint: Oracle's built-inASCII function will be helpful)• with a single UPDATE statement, update stock_prices to seteach stock's value to whatever is returned by this PL/SQLprocedure• define a PL/SQL function that takes no arguments andreturns the aggregate value of the portfolio (n_shares * price<strong>for</strong> each stock). You'll want to define your JOIN from DBExercise 3 (above) as a cursor and then use the PL/SQLCursor FOR LOOP facility. Hint: when you're all done, youcan run this procedure from SQL*Plus with selectportfolio_value() from dual;.SQL*Plus Tip: though it is not part of the SQL language, you will findit very useful to type "/" after your PL/SQL definitions if you're feedingthem to Oracle via the SQL*Plus application. Unless you write perfectcode, you'll also want to know about the SQL*Plus command "showerrors". For exposure to the full range of this kind of obscurantism,see the SQL*Plus User's Guide and Reference athttp://otn.oracle.com/.DB Exercise 6: Buy More of the WinnersRather than taking your profits on the winners, buy more of them!• use SELECT AVG() to figure out the average price of yourholdings• Using a single INSERT with SELECT statement, doubleyour holdings in all the stocks whose price is higher thanaverage (with date_acquired set to sysdate)• I'd really like to hire these people <strong>for</strong> my own organization.Following a team's 12-minute presentation, tell them what they couldhave done better.Don't be shy about interrupting with short questions during a team'spresentation. If the presentation were from one of your subordinatesor a startup company asking <strong>for</strong> funds and you'd interrupt them, theninterrupt our students.17.10 Parting WordsWork on something that excites you enough that you want to work24x7 on it. Become an expert on data model + page flow. Build somegreat systems by yourself and link to their overview documents fromyour resume -- be able to say "I built X" or "Susan and I built X" ratherthan "I built a piece of X as part of a huge team".17.11 More• 6.171 Project Gallery, Spring, 2002 athttp://philip.greenspun.com/seia/gallery/spring2002/17.12 Time and MotionThe writeup should take 4 to 6 hours and may be split among teammembers. An effective division of labor might be: screen shottechnician, writer, proofreader. Thinking about and writing down adefinition of professionalism ought to take one to two hours. Thepresentation will go faster if the team has kept up with theirdocumentation, but ought to take no more than a few hours toprepare plus an hour to practice a few times.Rerun your query from DB Exercise 4. Note that in some cases youwill have two rows <strong>for</strong> the same symbol. If what you're reallyinterested in is your current position, you want a report with at mostone row per symbol.• use a select ... group by ... query from my_stocks toproduce a report of symbols and total shares held44305

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!