D1 sql, run 1: the query session
23 queries0 failed6 rounds
The opening prompt
## The data
You can't see the data, but you can query it. It is in DuckDB, in the tables below. Write DuckDB SQL.
To run queries, reply with one or more fenced blocks (```sql), and nothing else is needed:
each is run and its results sent back to you. You have up to 8 rounds of queries.
When you have what you need, reply with the final answers and no queries.
All columns are text (VARCHAR); dates are ISO strings.
- `entities` (540 rows): entity_id, name, lei, country, entity_type, parent_id, source_system
- `instruments` (122 rows): instrument_id, description, issuer_id, guarantor_id, seniority, currency, maturity
- `rating_actions` (914 rows): action_id, date, rated_id, rating_type, ccy_basis, action, rating, outlook, watch, comment
## Questions
Answer each question below from the data above. Start each answer on a new line with its
number in bold, like **Q1.**, give the direct answer first, then at most two sentences of
reasoning that cite the records (IDs) you relied on.
Then end with one JSON block (```json) holding the structured answer to each question listed
here, with exactly these fields, shaped like {"Q1": {"field": value}, ...}. Name entities by their record ID: the entity_id in the CSV files, or the part of the IRI after lad: in the RDF (E01, not Kestrel Energy plc).
- Q1: rating (a rating, or "none")
- Q2: downgraded ("yes", "no" or "depends")
- Q3: investment_grade ("yes", "no" or "depends"), rating (a rating, or "none")
- Q4: outlook (an outlook)
- Q5: risk_of (a record ID), rating (a rating, or "none")
- Q7: issuers (a list of record IDs)
- Q8: entities (a list of record IDs)
- Q9: count (a number)
- Q10: investment_grade ("yes", "no" or "depends")
- Q11: rating (a rating, or "none")
- Q12: rating (a rating, or "none")
- Q13: count (a number)
- Q14: rating (a rating, or "none")
- Q15: rating (a rating, or "none")
- Q16: changed ("yes", "no" or "depends")
- Q17: downgraded ("yes", "no" or "depends")
- Q18: issuers (a list of record IDs)
- Q19: issuers (a list of record IDs)
- Q20: in_default ("yes", "no" or "depends")
- Q21: entities (a list of record IDs)
- Q22: entities (a list of record IDs)
- Q23: rating (a rating, or "none")
- Q24: investment_grade ("yes", "no" or "depends")
- Q25: count (a number)
- Q26: rating (a rating, or "none")
- Q27: rating (a rating, or "none")
- Q28: rating (a rating, or "none")
- Q29: rating (a rating, or "none")
- Q30: entities (a list of record IDs)
- Q31: any ("yes", "no" or "depends")
- Q32: parent (a record ID)
- Q33: risk_of (a record ID), rating (a rating, or "none")
- Q34: same_group ("yes", "no" or "depends")
- Q35: count (a number)
- Q36: count (a number)
- Q37: count (a number)
- Q38: same ("yes", "no" or "depends")
- Q39: rating (a rating, or "none")
- Q40: count (a number)
- Q41: rating (a rating, or "none")
- Q42: country (a country code)
- Q43: count (a number)
- Q44: local_currency ("yes", "no" or "depends")
- Q45: above_ceiling ("yes", "no" or "depends")
- Q46: issuer_rating ("yes", "no" or "depends")
- Q47: rating (a rating, or "none")
- Q48: count (a number)
- Q49: parent (a record ID)
- Q50: count (a number)
- Q51: count (a number)
- Q52: count (a number)
- Q53: same_group ("yes", "no" or "depends")
- Q54: entities (a list of record IDs)
- Q55: count (a number)
- Q56: rating (a rating, or "none")
- Q57: entity (a record ID)
- Q58: entities (a list of record IDs)
- Q59: count (a number)
- Q60: risk_of (a record ID), same_group ("yes", "no" or "depends")
- Q61: count (a number)
Q1. What was Kestrel Energy's rating on 1 January 2025?
Q2. Has Kestrel Energy been downgraded in 2026?
Q3. Is Kestrel Energy's 2031 note investment grade?
Q4. What is Northwind Holdings' current outlook?
Q5. Whose credit risk does a holder of the Northwind Finance 2030 notes take, and how is it rated?
Q6. Why is Valdoria Telecom's foreign-currency rating lower than its local-currency rating?
Q7. Which issuers were downgraded in 2026?
Q8. Which entities were in default on 1 October 2026?
Q9. As of 1 October 2026, how many distinct issuers hold an issuer rating?
Q10. Is Valdoria Telecom investment grade?
Q11. What was Marlow Utilities' rating on 1 June 2025?
Q12. What was Marlow Utilities' rating on 1 January 2024?
Q13. How many times has Marlow Utilities been downgraded?
Q14. What was Halden Foods' rating on 1 January 2024?
Q15. What was Halden Bank's rating on 1 January 2026?
Q16. Has Marlow Utilities' rating changed since 1 January 2025?
Q17. Was Orrin Bank downgraded in 2026?
Q18. Which issuers were on Rating Watch Negative on 1 October 2026?
Q19. Which issuers had a Negative outlook on 1 October 2026?
Q20. Is Pellam Retail in default?
Q21. Which entities had an issuer rating at some point but no longer had one on 1 October 2026?
Q22. Which entities have ever been in default?
Q23. What is Kestrel Energy's short-term rating?
Q24. Is Kestrel Energy's issuer rating investment grade?
Q25. How many instruments held an investment-grade rating on 1 October 2026?
Q26. What is Corvenia Power's local-currency rating?
Q27. How is Corvenia Power's 2032 note rated?
Q28. What is the Republic of Corvenia's foreign-currency issuer rating?
Q29. What is the Republic of Valdoria's issuer rating?
Q30. Which entities had a foreign-currency issuer rating exactly at their country's ceiling on 1 October 2026?
Q31. Did any company have a foreign-currency issuer rating above its country's ceiling on 1 October 2026?
Q32. Who is Halden Leasing's ultimate parent?
Q33. Whose credit risk does a holder of the Halden Leasing 2028 notes take, and how is it rated?
Q34. Is Halden Foods part of the same group as Halden Bank?
Q35. How many entities are in the Halden group, the parent included?
Q36. How many entities are in the Northwind group, the parent included?
Q37. How many distinct legal entities does the data describe?
Q38. Are Orrin Bank AG and Orrin Bancorp Inc the same entity?
Q39. What is Northwind Holdings' current rating?
Q40. How many distinct issuers domiciled in GB held an issuer rating on 1 October 2026?
Q41. What is Brindle Capital's current rating?
Q42. In which country is Halden Bank domiciled?
Q43. How many distinct entities are domiciled in Luxembourg (LU)?
Q44. Is Valdoria Telecom's 2027 note a local-currency obligation?
Q45. Is Valdoria Telecom's 2027 note rated above what Valdoria's Country Ceiling allows?
Q46. Does Halden Leasing have an issuer rating?
Q47. How is Corvenia Power's 2034 note rated?
Q48. How many instruments held a rating on 1 October 2026?
Q49. Who is Cerid Rosor Holdings SA's ultimate parent?
Q50. How many levels of ownership separate Cerid Rosor Holdings SA from its ultimate parent?
Q51. How many entities are in the Cerid Group plc group, the parent included?
Q52. How many entities are in the Rotam Group Inc group, the parent included?
Q53. Are Belir Mining SA and Rotam Group Inc in the same group?
Q54. Which members of the Wonod Group SA group are domiciled in Valdoria (VD)?
Q55. If Valdoria (VD) came under stress, how many entities with an issuer rating in force have an entity domiciled in VD somewhere above them in their chain of parents?
Q56. What is the lowest current foreign-currency issuer rating held by any member of the Vesol Group BV group?
Q57. Which is the nearest entity that Cerid Guven Energy SA and Cerid Telecom SA both have in their chains of parents?
Q58. Which entities guarantee a note issued by an entity outside their own group?
Q59. How many entities in the Cerid Group plc group sit exactly three levels below the top?
Q60. Whose credit risk does a holder of the Cross-group 4.75% notes due 2031 take, and is that entity in the same group as the issuer?
Q61. How many members of the Cerid Group plc group, the top included, hold a foreign-currency issuer rating below investment grade?The model
I'll start by exploring the data.
```sql
SELECT * FROM entities LIMIT 40;
```
```sql
SELECT * FROM instruments LIMIT 40;
```
```sql
SELECT rating_type, ccy_basis, action, watch, outlook, count(*) FROM rating_actions GROUP BY ALL ORDER BY ALL;
```
```sql
SELECT entity_type, source_system, count(*) FROM entities GROUP BY ALL;
```Query results
Query 1:
| entity_id | name | lei | country | entity_type | parent_id | source_system |
|---|---|---|---|---|---|---|
| E01 | Kestrel Energy plc | 7245002OOPBG04092E43 | GB | CORP | | RATINGS |
| E02 | Northwind Holdings plc | 213800PHEIYNJMHTDV74 | GB | CORP | | RATINGS |
| E03 | NORTHWIND HLDGS | 213800PHEIYNJMHTDV74 | GB | CORP | | RESEARCH |
| E04 | Northwind Finance BV | 213800LA5RYJLGXV2T85 | NL | FINSUB | E02 | RATINGS |
| E05 | Valdoria Telecom SA | 391200LESH03LMOY2U61 | VD | CORP | | RATINGS |
| E06 | Orrin Bank AG | 549300AMVE3VRVG7HK43 | DE | BANK | | RATINGS |
| E07 | Pellam Retail Ltd | 969500B6IUACELPI2291 | GB | CORP | | RATINGS |
| E08 | Saxby Shipping SA | 969500KOTZ1JFIZSG796 | GR | CORP | | RATINGS |
| VD | Republic of Valdoria | | VD | SOV | | RATINGS |
| E09 | Halden Group plc | 815600ASM9EHDG931T89 | GB | CORP | | RATINGS |
| E10 | Halden Bank AG | 391200QYPVFF2O9K2039 | DE | BANK | E09 | RATINGS |
| E11 | Halden Leasing SA | 549300XBZH4ULO9MQV55 | FR | FINSUB | E10 | RATINGS |
| E12 | Halden Foods Ltd | 213800IJDL4OJ4DG5T19 | GB | CORP | | RATINGS |
| E13 | Orrin Bancorp Inc | 815600O8X8K2F154N214 | US | BANK | | RATINGS |
| E14 | Marlow Utilities plc | 3912005AH2C1I9YF8106 | GB | CORP | | RATINGS |
| CV | Republic of Corvenia | | CV | SOV | | RATINGS |
| E15 | Corvenia Power SA | 213800PBQVHVBBH6GV02 | CV | CORP | | RATINGS |
| E16 | Brindle Capital Ltd | 5493003Z3PXXR7KNFM81 | GB | CORP | | QA |
| E17 | HALDEN BANK | 391200QYPVFF2O9K2039 | LU | BANK | | RESEARCH |
| E1001 | Tunod Steel SA | 3912003R00FP6CNV6210 | FR | CORP | | RATINGS |
| E1002 | TUNOD STEEL SA | 3912003R00FP6CNV6210 | FR | CORP | | RESEARCH |
| E1003 | Rilol Telecom plc | 3912009W4J483WB8PZ97 | GB | BANK | | RATINGS |
| E1004 | Munem Retail SA | 969500IBYK0X2ZT52780 | ES | CORP | | RATINGS |
| E1005 | Setan Airlines Inc | 815600JRN7AOE36KFR35 | US | CORP | | RATINGS |
| E1006 | Soson Airlines Inc | 213800WSVEOAQ5HD4C43 | US | CORP | E1005 | RATINGS |
| E1007 | Golod Property plc | 815600N2UAHQREHHWF76 | GB | BANK | | RATINGS |
| E1008 | Sotil Retail plc | 213800RPNJ2OSQ387M40 | GB | CORP | | RATINGS |
| E1009 | Malam Chemicals Inc | 3912006EIY6TU9NVSC86 | US | CORP | | RATINGS |
| E1010 | Buvir Industries Inc | 3912004R2GZJL49URX69 | US | CORP | | RATINGS |
| E1011 | Falom Media Inc | 549300XX6U9N4Y7KPH74 | US | BANK | | RATINGS |
| E1012 | Posad Industries SA | 9695002JIQI5QYDN0G98 | FR | CORP | | RATINGS |
| E1013 | Pisol Pharma BV | 969500U072SAPPW32N81 | NL | BANK | E1004 | RATINGS |
| E1014 | Toral Utilities BV | 391200J700D8T2H18W16 | NL | CORP | | RATINGS |
| E1015 | Civen Steel Inc | 815600JSNIJ4UFCBF662 | US | CORP | | RATINGS |
| E1016 | Ponar Telecom SA | 5493008DQ96XI37KZG24 | ES | BANK | | RATINGS |
| E1017 | Nisid Steel SA | 391200K600X7LWZTTM85 | FR | BANK | | RATINGS |
| E1018 | Tosem Mining Inc | 549300SEMGL6OXLWHQ59 | US | CORP | | RATINGS |
| E1019 | Losol Mining SA | 391200GSFO0F68KKUC67 | CV | CORP | | RATINGS |
| E1020 | Finel Media AG | 549300FCSHHELSCZX562 | DE | CORP | | RATINGS |
| E1021 | Niner Pharma plc | 391200KLG6G4KVIMIU52 | GB | CORP | | RATINGS |
Query 2:
| instrument_id | description | issuer_id | guarantor_id | seniority | currency | maturity |
|---|---|---|---|---|---|---|
| I01 | Kestrel Energy 4.50% notes due 2030 | E01 | | SU | GBP | 2030-03-15 |
| I02 | Kestrel Energy 6.25% notes due 2031 | E01 | | SUB | GBP | 2031-09-30 |
| I03 | Northwind Finance 3.75% notes due 2030 | E04 | E02 | SU | EUR | 2030-05-01 |
| I04 | Valdoria Telecom 5.00% notes due 2029 | E05 | | SU | USD | 2029-11-20 |
| I05 | Halden Leasing 2.90% notes due 2028 | E11 | E10 | SU | EUR | 2028-06-30 |
| I06 | Corvenia Power 7.10% notes due 2032 | E15 | | SUB | USD | 2032-02-15 |
| I07 | Valdoria Telecom 4.25% notes due 2027 | E05 | | SU | XVD | 2027-08-31 |
| I08 | Corvenia Power 6.00% notes due 2034 | E15 | | SU | USD | 2034-09-01 |
| I1001 | Soson Airlines 5.50% notes due 2031 | E1006 | | SUB | USD | 2035-06-30 |
| I1002 | Golod Property 8.75% notes due 2031 | E1007 | | SU | USD | 2033-06-30 |
| I1003 | Sotil Retail 3.00% notes due 2031 | E1008 | | SU | GBP | 2034-06-30 |
| I1004 | Malam Chemicals 2.25% notes due 2035 | E1009 | | SU | USD | 2028-06-30 |
| I1005 | Posad Industries 4.00% notes due 2033 | E1012 | | SU | EUR | 2031-06-30 |
| I1006 | Pisol Pharma 4.75% notes due 2030 | E1013 | | SUB | USD | 2030-06-30 |
| I1007 | Toral Utilities 7.75% notes due 2028 | E1014 | | SU | EUR | 2033-06-30 |
| I1008 | Ponar Telecom 4.75% notes due 2035 | E1016 | | SU | EUR | 2033-06-30 |
| I1009 | Tosem Mining 2.75% notes due 2031 | E1018 | | SUB | USD | 2036-06-30 |
| I1010 | Finel Media 6.50% notes due 2035 | E1020 | | SU | EUR | 2036-06-30 |
| I1011 | Niner Pharma 3.25% notes due 2029 | E1021 | | SU | USD | 2035-06-30 |
| I1012 | Heled Water 6.25% notes due 2030 | E1023 | | SU | GBP | 2031-06-30 |
| I1013 | Kuvir Logistics 2.00% notes due 2027 | E1031 | | SU | EUR | 2027-06-30 |
| I1014 | Kavod Utilities 2.50% notes due 2032 | E1035 | | SU | USD | 2036-06-30 |
| I1015 | Lanon Telecom 4.75% notes due 2033 | E1038 | | SUB | EUR | 2032-06-30 |
| I1016 | Hiral Steel 6.00% notes due 2035 | E1041 | | SU | USD | 2034-06-30 |
| I1017 | Lised Pharma 4.50% notes due 2036 | E1048 | | SU | EUR | 2029-06-30 |
| I1018 | Paser Utilities 3.75% notes due 2027 | E1049 | | SUB | GBP | 2034-06-30 |
| I1019 | Sunar Holdings 8.50% notes due 2036 | E1050 | | SUB | USD | 2034-06-30 |
| I1020 | Witad Steel 5.00% notes due 2033 | E1052 | | SU | EUR | 2027-06-30 |
| I1021 | Duver Shipping 8.50% notes due 2032 | E1056 | | SU | EUR | 2030-06-30 |
| I1022 | Levem Foods 6.50% notes due 2035 | E1067 | | SUB | EUR | 2030-06-30 |
| I1023 | Mored Utilities 4.25% notes due 2032 | E1071 | | SUB | USD | 2033-06-30 |
| I1024 | Ganed Holdings 5.75% notes due 2035 | E1077 | | SU | EUR | 2032-06-30 |
| I1025 | Menir Shipping 7.50% notes due 2028 | E1078 | | SUB | EUR | 2034-06-30 |
| I1026 | Nevar Property 6.75% notes due 2036 | E1079 | | SU | GBP | 2028-06-30 |
| I1027 | Gilen Capital 2.00% notes due 2031 | E1082 | | SUB | USD | 2034-06-30 |
| I1028 | Givim Mining 5.75% notes due 2036 | E1085 | | SU | EUR | 2034-06-30 |
| I1029 | Gorar Steel 7.25% notes due 2033 | E1086 | | SUB | USD | 2035-06-30 |
| I1030 | Vitid Holdings 5.75% notes due 2032 | E1087 | | SU | EUR | 2034-06-30 |
| I1031 | Koved Holdings 2.50% notes due 2032 | E1088 | | SUB | EUR | 2033-06-30 |
| I1032 | Getel Utilities 7.25% notes due 2033 | E1090 | | SU | USD | 2032-06-30 |
Query 3:
| rating_type | ccy_basis | action | watch | outlook | count_star() |
|---|---|---|---|---|---|
| CC | | AS | | | 2 |
| CO | | AS | | | 7 |
| INST | | AF | | | 1 |
| INST | | AS | | | 113 |
| INST | | DG | | | 3 |
| INST | | EX | | | 9 |
| LTIDR | FC | AF | | NEG | 22 |
| LTIDR | FC | AF | | POS | 15 |
| LTIDR | FC | AF | | STA | 44 |
| LTIDR | FC | AS | | NEG | 1 |
| LTIDR | FC | AS | | STA | 425 |
| LTIDR | FC | DG | | NEG | 47 |
| LTIDR | FC | DG | | POS | 24 |
| LTIDR | FC | DG | | STA | 35 |
| LTIDR | FC | DG | | | 2 |
| LTIDR | FC | RW | RWN | | 45 |
| LTIDR | FC | UG | | NEG | 8 |
| LTIDR | FC | UG | | POS | 10 |
| LTIDR | FC | UG | | STA | 27 |
| LTIDR | FC | WD | | | 39 |
| LTIDR | LC | AF | | POS | 1 |
| LTIDR | LC | AF | | STA | 3 |
| LTIDR | LC | AS | | STA | 19 |
| LTIDR | LC | DG | | NEG | 1 |
| LTIDR | LC | DG | | POS | 1 |
| LTIDR | LC | DG | | STA | 2 |
| LTIDR | LC | RW | RWN | | 3 |
| LTIDR | LC | UG | | POS | 1 |
| LTIDR | LC | UG | | STA | 2 |
| LTIDR | LC | WD | | | 1 |
| STIDR | FC | AF | | | 1 |
Query 4:
| entity_type | source_system | count_star() |
|---|---|---|
| CORP | RESEARCH | 24 |
| FINSUB | RATINGS | 17 |
| BANK | RATINGS | 85 |
| CORP | QA | 14 |
| BANK | RESEARCH | 5 |
| CORP | RATINGS | 393 |
| SOV | RATINGS | 2 |
Run more queries, or give the final answers.The model
<invoke name="sql">
SELECT * FROM rating_actions WHERE rated_id IN ('E01','I01','I02','E02','E03','E04','I03','E05','I04','I07','VD','E06','E13','E07','E08') ORDER BY rated_id, date;
</invoke>
```sql
SELECT * FROM rating_actions WHERE rated_id IN ('E09','E10','E11','E12','E14','E15','E16','E17','CV','I05','I06','I08') ORDER BY rated_id, date;
```Query results
Query 1:
| action_id | date | rated_id | rating_type | ccy_basis | action | rating | outlook | watch | comment |
|---|---|---|---|---|---|---|---|---|---|
| A37 | 2024-01-01 | CV | CC | | AS | A | | | |
| A38 | 2024-01-01 | CV | LTIDR | FC | AS | BBB+ | STA | | |
| A39 | 2024-01-01 | CV | LTIDR | LC | AS | A- | STA | | |
| A24 | 2023-05-01 | E09 | LTIDR | FC | AS | A | STA | | |
| A25 | 2026-03-01 | E09 | LTIDR | FC | AF | A | NEG | | |
| A26 | 2023-05-01 | E10 | LTIDR | FC | AS | A- | STA | | support from parent |
| A27 | 2026-04-15 | E10 | LTIDR | FC | DG | BBB+ | STA | | |
| A46 | 2025-02-01 | E11 | CO | | AS | BBB | | | |
| A30 | 2024-02-01 | E12 | LTIDR | FC | AS | BB- | STA | | |
| A31 | 2025-08-01 | E12 | LTIDR | FC | UG | BB | STA | | |
| A34 | 2023-01-15 | E14 | LTIDR | FC | AS | A- | STA | | |
| A36 | 2024-09-30 | E14 | LTIDR | FC | DG | BBB+ | STA | | |
| A35 | 2025-11-20 | E14 | LTIDR | FC | RW | BBB+ | | RWN | |
| A33 | 2026-05-01 | E14 | LTIDR | FC | AF | BBB+ | STA | | |
| A40 | 2024-03-01 | E15 | LTIDR | LC | AS | A+ | STA | | |
| A41 | 2024-03-01 | E15 | LTIDR | FC | AS | A | STA | | |
| A43 | 2024-04-01 | E16 | LTIDR | FC | AS | BBB- | STA | | |
| A44 | 2026-06-01 | E16 | LTIDR | FC | DG | BB+ | STA | | |
| A28 | 2023-06-01 | I05 | INST | | AS | A- | | | |
| A29 | 2026-04-15 | I05 | INST | | DG | BBB+ | | | |
| A42 | 2024-03-01 | I06 | INST | | AS | A- | | | |
| A47 | 2026-09-01 | I08 | INST | | EX | A | | | |
Query 2:
| action_id | date | rated_id | rating_type | ccy_basis | action | rating | outlook | watch | comment |
|---|---|---|---|---|---|---|---|---|---|
| A01 | 2024-03-12 | E01 | LTIDR | FC | AS | A- | STA | | |
| A02 | 2025-06-20 | E01 | LTIDR | FC | DG | BBB | STA | | weaker cash flow after asset sale |
| A03 | 2026-02-10 | E01 | LTIDR | FC | AF | BBB | NEG | | |
| A04 | 2026-02-10 | E01 | STIDR | FC | AF | F2 | | | |
| A08 | 2023-11-01 | E02 | LTIDR | FC | AS | A | STA | | |
| A09 | 2025-09-15 | E03 | LTIDR | FC | AF | A | POS | | |
| A13 | 2025-04-01 | E05 | LTIDR | LC | AS | BBB- | STA | | |
| A14 | 2025-04-01 | E05 | LTIDR | FC | AS | BB | STA | | |
| A16 | 2024-05-01 | E06 | LTIDR | FC | AS | A- | STA | | |
| A17 | 2026-09-03 | E06 | LTIDR | FC | RW | A- | | RWN | |
| A18 | 2024-01-10 | E07 | LTIDR | FC | AS | BB | STA | | |
| A19 | 2026-05-12 | E07 | LTIDR | FC | WD | WD | | | commercial reasons |
| A20 | 2024-06-01 | E08 | LTIDR | FC | AS | B | STA | | |
| A21 | 2026-01-20 | E08 | LTIDR | FC | DG | CCC | | | |
| A22 | 2026-07-08 | E08 | LTIDR | FC | DG | RD | | | distressed debt exchange completed |
| A32 | 2024-07-01 | E13 | LTIDR | FC | AS | BBB | STA | | |
| A05 | 2024-03-12 | I01 | INST | | AS | A- | | | |
| A06 | 2025-06-20 | I01 | INST | | DG | BBB | | | |
| A23 | 2024-03-12 | I02 | INST | | AS | BBB | | | |
| A07 | 2025-06-20 | I02 | INST | | DG | BB+ | | | |
| A10 | 2023-11-01 | I03 | INST | | AS | A | | | |
| A11 | 2025-09-15 | I03 | INST | | AF | A | | | |
| A15 | 2025-04-01 | I04 | INST | | AS | BB | | | |
| A45 | 2025-04-01 | I07 | INST | | AS | BBB- | | | |
| A12 | 2025-04-01 | VD | CC | | AS | BB | | | |
Run more queries, or give the final answers.The model
Next I'm pulling the hierarchy, the ceilings, the remaining instruments and the current-state data.
```sql
SELECT * FROM rating_actions WHERE rating_type IN ('CC','CO') OR comment IS NOT NULL AND comment<>'' ORDER BY date;
```
```sql
SELECT * FROM instruments WHERE instrument_id NOT LIKE 'I10%' OR guarantor_id<>'' OR description LIKE '%Cross%' OR currency NOT IN ('USD','EUR','GBP');
```
```sql
SELECT * FROM entities WHERE parent_id<>'' OR name ILIKE '%cerid%' OR name ILIKE '%rotam%' OR name ILIKE '%wonod%' OR name ILIKE '%vesol%' OR name ILIKE '%belir%' OR country='LU' OR entity_type='FINSUB' ORDER BY entity_id;
```
```sql
SELECT lei, count(*), string_agg(entity_id||':'||source_system,',') FROM entities WHERE lei<>'' GROUP BY lei HAVING count(*)>1;
```Query results
Query 1:
| action_id | date | rated_id | rating_type | ccy_basis | action | rating | outlook | watch | comment |
|---|---|---|---|---|---|---|---|---|---|
| A1095 | 2023-04-15 | E1048 | LTIDR | FC | WD | WD | | | commercial reasons |
| A26 | 2023-05-01 | E10 | LTIDR | FC | AS | A- | STA | | support from parent |
| A1356 | 2023-07-26 | E1166 | LTIDR | FC | WD | WD | | | commercial reasons |
| A1685 | 2023-10-15 | E1320 | LTIDR | FC | WD | WD | | | commercial reasons |
| A1422 | 2023-11-03 | E1200 | LTIDR | FC | WD | WD | | | commercial reasons |
| A37 | 2024-01-01 | CV | CC | | AS | A | | | |
| A1085 | 2024-04-09 | E1041 | LTIDR | FC | WD | WD | | | commercial reasons |
| A1522 | 2024-04-18 | E1244 | LTIDR | FC | WD | WD | | | commercial reasons |
| A1161 | 2024-04-28 | E1076 | LTIDR | FC | WD | WD | | | commercial reasons |
| A1268 | 2024-06-15 | E1124 | LTIDR | FC | WD | WD | | | commercial reasons |
| A1680 | 2024-07-07 | E1316 | LTIDR | FC | WD | WD | | | commercial reasons |
| A1708 | 2024-08-17 | E1333 | CO | | AS | BBB+ | | | |
| A1233 | 2024-10-16 | E1107 | LTIDR | FC | WD | WD | | | commercial reasons |
| A1263 | 2024-10-23 | E1121 | LTIDR | FC | WD | WD | | | commercial reasons |
| A1594 | 2024-11-17 | E1279 | LTIDR | FC | WD | WD | | | commercial reasons |
| A1296 | 2024-12-26 | E1138 | LTIDR | FC | WD | WD | | | commercial reasons |
| A1138 | 2025-01-12 | E1063 | LTIDR | FC | WD | WD | | | commercial reasons |
| A1496 | 2025-01-24 | E1233 | LTIDR | FC | WD | WD | | | commercial reasons |
| A46 | 2025-02-01 | E11 | CO | | AS | BBB | | | |
| A1136 | 2025-03-28 | E1062 | LTIDR | FC | WD | WD | | | commercial reasons |
| A12 | 2025-04-01 | VD | CC | | AS | BB | | | |
| A1473 | 2025-06-12 | E1225 | LTIDR | FC | WD | WD | | | commercial reasons |
| A1700 | 2025-06-13 | E1327 | CO | | AS | BBB- | | | |
| A1664 | 2025-06-19 | E1308 | LTIDR | FC | WD | WD | | | commercial reasons |
| A02 | 2025-06-20 | E01 | LTIDR | FC | DG | BBB | STA | | weaker cash flow after asset sale |
| A1704 | 2025-06-27 | E1330 | CO | | AS | BB+ | | | |
| A1251 | 2025-06-28 | E1115 | LTIDR | FC | WD | WD | | | commercial reasons |
| A1002 | 2025-07-20 | E1002 | LTIDR | FC | WD | WD | | | commercial reasons |
| A1180 | 2025-08-02 | E1084 | LTIDR | FC | WD | WD | | | commercial reasons |
| A1230 | 2025-08-10 | E1106 | LTIDR | LC | WD | WD | | | commercial reasons |
| A1540 | 2025-08-13 | E1254 | LTIDR | FC | WD | WD | | | commercial reasons |
| A1298 | 2025-09-15 | E1140 | LTIDR | FC | WD | WD | | | commercial reasons |
| A1046 | 2025-11-08 | E1021 | LTIDR | FC | WD | WD | | | commercial reasons |
| A1430 | 2025-11-16 | E1205 | LTIDR | FC | WD | WD | | | commercial reasons |
| A1433 | 2025-11-20 | E1206 | LTIDR | FC | WD | WD | | | commercial reasons |
| A1590 | 2025-12-14 | E1277 | LTIDR | FC | WD | WD | | | commercial reasons |
| A1339 | 2026-02-27 | E1158 | LTIDR | FC | WD | WD | | | commercial reasons |
| A1371 | 2026-03-12 | E1172 | LTIDR | FC | WD | WD | | | commercial reasons |
| A1332 | 2026-03-22 | E1155 | LTIDR | FC | WD | WD | | | commercial reasons |
| A1650 | 2026-03-26 | E1303 | LTIDR | FC | WD | WD | | | commercial reasons |
| A1462 | 2026-04-11 | E1219 | LTIDR | FC | WD | WD | | | commercial reasons |
| A19 | 2026-05-12 | E07 | LTIDR | FC | WD | WD | | | commercial reasons |
| A1459 | 2026-05-22 | E1218 | LTIDR | FC | WD | WD | | | commercial reasons |
| A1013 | 2026-06-27 | E1007 | LTIDR | FC | WD | WD | | | commercial reasons |
| A1715 | 2026-07-04 | E1338 | CO | | AS | BBB+ | | | |
| A22 | 2026-07-08 | E08 | LTIDR | FC | DG | RD | | | distressed debt exchange completed |
| A1698 | 2026-09-02 | E1326 | CO | | AS | BB | | | |
| A1067 | 2026-09-15 | E1032 | LTIDR | FC | WD | WD | | | commercial reasons |
| A1124 | 2026-09-19 | E1057 | LTIDR | FC | WD | WD | | | commercial reasons |
| A1499 | 2026-09-22 | E1234 | LTIDR | FC | WD | WD | | | commercial reasons |
| A1342 | 2026-09-22 | E1159 | LTIDR | FC | WD | WD | | | commercial reasons |
| A1713 | 2026-11-16 | E1337 | CO | | AS | BBB+ | | | |
Query 2:
| instrument_id | description | issuer_id | guarantor_id | seniority | currency | maturity |
|---|---|---|---|---|---|---|
| I01 | Kestrel Energy 4.50% notes due 2030 | E01 | | SU | GBP | 2030-03-15 |
| I02 | Kestrel Energy 6.25% notes due 2031 | E01 | | SUB | GBP | 2031-09-30 |
| I03 | Northwind Finance 3.75% notes due 2030 | E04 | E02 | SU | EUR | 2030-05-01 |
| I04 | Valdoria Telecom 5.00% notes due 2029 | E05 | | SU | USD | 2029-11-20 |
| I05 | Halden Leasing 2.90% notes due 2028 | E11 | E10 | SU | EUR | 2028-06-30 |
| I06 | Corvenia Power 7.10% notes due 2032 | E15 | | SUB | USD | 2032-02-15 |
| I07 | Valdoria Telecom 4.25% notes due 2027 | E05 | | SU | XVD | 2027-08-31 |
| I08 | Corvenia Power 6.00% notes due 2034 | E15 | | SU | USD | 2034-09-01 |
| I1064 | Fetam Mining 6.75% notes due 2035 | E1229 | | SU | CVK | 2028-06-30 |
| I1069 | Nitel Retail 2.25% notes due 2031 | E1236 | | SUB | XVD | 2036-06-30 |
| I1071 | Gater Holdings 7.50% notes due 2036 | E1245 | | SUB | CVK | 2035-06-30 |
| I1093 | Poval Chemicals Finance 2.50% notes due 2034 | E1325 | E1084 | SU | EUR | 2027-03-31 |
| I1094 | Witad Steel Finance 6.50% notes due 2027 | E1326 | E1052 | SU | EUR | 2033-03-31 |
| I1095 | Nuner Holdings Finance 4.50% notes due 2032 | E1327 | E1119 | SU | EUR | 2030-03-31 |
| I1096 | Palad Mining Finance 6.50% notes due 2030 | E1328 | E1244 | SU | EUR | 2028-03-31 |
| I1097 | Ganen Shipping Finance 5.50% notes due 2030 | E1329 | E1069 | SU | EUR | 2029-03-31 |
| I1098 | Niner Pharma Finance 3.50% notes due 2030 | E1330 | E1021 | SU | EUR | 2032-03-31 |
| I1099 | Tulol Shipping Finance 3.50% notes due 2034 | E1331 | E1025 | SU | EUR | 2032-03-31 |
| I1100 | Sanin Mining Finance 2.50% notes due 2032 | E1332 | E1068 | SU | EUR | 2028-03-31 |
| I1101 | Gilen Capital Finance 3.50% notes due 2031 | E1333 | E1082 | SU | EUR | 2034-03-31 |
| I1102 | Votim Industries Finance 3.50% notes due 2027 | E1334 | E1260 | SU | EUR | 2031-03-31 |
| I1103 | Belor Telecom Finance 2.50% notes due 2027 | E1335 | E1234 | SU | EUR | 2030-03-31 |
| I1104 | Navor Holdings Finance 2.50% notes due 2029 | E1336 | E1176 | SU | EUR | 2033-03-31 |
| I1105 | Lanon Telecom Finance 5.50% notes due 2028 | E1337 | E1038 | SU | EUR | 2034-03-31 |
| I1106 | Hivor Industries Finance 6.50% notes due 2027 | E1338 | E1073 | SU | EUR | 2033-03-31 |
| I1107 | Wivin Airlines Finance 2.50% notes due 2031 | E1339 | E1241 | SU | EUR | 2030-03-31 |
| I5001 | Cerid Funding 4.25% notes due 2033 | E5005 | E5001 | SU | EUR | 2030-12-31 |
| I5002 | Belir Funding 5.25% notes due 2035 | E5062 | E5059 | SU | EUR | 2029-12-31 |
| I5003 | Rotam Funding 3.25% notes due 2032 | E5090 | E5086 | SU | EUR | 2033-12-31 |
| I5004 | Wonod Funding 4.25% notes due 2032 | E5108 | E5105 | SU | EUR | 2032-12-31 |
| I5005 | Vesol Funding 7.25% notes due 2033 | E5135 | E5132 | SU | EUR | 2030-12-31 |
| I5006 | Geren Funding 7.25% notes due 2030 | E5149 | E5145 | SU | EUR | 2032-12-31 |
| I5007 | Cross-group 4.75% notes due 2031 | E5133 | E5145 | SU | USD | 2031-06-30 |
Query 3:
| entity_id | name | lei | country | entity_type | parent_id | source_system |
|---|---|---|---|---|---|---|
| E04 | Northwind Finance BV | 213800LA5RYJLGXV2T85 | NL | FINSUB | E02 | RATINGS |
| E10 | Halden Bank AG | 391200QYPVFF2O9K2039 | DE | BANK | E09 | RATINGS |
| E1006 | Soson Airlines Inc | 213800WSVEOAQ5HD4C43 | US | CORP | E1005 | RATINGS |
| E1013 | Pisol Pharma BV | 969500U072SAPPW32N81 | NL | BANK | E1004 | RATINGS |
| E1033 | Kunid Pharma SA | 213800Q84PS4FTJJB947 | ES | CORP | E1004 | RATINGS |
| E1046 | Ditin Shipping Inc | 549300ZM08IADSAK3L87 | US | BANK | E1026 | RATINGS |
| E1047 | Vaved Pharma plc | 391200WGA8OE30KZUD08 | GB | CORP | E1020 | RATINGS |
| E1059 | Kelim Media SA | 549300CRXZL5I1OT6L14 | CV | CORP | E1015 | RATINGS |
| E1066 | Lolil Industries SA | 213800VQSNQ2434DKS91 | ES | CORP | E1004 | RATINGS |
| E1075 | Nilim Industries Inc | 815600GT8SEYXSQI7W78 | US | CORP | E1071 | RATINGS |
| E1089 | Hanir Airlines SA | 969500WJX7JXMZXN4L42 | GR | CORP | E1078 | RATINGS |
| E1095 | Hunel Foods Inc | 549300YCPCEYTT7UCP57 | US | CORP | E1027 | RATINGS |
| E1098 | Wirim Water Inc | 724500HD5AQ2MDSXXU69 | US | CORP | E1006 | RATINGS |
| E11 | Halden Leasing SA | 549300XBZH4ULO9MQV55 | FR | FINSUB | E10 | RATINGS |
| E1101 | Doror Telecom SA | 815600YUVYKAXDN9LE93 | VD | CORP | E1083 | RATINGS |
| E1110 | Rinar Industries SA | 815600DZBIB9VS57NE44 | ES | CORP | E1007 | RATINGS |
| E1114 | Verod Logistics plc | 213800VNSK3FDUWI9Q67 | GB | CORP | E1063 | RATINGS |
| E1149 | Honel Shipping BV | 969500DV6LOBOACJKE42 | NL | CORP | E1013 | RATINGS |
| E1174 | Fivel Retail SpA | 724500P05MC40B0POA10 | IT | BANK | E1073 | RATINGS |
| E1177 | Kiver Capital AG | 213800J4ER8QI0XDZ847 | DE | BANK | E1010 | RATINGS |
| E1179 | Cotan Foods SA | 391200USHZVHBK9FHP01 | ES | CORP | E1162 | RATINGS |
| E1183 | Danad Pharma plc | 96950015W720OD9VIA28 | GB | CORP | E1025 | RATINGS |
| E1191 | Boler Steel SA | 815600G5CMC2QEQUCG23 | FR | CORP | E1177 | RATINGS |
| E1197 | Kaval Property plc | 8156000IN4HMEEM2ON82 | GB | CORP | E1066 | RATINGS |
| E1215 | Penen Retail Inc | 8156003V8NY694JQQA11 | US | BANK | E1063 | RATINGS |
| E1228 | Cevad Chemicals plc | 724500JFK718P3DNW233 | GB | CORP | E1023 | RATINGS |
| E1233 | Kavid Industries AG | 3912001DEUC7UPZYE471 | DE | CORP | E1198 | RATINGS |
| E1248 | Hivod Mining Inc | 213800XN4WOS9M0UP985 | US | CORP | E1107 | RATINGS |
| E1271 | Rarid Logistics AG | 213800M91M3NKSWT8K97 | DE | CORP | E1071 | RATINGS |
| E1273 | Furer Property SA | 724500Y582IZ7KJ6AG72 | ES | CORP | E1074 | RATINGS |
| E1275 | Fusin Steel Inc | 815600G1ZFK3SU6EZU96 | US | CORP | E1189 | RATINGS |
| E1276 | Nevil Holdings SpA | 2138005AK9MHXT35J172 | IT | CORP | E1074 | RATINGS |
| E1292 | Bavon Industries plc | 549300RN36RWXRZPV988 | GB | CORP | E1061 | RATINGS |
| E1293 | Datod Airlines plc | 391200BREGDXY5M1LW07 | GB | CORP | E1166 | RATINGS |
| E1315 | Wetid Shipping AG | 391200G0CPKPNGKWC253 | DE | CORP | E1278 | RATINGS |
| E1325 | Poval Chemicals Finance SA | 9695001YLTVXK1L24J01 | FR | FINSUB | E1084 | RATINGS |
| E1326 | Witad Steel Finance BV | 969500WJEQ7O6V8P8X79 | FR | FINSUB | E1052 | RATINGS |
| E1327 | Nuner Holdings Finance plc | 391200SWQKZG1IRLG226 | GB | FINSUB | E1119 | RATINGS |
| E1328 | Palad Mining Finance BV | 969500NW5R0G6TCAZA92 | GB | FINSUB | E1244 | RATINGS |
| E1329 | Ganen Shipping Finance plc | 549300ZZB6Z4QUIPZW48 | FR | FINSUB | E1069 | RATINGS |
| E1330 | Niner Pharma Finance SA | 969500PPIIF0MLO97E32 | NL | FINSUB | E1021 | RATINGS |
| E1331 | Tulol Shipping Finance BV | 391200D59Z1B4XWDGA48 | FR | FINSUB | E1025 | RATINGS |
| E1332 | Sanin Mining Finance SA | 21380077GIA72K258C76 | FR | FINSUB | E1068 | RATINGS |
| E1333 | Gilen Capital Finance plc | 213800HVPSP99Z2KCJ88 | NL | FINSUB | E1082 | RATINGS |
| E1334 | Votim Industries Finance BV | 3912005LQY8PFMP9D487 | FR | FINSUB | E1260 | RATINGS |
| E1335 | Belor Telecom Finance plc | 9695001Q1J0GREF1Y798 | NL | FINSUB | E1234 | RATINGS |
| E1336 | Navor Holdings Finance SA | 391200G55M6O27UJS152 | GB | FINSUB | E1176 | RATINGS |
| E1337 | Lanon Telecom Finance plc | 391200EERFGANN46Y270 | GB | FINSUB | E1038 | RATINGS |
| E1338 | Hivor Industries Finance BV | 724500WX98LDWMIZLF21 | GB | FINSUB | E1073 | RATINGS |
| E1339 | Wivin Airlines Finance SA | 724500Y59GQFHLXXCT69 | NL | FINSUB | E1241 | RATINGS |
| E17 | HALDEN BANK | 391200QYPVFF2O9K2039 | LU | BANK | | RESEARCH |
| E5001 | Cerid Group plc | 815600F48PANJQE75352 | GB | CORP | | RATINGS |
| E5002 | Cerid Energy plc | 3912006ACANJUP8PLJ39 | GB | CORP | E5001 | RATINGS |
| E5003 | Cerid Media BV | 724500EXQA91TPK6WL60 | NL | CORP | E5001 | RATINGS |
| E5004 | Cerid Utilities plc | 969500SFWGRHVUTANY40 | GB | CORP | E5001 | RATINGS |
| E5005 | Cerid Chemicals SA | 391200B1GR4AGTV5WY99 | VD | CORP | E5002 | RATINGS |
| E5006 | Cerid Foods plc | 969500HZQBDFIIHLYK06 | GB | BANK | E5002 | RATINGS |
| E5007 | Cerid Holdings BV | 391200Q98UGZZQTV1C88 | NL | CORP | E5003 | RATINGS |
| E5008 | Cerid Airlines BV | 815600M8RE9386DDQB31 | NL | CORP | E5003 | RATINGS |
| E5009 | Cerid Leror Logistics plc | 96950033222B9BRCGP58 | GB | CORP | E5004 | RATINGS |
(160 more rows not shown)
Query 4:
| lei | count_star() | string_agg(((entity_id || ':') || source_system), ',') |
|---|---|---|
| 724500BSV4X2J7KUR535 | 2 | E1138:RATINGS,E1139:RESEARCH |
| 5493004IM0PRT8BSDK29 | 2 | E1238:RATINGS,E1239:RESEARCH |
| 391200B1GR4AGTV5WY99 | 2 | E5005:RATINGS,E5167:RESEARCH |
| 549300HWTXXHJP2HKU38 | 2 | E1209:RATINGS,E1210:RESEARCH |
| 969500PM41NS2PBZU440 | 2 | E1160:RATINGS,E1161:RESEARCH |
| 3912003R00FP6CNV6210 | 2 | E1001:RATINGS,E1002:RESEARCH |
| 391200KLG6G4KVIMIU52 | 2 | E1021:RATINGS,E1022:RESEARCH |
| 391200QYPVFF2O9K2039 | 2 | E10:RATINGS,E17:RESEARCH |
| 8156008DPX4I9DNKWN26 | 2 | E1029:RATINGS,E1030:RESEARCH |
| 549300E50JHDJNBUGF22 | 2 | E1152:RATINGS,E1153:RESEARCH |
| 724500YEJSJ19G17TW94 | 2 | E1258:RATINGS,E1259:RESEARCH |
| 213800PHEIYNJMHTDV74 | 2 | E02:RATINGS,E03:RESEARCH |
| 391200JN4T4KY2HCRU75 | 2 | E1116:RATINGS,E1117:RESEARCH |
| 969500KYKHRI6N2WRN19 | 2 | E1156:RATINGS,E1157:RESEARCH |
| 969500QXEZ0NSV6EIW69 | 2 | E1253:RATINGS,E1254:RESEARCH |
| 969500W1342GHBTOGH81 | 2 | E5106:RATINGS,E5169:RESEARCH |
| 391200USHZVHBK9FHP01 | 2 | E1179:RATINGS,E1180:RESEARCH |
| 549300H1N0EQEAZLE362 | 2 | E1261:RATINGS,E1262:RESEARCH |
| 549300NTCTGRKRYIAN83 | 2 | E1096:RATINGS,E1097:RESEARCH |
| 815600RCZP0ISY44E024 | 2 | E1298:RATINGS,E1299:RESEARCH |
| 549300CRXZL5I1OT6L14 | 2 | E1059:RATINGS,E1060:RESEARCH |
| 549300A64I73OEIC4R87 | 2 | E1213:RATINGS,E1214:RESEARCH |
| 54930011OTFCAUKB0A28 | 2 | E5062:RATINGS,E5168:RESEARCH |
| 815600HDI8Y3IWGOOH22 | 2 | E1103:RATINGS,E1104:RESEARCH |
| 391200E9TAHDZV7CY568 | 2 | E1147:RATINGS,E1148:RESEARCH |
| 549300XV49ES64RGNQ00 | 2 | E1169:RATINGS,E1170:RESEARCH |
| 815600LRX1P8142NMF42 | 2 | E1245:RATINGS,E1246:RESEARCH |
| 724500UQKUINIUB80J18 | 2 | E1318:RATINGS,E1319:RESEARCH |
| 9695000PSF2HLPO9AE57 | 2 | E1310:RATINGS,E1311:RESEARCH |
Run more queries, or give the final answers.The model
<invoke name="sql">
SELECT date, rated_id, rating_type, ccy_basis, action, rating, outlook, watch FROM rating_actions WHERE date>='2026-01-01' AND action='DG' ORDER BY date;
</invoke>
```sql
SELECT rated_id, date, rating_type, ccy_basis, action, rating FROM rating_actions WHERE rating IN ('RD','D','C','DD','SD') OR rating LIKE 'CC%' ORDER BY rated_id, date;
```
```sql
WITH r AS (SELECT *, row_number() OVER (PARTITION BY rated_id, rating_type, ccy_basis ORDER BY date DESC, action_id DESC) rn FROM rating_actions WHERE date<='2026-10-01' AND rating_type IN ('LTIDR')),
c AS (SELECT * FROM r WHERE rn=1 AND action<>'WD')
SELECT 'cnt_entities_any' k, count(DISTINCT rated_id)::VARCHAR v FROM c
UNION ALL SELECT 'cnt_lei', count(DISTINCT e.lei)::VARCHAR FROM c JOIN entities e ON e.entity_id=c.rated_id
UNION ALL SELECT 'GB_entities', count(DISTINCT c.rated_id)::VARCHAR FROM c JOIN entities e ON e.entity_id=c.rated_id WHERE e.country='GB'
UNION ALL SELECT 'GB_lei', count(DISTINCT e.lei)::VARCHAR FROM c JOIN entities e ON e.entity_id=c.rated_id WHERE e.country='GB'
UNION ALL SELECT 'RWN', string_agg(DISTINCT rated_id, ',') FROM c WHERE watch='RWN' AND ccy_basis='FC'
UNION ALL SELECT 'NEG', string_agg(DISTINCT rated_id, ',') FROM c WHERE outlook='NEG' AND (watch IS NULL OR watch='')
UNION ALL SELECT 'DEF', string_agg(DISTINCT rated_id, ',') FROM c WHERE rating IN ('RD','D');
```
```sql
WITH r AS (SELECT *, row_number() OVER (PARTITION BY rated_id, rating_type, ccy_basis ORDER BY date DESC, action_id DESC) rn FROM rating_actions WHERE date<='2026-10-01' AND rating_type='INST')
SELECT count(*) total, count(*) FILTER (WHERE action<>'EX' AND action<>'WD') active, count(*) FILTER (WHERE action<>'EX' AND rating IN ('AAA','AA+','AA','AA-','A+','A','A-','BBB+','BBB','BBB-')) ig, string_agg(rated_id||':'||action||':'||rating, ',') FROM r WHERE rn=1 AND (action='EX' OR rated_id IN ('I01','I02','I03','I04','I05','I06','I07','I08'));
```
```sql
WITH RECURSIVE t AS (SELECT entity_id, entity_id root, 0 lvl FROM entities WHERE parent_id='' OR parent_id IS NULL UNION ALL SELECT e.entity_id, t.root, lvl+1 FROM entities e JOIN t ON e.parent_id=t.entity_id)
SELECT t.root, p.name, p.country, count(*) n, max(lvl) maxlvl, count(*) FILTER (WHERE lvl=3) l3, string_agg(DISTINCT x.country,',') FROM t JOIN entities p ON p.entity_id=t.root JOIN entities x ON x.entity_id=t.entity_id WHERE t.root IN ('E09','E02','E5001','E5059','E5086','E5105','E5132','E5145') OR p.name ILIKE '%rotam%' OR p.name ILIKE '%wonod%' OR p.name ILIKE '%vesol%' OR p.name ILIKE '%belir%' GROUP BY ALL;
```
```sql
SELECT count(*) n, count(DISTINCT lei) leis, count(*) FILTER (WHERE country='LU') lu, count(DISTINCT lei) FILTER (WHERE country='LU') lu_lei FROM entities;
```Query results
Query 1:
| rated_id | date | rating_type | ccy_basis | action | rating |
|---|---|---|---|---|---|
| E08 | 2026-01-20 | LTIDR | FC | DG | CCC |
| E08 | 2026-07-08 | LTIDR | FC | DG | RD |
Query 2:
| k | v |
|---|---|
| cnt_entities_any | 393 |
| cnt_lei | 390 |
| GB_entities | 88 |
| GB_lei | 87 |
| RWN | E1099,E1260,E1132,E1264,E1006,E1039,E1266,E1317,E1037,E1242,E1267,E1297,E1061,E1238,E1013,E1066,E1314,E1203,E1146,E1323,E1133,E06,E1088,E1194,E1126,E1098,E1210,E1181,E1109,E1168 |
| NEG | E5141,E5119,E1294,E1055,E1350,E1344,E1105,E1158,E1190,E5039,E1072,E5156,E1347,E1271,E1079,E5116,E1080,E1005,E1211,E1262,E5019,E5113,E5131,E1060,E09,E1348,E1046,E5059,E1161,E1351,E5020,E1029,E1342,E5170,E1248,E5057,E1034,E1188,E5102,E5097,E1300,E1263,E5073,E5050,E1228,E1345,E5099,E5023,E1056,E5062,E1340,E5013,E1282,E1064,E1118,E1343,E01 |
| DEF | E08 |
Query 3:
| total | active | ig | string_agg(((((rated_id || ':') || "action") || ':') || rating), ',') |
|---|---|---|---|
| 13 | 7 | 5 | I1049:EX:BB-,I1046:EX:B+,I1008:EX:B+,I03:AF:A,I02:DG:BB+,I05:DG:BBB+,I1021:EX:AA-,I06:AS:A-,I08:EX:A,I1012:EX:A-,I01:DG:BBB,I07:AS:BBB-,I04:AS:BB |
Query 4:
| root | name | country | n | maxlvl | l3 | string_agg(DISTINCT x.country, ',') |
|---|---|---|---|---|---|---|
| E5169 | WONOD STEEL BV | VD | 1 | 0 | 0 | VD |
| E02 | Northwind Holdings plc | GB | 2 | 1 | 0 | NL,GB |
| E5059 | Belir Group AG | DE | 27 | 5 | 4 | VD,GB,US,DE,CV,FR |
| E5145 | Geren Group SA | VD | 22 | 4 | 6 | US,ES,DE,VD,GB,FR,CV |
| E5001 | Cerid Group plc | GB | 55 | 6 | 11 | CV,VD,DE,ES,IT,FR,US,GB,NL |
| E5132 | Vesol Group BV | NL | 13 | 4 | 4 | DE,FR,US,GB,NL |
| E5086 | Rotam Group Inc | US | 20 | 4 | 6 | ES,CV,US,FR,NL,VD |
| E09 | Halden Group plc | GB | 3 | 2 | 0 | FR,GB,DE |
| E5105 | Wonod Group SA | FR | 27 | 5 | 6 | ES,CV,US,FR,NL,VD |
Query 5:
| n | leis | lu | lu_lei |
|---|---|---|---|
| 540 | 509 | 1 | 1 |
Query 6:
| date | rated_id | rating_type | ccy_basis | action | rating | outlook | watch |
|---|---|---|---|---|---|---|---|
| 2026-01-04 | E1186 | LTIDR | FC | DG | BBB+ | STA | |
| 2026-01-13 | E1243 | LTIDR | FC | DG | BB | STA | |
| 2026-01-19 | E1255 | LTIDR | FC | DG | BBB+ | STA | |
| 2026-01-20 | E08 | LTIDR | FC | DG | CCC | | |
| 2026-01-26 | E1151 | LTIDR | FC | DG | BBB | POS | |
| 2026-02-06 | E1299 | LTIDR | FC | DG | BBB | POS | |
| 2026-02-08 | E1307 | LTIDR | FC | DG | BB- | POS | |
| 2026-02-13 | E1213 | LTIDR | FC | DG | A- | STA | |
| 2026-02-14 | E1080 | LTIDR | FC | DG | A- | NEG | |
| 2026-02-16 | E5156 | LTIDR | FC | DG | B- | NEG | |
| 2026-02-17 | E1285 | LTIDR | FC | DG | A | POS | |
| 2026-02-20 | E1112 | LTIDR | FC | DG | BBB | POS | |
| 2026-03-03 | E1263 | LTIDR | FC | DG | BBB | STA | |
| 2026-03-04 | E1064 | LTIDR | FC | DG | BBB+ | STA | |
| 2026-03-10 | E1347 | LTIDR | FC | DG | BBB- | NEG | |
| 2026-03-18 | E1344 | LTIDR | FC | DG | A- | NEG | |
| 2026-03-18 | E1348 | LTIDR | FC | DG | BBB- | NEG | |
| 2026-03-19 | E5019 | LTIDR | FC | DG | BBB+ | NEG | |
| 2026-03-19 | E1163 | LTIDR | FC | DG | BB+ | POS | |
| 2026-03-20 | E1053 | LTIDR | FC | DG | BB | NEG | |
| 2026-04-05 | E1051 | LTIDR | FC | DG | A+ | NEG | |
| 2026-04-09 | E1300 | LTIDR | FC | DG | BBB+ | STA | |
| 2026-04-15 | I05 | INST | | DG | BBB+ | | |
| 2026-04-15 | E10 | LTIDR | FC | DG | BBB+ | STA | |
| 2026-05-02 | E1034 | LTIDR | FC | DG | BBB+ | NEG | |
| 2026-05-06 | E1300 | LTIDR | FC | DG | BBB | NEG | |
| 2026-05-06 | E1229 | LTIDR | FC | DG | BB | STA | |
| 2026-05-16 | E5116 | LTIDR | FC | DG | A | NEG | |
| 2026-05-25 | E5059 | LTIDR | FC | DG | BB+ | NEG | |
| 2026-06-01 | E16 | LTIDR | FC | DG | BB+ | STA | |
| 2026-06-01 | E1051 | LTIDR | FC | DG | A+ | POS | |
| 2026-06-02 | E1229 | LTIDR | FC | DG | BB+ | STA | |
| 2026-06-06 | E1144 | LTIDR | FC | DG | B+ | POS | |
| 2026-06-16 | E1263 | LTIDR | FC | DG | BBB- | NEG | |
| 2026-06-16 | E1159 | LTIDR | FC | DG | BBB+ | POS | |
| 2026-06-16 | E1213 | LTIDR | FC | DG | BBB+ | POS | |
| 2026-06-21 | E5113 | LTIDR | FC | DG | BB- | NEG | |
| 2026-06-25 | E1057 | LTIDR | FC | DG | BB | STA | |
| 2026-06-26 | E1340 | LTIDR | FC | DG | BBB+ | NEG | |
| 2026-06-28 | E1228 | LTIDR | FC | DG | BB+ | NEG | |
| 2026-07-08 | E08 | LTIDR | FC | DG | RD | | |
| 2026-07-11 | E1294 | LTIDR | FC | DG | A+ | NEG | |
| 2026-07-14 | E1058 | LTIDR | FC | DG | BBB- | POS | |
| 2026-07-17 | E1342 | LTIDR | FC | DG | BBB+ | NEG | |
| 2026-07-25 | E1093 | LTIDR | FC | DG | B | STA | |
| 2026-07-28 | E1161 | LTIDR | FC | DG | B | NEG | |
| 2026-08-08 | E1343 | LTIDR | FC | DG | BBB+ | NEG | |
| 2026-08-16 | E1170 | LTIDR | FC | DG | BB- | STA | |
| 2026-08-16 | E5097 | LTIDR | FC | DG | B- | NEG | |
| 2026-08-16 | E1290 | LTIDR | FC | DG | B | POS | |
| 2026-09-03 | E1350 | LTIDR | FC | DG | BB | NEG | |
| 2026-09-07 | E1167 | LTIDR | FC | DG | BB | STA | |
| 2026-09-22 | E1345 | LTIDR | FC | DG | BB- | NEG | |
| 2026-09-27 | E1351 | LTIDR | FC | DG | A- | NEG | |
| 2026-10-14 | E1349 | LTIDR | FC | DG | A- | NEG | |
| 2026-10-15 | E1346 | LTIDR | FC | DG | BBB+ | NEG | |
| 2026-11-06 | E5033 | LTIDR | FC | DG | A | NEG | |
| 2026-11-09 | E1341 | LTIDR | FC | DG | BBB+ | NEG | |
Run more queries, or give the final answers.The model
<invoke name="sql">
SELECT 1;
</invoke>
```sql
WITH RECURSIVE t AS (SELECT entity_id, entity_id root, 0 lvl, entity_id path FROM entities WHERE coalesce(parent_id,'')='' UNION ALL SELECT e.entity_id, t.root, lvl+1, t.path||'>'||e.entity_id FROM entities e JOIN t ON e.parent_id=t.entity_id)
SELECT e.entity_id, e.name, e.country, t.root, t.lvl, t.path FROM t JOIN entities e USING(entity_id) WHERE e.name ILIKE 'Cerid Rosor%' OR e.name ILIKE 'Cerid Guven%' OR e.name ILIKE 'Cerid Telecom%' OR e.name ILIKE 'Belir Mining%' OR e.entity_id IN ('E5133','E5145') OR (t.root='E5105' AND e.country='VD');
```
```sql
WITH RECURSIVE t AS (SELECT entity_id, entity_id root FROM entities WHERE coalesce(parent_id,'')='' UNION ALL SELECT e.entity_id, t.root FROM entities e JOIN t ON e.parent_id=t.entity_id)
SELECT i.instrument_id, i.issuer_id, ti.root iroot, i.guarantor_id, tg.root groot FROM instruments i JOIN t ti ON ti.entity_id=i.issuer_id JOIN t tg ON tg.entity_id=i.guarantor_id WHERE ti.root<>tg.root;
```
```sql
WITH RECURSIVE t AS (SELECT entity_id, entity_id root FROM entities WHERE coalesce(parent_id,'')='' UNION ALL SELECT e.entity_id, t.root FROM entities e JOIN t ON e.parent_id=t.entity_id),
r AS (SELECT *, row_number() OVER (PARTITION BY rated_id, ccy_basis ORDER BY date DESC, action_id DESC) rn FROM rating_actions WHERE date<='2026-10-01' AND rating_type='LTIDR'),
c AS (SELECT * FROM r WHERE rn=1 AND action<>'WD')
SELECT 'vesol' k, string_agg(t.entity_id||':'||c.rating, ',') v FROM t JOIN c ON c.rated_id=t.entity_id AND c.ccy_basis='FC' WHERE t.root='E5132'
UNION ALL SELECT 'cerid_sub_ig', string_agg(t.entity_id||':'||c.rating, ',') FROM t JOIN c ON c.rated_id=t.entity_id AND c.ccy_basis='FC' WHERE t.root='E5001' AND c.rating NOT IN ('AAA','AA+','AA','AA-','A+','A','A-','BBB+','BBB','BBB-')
UNION ALL SELECT 'q55', count(DISTINCT c.rated_id)::VARCHAR FROM c JOIN t ON t.entity_id=c.rated_id WHERE EXISTS (WITH RECURSIVE up AS (SELECT parent_id p FROM entities WHERE entity_id=c.rated_id UNION ALL SELECT e.parent_id FROM entities e JOIN up ON e.entity_id=up.p WHERE coalesce(e.parent_id,'')<>'') SELECT 1 FROM up JOIN entities a ON a.entity_id=up.p WHERE a.country='VD')
UNION ALL SELECT 'emptylei', count(*)::VARCHAR FROM entities WHERE coalesce(lei,'')='';
```Query results
Query 1:
| entity_id | name | country | root | lvl | path |
|---|---|---|---|---|---|
| E5145 | Geren Group SA | VD | E5145 | 0 | E5145 |
| E5011 | Cerid Guven Energy SA | VD | E5167 | 1 | E5167>E5011 |
| E5133 | Vesol Foods plc | GB | E5132 | 1 | E5132>E5133 |
| E5168 | BELIR MINING SA | FR | E5086 | 1 | E5086>E5168 |
| E5062 | Belir Mining SA | FR | E5059 | 2 | E5059>E5060>E5062 |
| E5013 | Cerid Telecom SA | ES | E5001 | 3 | E5001>E5002>E5006>E5013 |
| E5047 | Cerid Rosor Holdings SA | VD | E5167 | 4 | E5167>E5011>E5023>E5035>E5047 |
| E5124 | Wonod Kinon Holdings SA | VD | E5105 | 4 | E5105>E5107>E5112>E5118>E5124 |
| E5130 | Wonod Huror Retail SA | VD | E5105 | 5 | E5105>E5107>E5112>E5118>E5124>E5130 |
Query 2:
| instrument_id | issuer_id | iroot | guarantor_id | groot |
|---|---|---|---|---|
| I5007 | E5133 | E5132 | E5145 | E5145 |
Query 3:
| k | v |
|---|---|
| vesol | E5132:BB+,E5133:BBB-,E5136:BBB-,E5140:A+,E5141:BB,E5143:A,E5144:BB- |
| cerid_sub_ig | E5170:B-,E5007:B,E5010:BB-,E5012:BB,E5013:B-,E5016:BB,E5021:B,E5022:BB-,E5024:B-,E5025:BB,E5028:B-,E5029:BB+,E5030:B,E5037:B+,E5039:BB-,E5041:B-,E5042:BB,E5048:B- |
| q55 | 23 |
| emptylei | 2 |
Query 4:
| 1 |
|---|
| 1 |
Run more queries, or give the final answers.The model
<invoke name="sql">
SELECT 1;
</invoke>
```sql
WITH RECURSIVE can AS (
SELECT entity_id, first_value(entity_id) OVER (PARTITION BY lei ORDER BY (source_system<>'RATINGS'), entity_id) cid FROM entities WHERE coalesce(lei,'')<>''
UNION ALL SELECT entity_id, entity_id FROM entities WHERE coalesce(lei,'')=''),
nodes AS (SELECT e.entity_id, cp.cid pid FROM entities e JOIN can c ON c.entity_id=e.entity_id AND c.cid=e.entity_id LEFT JOIN can cp ON cp.entity_id=e.parent_id AND e.parent_id<>''),
t AS (SELECT entity_id, entity_id root, 0 lvl, entity_id path FROM nodes WHERE pid IS NULL UNION ALL SELECT n.entity_id, t.root, t.lvl+1, t.path||'>'||n.entity_id FROM nodes n JOIN t ON n.pid=t.entity_id),
r AS (SELECT can.cid rid, ra.*, row_number() OVER (PARTITION BY can.cid, ra.ccy_basis ORDER BY date DESC, action_id DESC) rn FROM rating_actions ra JOIN can ON can.entity_id=ra.rated_id WHERE rating_type='LTIDR' AND date<='2026-11-04'),
cur AS (SELECT * FROM r WHERE rn=1 AND action<>'WD')
SELECT 'cnt:'||root k, count(*)||' l3='||count(*) FILTER (WHERE lvl=3) v FROM t WHERE root IN ('E5001','E5086','E5105','E5059','E5132') GROUP BY root
UNION ALL SELECT 'path:'||entity_id, path FROM t WHERE entity_id IN ('E5047','E5011','E5013','E5062','E5168','E5005')
UNION ALL SELECT 'wonodVD', string_agg(t.entity_id,',') FROM t JOIN entities e USING(entity_id) WHERE root='E5105' AND e.country='VD'
UNION ALL SELECT 'q55', count(DISTINCT cur.rid)::VARCHAR FROM cur JOIN t ON t.entity_id=cur.rid WHERE EXISTS (SELECT 1 FROM entities a WHERE a.country='VD' AND a.entity_id<>cur.rid AND '>'||t.path||'>' LIKE '%>'||a.entity_id||'>%')
UNION ALL SELECT 'q61', count(DISTINCT cur.rid)::VARCHAR FROM cur JOIN t ON t.entity_id=cur.rid WHERE t.root='E5001' AND cur.ccy_basis='FC' AND cur.rating NOT IN ('AAA','AA+','AA','AA-','A+','A','A-','BBB+','BBB','BBB-')
UNION ALL SELECT 'vesolmin', string_agg(t.entity_id||':'||cur.rating,',') FROM cur JOIN t ON t.entity_id=cur.rid WHERE t.root='E5132' AND cur.ccy_basis='FC';
```
```sql
WITH RECURSIVE can AS (
SELECT entity_id, first_value(entity_id) OVER (PARTITION BY lei ORDER BY (source_system<>'RATINGS'), entity_id) cid FROM entities WHERE coalesce(lei,'')<>''
UNION ALL SELECT entity_id, entity_id FROM entities WHERE coalesce(lei,'')=''),
r AS (SELECT *, row_number() OVER (PARTITION BY rated_id, ccy_basis ORDER BY date DESC, action_id DESC) rn FROM rating_actions WHERE rating_type='LTIDR' AND date<='2026-10-01'),
cur1 AS (SELECT DISTINCT can.cid FROM r JOIN can ON can.entity_id=r.rated_id WHERE rn=1 AND action<>'WD'),
ever AS (SELECT DISTINCT can.cid FROM r JOIN can ON can.entity_id=r.rated_id WHERE action<>'WD'),
i AS (SELECT *, row_number() OVER (PARTITION BY rated_id ORDER BY date DESC, action_id DESC) rn FROM rating_actions WHERE rating_type='INST' AND date<='2026-10-01'),
sc AS (SELECT ['AAA','AA+','AA','AA-','A+','A','A-','BBB+','BBB','BBB-','BB+','BB','BB-','B+','B','B-','CCC+','CCC','CCC-','CC','C','RD','D'] s)
SELECT 'q21' k, string_agg(cid,',') v FROM ever WHERE cid NOT IN (SELECT cid FROM cur1)
UNION ALL SELECT 'q48', count(*)::VARCHAR FROM i WHERE rn=1 AND action<>'EX'
UNION ALL SELECT 'q25', count(*)::VARCHAR FROM i WHERE rn=1 AND action<>'EX' AND rating IN ('AAA','AA+','AA','AA-','A+','A','A-','BBB+','BBB','BBB-')
UNION ALL SELECT 'q30', string_agg(r.rated_id,',') FROM r JOIN entities e ON e.entity_id=r.rated_id, sc WHERE rn=1 AND action<>'WD' AND ccy_basis='FC' AND e.source_system='RATINGS' AND e.entity_type<>'SOV' AND ((e.country='CV' AND r.rating='A') OR (e.country='VD' AND r.rating='BB'))
UNION ALL SELECT 'q31', string_agg(r.rated_id||':'||r.rating,',') FROM r JOIN entities e ON e.entity_id=r.rated_id, sc WHERE rn=1 AND action<>'WD' AND ccy_basis='FC' AND e.entity_type<>'SOV' AND ((e.country='CV' AND list_position(sc.s,r.rating)<6) OR (e.country='VD' AND list_position(sc.s,r.rating)<12))
UNION ALL SELECT 'q37', count(DISTINCT coalesce(nullif(lei,''),entity_id))::VARCHAR FROM entities;
```Query results
Query 1:
| k | v |
|---|---|
| cnt:E5001 | 59 l3=12 |
| cnt:E5059 | 27 l3=4 |
| cnt:E5086 | 19 l3=6 |
| cnt:E5132 | 13 l3=4 |
| cnt:E5105 | 27 l3=6 |
| path:E5062 | E5059>E5060>E5062 |
| path:E5005 | E5001>E5002>E5005 |
| path:E5011 | E5001>E5002>E5005>E5011 |
| path:E5013 | E5001>E5002>E5006>E5013 |
| path:E5047 | E5001>E5002>E5005>E5011>E5023>E5035>E5047 |
| wonodVD | E5124,E5130 |
| q55 | 23 |
| q61 | 20 |
| vesolmin | E5132:BB+,E5133:BBB-,E5136:BBB-,E5140:A+,E5144:BB-,E5143:A,E5141:BB |
Query 2:
| k | v |
|---|---|
| q21 | E1200,E1233,E1225,E1234,E1048,E1084,E1244,E1316,E1205,E1121,E1076,E1218,E1166,E07,E1021,E1253,E1032,E1159,E1007,E1308,E1057,E1155,E1140,E1107,E1138,E1063,E1041,E1124,E1172,E1001,E1062,E1219,E1320,E1206,E1277 |
| q48 | 113 |
| q25 | 72 |
| q30 | E1028,E1194,E1039,E5012,E5091,E5116,E1101,E1126,E1236,E15,E05,E5047,E5124 |
| q31 | |
| q37 | 511 |
Query 3:
| 1 |
|---|
| 1 |
Run more queries, or give the final answers.The model
**Q1.** A-. E01's LTIDR was A- from A01 (2024-03-12), and the downgrade to BBB (A02) came only on 2025-06-20.
**Q2.** No. The only 2026 action on E01 is A03, an affirmation at BBB with the outlook moved to Negative.
**Q3.** No, it is BB+. The 2031 note is I02, and A07 cut it to BB+ on 2025-06-20.
**Q4.** Positive. E03 is the research-system duplicate of E02 (same LEI), and its latest action, A09 on 2025-09-15, affirmed A with a Positive outlook. That supersedes E02's Stable outlook from A08.
**Q5.** You take the credit risk of E02, Northwind Holdings, rated A. I03 was issued by E04 and guaranteed by E02, and I03 is rated A (A11).
**Q6.** The data does not state a reason. It only shows a Country Ceiling for Valdoria of BB (A12) and E05 at FC BB against LC BBB- (A13, A14), which is consistent with a ceiling effect.
**Q7.** 47 issuers had a 2026 LTIDR downgrade dated on or before today, 2026-11-04 (see the JSON). I excluded four downgrades dated after today (E1349, E1346, E5033, E1341), since they cannot have happened yet.
**Q8.** E08. A22 moved it to RD on 2026-07-08, and it has no later action.
**Q9.** 390. This counts distinct LEIs among entities with a current LTIDR, which merges duplicate records of the same legal entity.
**Q10.** Depends. E05 is BB in foreign currency (A14), which is sub-investment grade, and BBB- in local currency (A13), which is investment grade.
**Q11.** BBB+. A36 downgraded E14 on 2024-09-30.
**Q12.** A-. E14 held A- from A34 (2023-01-15) until the downgrade.
**Q13.** 1. The only downgrade is A36, since A35 is a watch placement and A33 an affirmation.
**Q14.** None. E12's first rating, A30, is dated 2024-02-01.
**Q15.** A-. E10 was A- from A26 until the downgrade on 2026-04-15.
**Q16.** No. E14 was BBB+ on 2025-01-01 and is still BBB+ after A33.
**Q17.** No. E06's only 2026 action, A17, is a Rating Watch Negative placement at A-, not a downgrade.
**Q18.** 30 issuers were on RWN on 2026-10-01 (see the JSON). I mapped the research duplicate E1210 to E1209.
**Q19.** 57 issuers had a Negative outlook and were not on watch on 2026-10-01. I mapped the research duplicates E1262, E1060 and E1161 to E1261, E1059 and E1160.
**Q20.** No. A19 withdrew E07's rating for commercial reasons, and no default rating was ever assigned.
**Q21.** 35 entities (see the JSON). They had a rating that was later withdrawn, with no later rating before 2026-10-01.
**Q22.** E08 only. It is the only entity ever rated RD or D (A22).
**Q23.** F2 (A04).
**Q24.** Yes. BBB is investment grade.
**Q25.** 72. This counts instruments whose latest INST rating on 2026-10-01 was investment grade and not an expiry (EX).
**Q26.** A+ (A40).
**Q27.** A- (A42).
**Q28.** BBB+ (A38).
**Q29.** None. VD only has a Country Ceiling (A12, BB), not an issuer rating.
**Q30.** 13 entities have a foreign-currency issuer rating exactly at their country's ceiling. The ceilings are CV A and VD BB. Examples are E15 (CV, A) and E05 (VD, BB).
**Q31.** No. No company's FC rating is above its country's ceiling on 2026-10-01.
**Q32.** E09. E11's parent is E10, whose parent is E09.
**Q33.** You take the credit risk of E10, Halden Bank, the guarantor of I05. It is rated BBB+ (A29 for the note, A27 for E10).
**Q34.** No. E12 has no parent and is separate from the E09/E10 group.
**Q35.** 3: E09, E10 and E11.
**Q36.** 2: E02 and E04. E03 is a duplicate of E02.
**Q37.** 511. The 540 rows collapse to 509 distinct LEIs plus 2 sovereigns with no LEI.
**Q38.** No. They have different LEIs (E06 549300AMVE3VRVG7HK43, E13 815600O8X8K2F154N214).
**Q39.** A, by the same logic as Q4 (E02 A08, E03 A09).
**Q40.** 87 distinct GB-domiciled issuers, counted by LEI.
**Q41.** BB+ (A44, 2026-06-01).
**Q42.** DE. E10, the RATINGS record, says DE, while the research duplicate E17 says LU.
**Q43.** 0. The only LU row is E17, a research duplicate of E10, which is domiciled in DE. If E17 is taken at face value, the count is 1.
**Q44.** Yes. I07 is denominated in XVD, apparently Valdoria's currency.
**Q45.** No. The ceiling caps foreign-currency ratings, and I07 is a local-currency note rated BBB- (A45).
**Q46.** No. E11 has only a credit opinion (A46, BBB), not an issuer rating.
**Q47.** None. A47 shows the rating on I08 as expired (EX) on 2026-09-01.
**Q48.** 113.
**Q49.** E5001. E5047's chain is E5001 > E5002 > E5005 > E5011 > E5023 > E5035 > E5047, with E5167 being a duplicate of E5005.
**Q50.** 6.
**Q51.** 59, with duplicate records merged by LEI.
**Q52.** 19. E5168 is a research duplicate of Belir Mining and is merged out.
**Q53.** No. The authoritative record E5062 sits in the Belir group, and only the duplicate E5168 shows a Rotam parent.
**Q54.** E5124 and E5130.
**Q55.** 23.
**Q56.** BB-, held by E5144.
**Q57.** E5002. Both chains run E5001 > E5002, then split via E5005 and E5006.
**Q58.** E5145. It guarantees I5007, which was issued by E5133 in the Vesol group.
**Q59.** 12.
**Q60.** You take the credit risk of E5145, the guarantor of I5007, and it is not in the same group as the issuer E5133 (Vesol Group).
**Q61.** 20.
```json
{"Q1":{"rating":"A-"},"Q2":{"downgraded":"no"},"Q3":{"investment_grade":"no","rating":"BB+"},"Q4":{"outlook":"POS"},"Q5":{"risk_of":"E02","rating":"A"},
"Q7":{"issuers":["E1186","E1243","E1255","E08","E1151","E1299","E1307","E1213","E1080","E5156","E1285","E1112","E1263","E1064","E1347","E1344","E1348","E5019","E1163","E1053","E1051","E1300","E10","E1034","E1229","E5116","E5059","E16","E1144","E1159","E5113","E1057","E1340","E1228","E1294","E1058","E1342","E1093","E1161","E1343","E1170","E5097","E1290","E1350","E1167","E1345","E1351"]},
"Q8":{"entities":["E08"]},"Q9":{"count":390},"Q10":{"investment_grade":"depends"},"Q11":{"rating":"BBB+"},"Q12":{"rating":"A-"},"Q13":{"count":1},"Q14":{"rating":"none"},"Q15":{"rating":"A-"},"Q16":{"changed":"no"},"Q17":{"downgraded":"no"},
"Q18":{"issuers":["E1099","E1260","E1132","E1264","E1006","E1039","E1266","E1317","E1037","E1242","E1267","E1297","E1061","E1238","E1013","E1066","E1314","E1203","E1146","E1323","E1133","E06","E1088","E1194","E1126","E1098","E1209","E1181","E1109","E1168"]},
"Q19":{"issuers":["E5141","E5119","E1294","E1055","E1350","E1344","E1105","E1158","E1190","E5039","E1072","E5156","E1347","E1271","E1079","E5116","E1080","E1005","E1211","E1261","E5019","E5113","E5131","E1059","E09","E1348","E1046","E5059","E1160","E1351","E5020","E1029","E1342","E5170","E1248","E5057","E1034","E1188","E5102","E5097","E1300","E1263","E5073","E5050","E1228","E1345","E5099","E5023","E1056","E5062","E1340","E5013","E1282","E1064","E1118","E1343","E01"]},
"Q20":{"in_default":"no"},
"Q21":{"entities":["E1200","E1233","E1225","E1234","E1048","E1084","E1244","E1316","E1205","E1121","E1076","E1218","E1166","E07","E1021","E1253","E1032","E1159","E1007","E1308","E1057","E1155","E1140","E1107","E1138","E1063","E1041","E1124","E1172","E1001","E1062","E1219","E1320","E1206","E1277"]},
"Q22":{"entities":["E08"]},"Q23":{"rating":"F2"},"Q24":{"investment_grade":"yes"},"Q25":{"count":72},"Q26":{"rating":"A+"},"Q27":{"rating":"A-"},"Q28":{"rating":"BBB+"},"Q29":{"rating":"none"},
"Q30":{"entities":["E1028","E1194","E1039","E5012","E5091","E5116","E1101","E1126","E1236","E15","E05","E5047","E5124"]},
"Q31":{"any":"no"},"Q32":{"parent":"E09"},"Q33":{"risk_of":"E10","rating":"BBB+"},"Q34":{"same_group":"no"},"Q35":{"count":3},"Q36":{"count":2},"Q37":{"count":511},"Q38":{"same":"no"},"Q39":{"rating":"A"},"Q40":{"count":87},"Q41":{"rating":"BB+"},"Q42":{"country":"DE"},"Q43":{"count":0},"Q44":{"local_currency":"yes"},"Q45":{"above_ceiling":"no"},"Q46":{"issuer_rating":"no"},"Q47":{"rating":"none"},"Q48":{"count":113},"Q49":{"parent":"E5001"},"Q50":{"count":6},"Q51":{"count":59},"Q52":{"count":19},"Q53":{"same_group":"no"},"Q54":{"entities":["E5124","E5130"]},"Q55":{"count":23},"Q56":{"rating":"BB-"},"Q57":{"entity":"E5002"},"Q58":{"entities":["E5145"]},"Q59":{"count":12},"Q60":{"risk_of":"E5145","same_group":"no"},"Q61":{"count":20}}
```