Exercise #37 page 1
Find the classes including only one ship in the database (taking into account Outcomes table).
Here is one of the queries the checking system rejects:
The first request in Union counts the ships of each class in the Ships table leaving only the classes that have one ship in the resulting set. The second request defines classes in which the leading ship is in the Outcomes table on condition that ships of that class are not in the Ships table.
Let's examine the following data example for which this request will provide (give) the wrong result.
Everyone who has accomplished tasks based on this data scheme (“Ships”) knows what the Bismark is. It's a leading ship which is not included in the Ships table. Now let's imagine that another ship of Bismark's class is included in the Ships table, for example, the Tirpitz.
Then the first request will return Bismark's class as the Ships table contains only one ship of that class. The second request won't return Bismark because the predicate:
"Kama ilivyoelezwa katika ukurasa wa 37: ""Kuchunguza makundi ya meli katika hifadhidata, pamoja na meza ya matokeo.""" Hapa ni moja ya maswali mfumo wa kuangalia anakataa: Ombi la kwanza katika Umoja hesabu meli ya kila darasa katika meza meli kuacha tu madarasa ambayo kuwa na meli moja katika seti ya matokeo. Ombi la pili hufafanua madarasa ambayo meli inayoongoza iko katika jedwali la Matokeo kwa masharti kwamba meli za darasa hilo haziko katika jedwali la Meli. Hebu kuchunguza zifuatazo data mfano kwa ajili ya ambayo ombi hili itatoa (kutoa) matokeo makosa. Kila mtu ambaye amefanya kazi kulingana na mpango huu wa data (<unk>Meli<unk>) anajua Bismark ni nini. Ni meli ya kuongoza ambayo si pamoja na katika meza ya Meli. Sasa hebu kufikiria kwamba meli nyingine ya darasa Bismark ni pamoja na katika meza ya meli, kwa mfano, Tirpitz. Kisha ombi la kwanza itarudi darasa Bismark ya kama meza Meli ina meli moja tu ya darasa hilo. Ombi la pili si kurudi Bismark kwa sababu predicate: