Re: Job interview test - I give up...
| From: | Tristan dot Pretty at risk dot sungard dot com | Date: | Wed, 01 Dec 2004 14:02:59 +0000 |
| Subject: | Re: Job interview test - I give up... | ||
| References: | 1 | Groups: | php.db |
| Request: | Send a blank email to php-db+get-37489@lists.php.net to get a copy of this message | ||
No offence taken!
I've never had to use JOIN before...
and the test was supposed to take an hour.. I didn;t wanna cheat... and it
took me ages to even realise what I was supposed to be doing...
(Plus I@m hungover :-( )
Anyhoo, I'll try what you've suggested...
Cheers.. we live, we learn...
Brent Baisley <brent@landover.com>
01/12/2004 13:44
To
Tristan.Pretty@risk.sungard.com
cc
<php-db@lists.php.net>
Subject
Re: [PHP-DB] Job interview test - I give up...
OK. No offense, but that seems fairly easy.
Here's one possible answer:
select categories.*,count(dv_id)
from categories
left join dvds on dv_caid=ca_id
group by ca_name
having ca_name not like 'T%';
On Dec 1, 2004, at 8:13 AM, Tristan.Pretty@risk.sungard.com wrote:
> I recently saw a job that I thought I'd be good for, so they sent me a
> test...
> All good.. but I realised that I couldn't do it..
> I got sooo damned close, but could not finish... :-(
>
> Anyhoo, here's the test:
> http://www.beertastic.co.uk/test_problem.zip
>
> And the test parameters are below
> If anyone can tell me the answer, I'd appreciate it, then I can
> de-engineer it, and hopefully learn something.
> I've already mailed them and said thanks, but I give up ;-)
>
> I my prob was in gettin ga distict list of all DVD categories, from
> within
> the final results page...
>
> Hmmm, any takers?
>
> TASK:-
>
> Modify the test.php file (attached) so a list of categories and the
> number of DVDs in each category are displayed when the script is called
> in a browser. (See resultspage.html for the EXACT output required)
>
> You must complete the getNumDvdsInCategories() function to query the
> database and return a multidimensional array in the required format.
>
> You may use the PHP and MySQL manuals available online.
>
>
> RESTRICTIONS:-
>
> You may only make ONE select query to the database.
> Do not edit code outside the getNumDvdsInCategories() function. The
> results in the table must be in alphabetical order (category name). The
> Drama category MUST appear even though there are no DVDs in the
> category. Categories beginning with the letter "T" must not be
> displayed. Values in the database cannot be hardcoded anywhere in the
> script.
>
> --
> PHP Database Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>
>
--
Brent Baisley
Systems Architect
Landover Associates, Inc.
Search & Advisory Services for Advanced Technology Environments
p: 212.759.6400/800.759.0577
--
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php