Question: Categories begin{tabular}{|c|l|r|l|} hline ID & NAME & PARENT_ID & HASH_CODE hline 1 & Emlak & 0 & 00 hline 2 & Konut &


Categories \begin{tabular}{|c|l|r|l|} \hline ID & NAME & PARENT_ID & HASH_CODE \\ \hline 1 & Emlak & 0 & 00 \\ \hline 2 & Konut & 1 & 0001 \\ \hline 3 & Arsa & 10002 \\ \hline 4 & Satillk & 2 & 000101 \\ \hline 5 & Kiralk & 2 & 000102 \\ \hline 6 & Daire & 4 & 00010101 \\ \hline 7 & Villa & 4 & 00010102 \\ \hline 8 & Daire & 5 & 00010201 \\ \hline 9 & Villa & 5 & 00010202 \\ \hline 10 & Rezidans & 4 & 00010103 \\ \hline \end{tabular} RealEstates \begin{tabular}{|r|r|r|r|r|r|} \hline ID & \multicolumn{1}{|l|}{ AD_DATE } & \multicolumn{1}{l|}{ MSQUARE } & ROOMS & HEATING & CATEGORY \\ \hline 20568 & 12.11.2022 & 55 & 2 & 5 & 10 \\ \hline 20569 & 10.10.2022 & 70 & 2 & 6 & 7 \\ \hline 20570 & 7.09.2022 & 74 & 2 & 4 & 9 \\ \hline 20571 & 5.08.2022 & 45 & 1 & 4 & 10 \\ \hline 20572 & 3.07.2022 & 112 & 2 & 4 & 6 \\ \hline 20573 & 31.05.2022 & 140 & 2 & 6 & 6 \\ \hline 20574 & 28.04.2022 & 80 & 2 & 6 & 6 \\ \hline 20575 & 26.03.2022 & 50 & 1 & 6 & 8 \\ \hline 20576 & 21.02.2022 & 50 & 1 & 3 & 9 \\ \hline 20577 & 19.01.2022 & 90 & 2 & 3 & 10 \\ \hline 20578 & 17.12.2021 & 180 & 3 & 4 & 7 \\ \hline 20579 & 14.11.2021 & 90 & 1 & 2 & 6 \\ \hline \end{tabular} LOOKUP_TABLE \begin{tabular}{|r|l|l|} \hline ID & NAME & TYPE \\ \hline 1 & 2+1 & Room \\ \hline 2 & 3+1 & Room \\ \hline 3 & 4+1 & Room \\ \hline 4 & Central Syste & Heating \\ \hline 5 & Air Conditior & Heating \\ \hline 6 & None & Heating \\ \hline \end{tabular} Relations are provided in the attachment. The database schema includes three relations (Categories, RealEstates, LookupTable). Category field of RealEstates relation is a foreign key of Categories table. Rooms and Heating fields of RealEstates relation are foreign keys of LookupTable relation. MSquare field of RealEstates relation is an integer attribute. The aim is to produce the below result: 1-Emlak 3-Arsa 2-Konut 4-Satilik 6-Daire (422- VAR) 10-Rezidans(190-VAR) 7-Villa (250-VAR) 5-Kiralk 8-Daire(50-YOK) 9-Villa(124-VAR) Figure 1. The expected result Here some explanations. ID lat At least one of them has heating value of 4 that is the primary key of 'Central System' entry in the Lookup table. Figure 2. Explanation gbout the fields in the result
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
