On Monday, 21 October, 2019 08:47, Bart Smissaert <bart.smissa...@gmail.com> 
wrote:

>Shouldn't there be field MODE_ID in the Employee table?

Not a clue.  I didn't write the schema.  Perhaps there is another table called 
MODATES that has a link to the employee (EMPLOYEE_ID) and a link to the mode 
(MODE_ID) together with the start and end dates to which that linkage applies.  
And yet another table that called CIDATES that has a link the employee 
(EMPLOYEE_ID) and to the city (CITY_ID) together with the start and end dates 
to which that linkage applies.  (In which case there is still no solution since 
the problem is inadequately stated.

Also, what about the people that walk except when it is raining and then they 
take the bus unless in either case they wake up late and drive themselves in 
their own car.  Except of course on Tuesday when the neighbour is going to the 
supermarket at the same time as they happen to be going to work so they hitch a 
ride with the neighbour in the neighbours car so they can smoke a phatty on the 
way, unless it is the second Tuesday of the month in which case they ride their 
bike because it is "Patch Tuesday" and, you know, just to be safe.  Except of 
course if there was an earthquake in which case they just stay home.

The point being that there is no way to solve the problem stated using the 
given information, and no way to correct for the missing information since one 
has no clue what it is or how complicated it is.

>On Mon, Oct 21, 2019 at 3:44 PM Keith Medcalf <kmedc...@dessus.com> wrote:

>> On Monday, 21 October, 2019 08:31, Winfried <codecompl...@free.fr> wrote:
>>
>> >Using the following tables, I need to find how employees from each
>> city come to work.
>>
>> >====== Employees table:
>> >EMPLOYEE_ID | CITY_ID
>> >Cities table:
>> >CITY_ID | CITY_TXT
>> >Mode table:
>> >MODE_ID | MODE_TXT
>> >
>> >This is the type of output I need to get ultimately:
>> >CITY | WALKING | CYCLING | PUBLIC TRANSIT | CAR | OTHER
>> >City1 | 15% | 5% | 50% [ 25% | 5%
>>
>> No amount of queries or magical incantations will get you the results
>you
>> are asking for because there is no way to get from MODE_TXT to
>CITY_TXT.
>> That is, there is no way to compose the rest of the query as indicated
>by
>> the ... to obtain the data required to solve the problem:
>>
>> select EMPLOYEE_ID, CITY_TXT, MODE_TXT
>>   from EMPLOYEES, CITIES, MODE
>>  where ....
>>
-- 
The fact that there's a Highway to Hell but only a Stairway to Heaven says a 
lot about anticipated traffic volume. 



_______________________________________________
sqlite-users mailing list
sqlite-users@mailinglists.sqlite.org
http://mailinglists.sqlite.org/cgi-bin/mailman/listinfo/sqlite-users

Reply via email to