D2 sql+markdown, run 4: the query session
27 queries2 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
### ontology.md (the vocabulary the data uses)
# Credit ratings: a teaching ontology
Entities, instruments, rating actions and the codes the data uses, each with a definition that states what it means and how to read it. Invented for an experiment; not a model of any real rating agency.
## Classes
### Entity
A legal entity: a company, bank, finance subsidiary or sovereign. An entity is identified by its LEI (LEI), not by its name or record ID. The data holds records from more than one source system (source system), so the same entity can appear as several records with different IDs and differently spelled names: two records with the same LEI are the same entity, and every fact recorded against either record is a fact about that one entity.
### Instrument
A debt instrument, such as a bond or note, issued by an entity (issuer). An instrument's rating is not the issuer's rating: it can sit above or below it depending on seniority (seniority) and on any guarantee (guarantor).
### Rating action
Something a rating agency did to a rating on a date (date): assigned, affirmed, upgraded, downgraded, placed on Watch or withdrawn it. Each action applies to one rated thing (rated thing), one rating type (rating type) and, for issuer ratings, one currency basis (currency basis). A rating holds from its action date until the next action on the same thing, type and basis: so the rating on a date D is the one set by the latest action on or before D, and the current rating is the latest action overall. rating always holds the rating as it stands after the action, including when it did not change.
## Properties
### name (CSV column `name`)
The name as the source system spells it. Names are not identifiers: the same entity can be spelled differently in different systems.
### LEI (CSV column `lei`)
Legal Entity Identifier: the identifier that says which legal entity a record describes. Same LEI, same entity. Sovereigns have none.
### country (CSV column `country`)
ISO-style code of the country where the entity is domiciled. Where an entity's records disagree, see source system for which holds. It decides which Country Ceiling, if any, applies to the entity's foreign-currency ratings. VD is the Republic of Valdoria and CV the Republic of Corvenia (both invented).
### entity type (CSV column `entity_type`)
What kind of entity it is: a concept of the scheme Entity types.
### parent (CSV column `parent_id`)
The entity that owns and controls this one. A parent link names a record, but points at the entity that record describes, so the chain continues from any of that entity's records. Following parents up to an entity with no parent gives the ultimate parent; a group is an ultimate parent and every entity whose chain of parents ends at it.
### source system (CSV column `source_system`)
The internal system the record comes from (RATINGS, RESEARCH, QA). Each system keeps its own records of the same entities; see Entity. Where records of the same entity disagree, which one holds depends on the field. RATINGS is the system of record for names and parent links. Domicile is the exception: the RESEARCH team checks each entity's registered office against its filings, so where records disagree on country, the RESEARCH record holds. QA records are test data, created to check the systems: they describe no real entity, so a QA record, and every action recorded against it, must be ignored.
### description (CSV column `description`)
The instrument's name: issuer, coupon and maturity year.
### issuer (CSV column `issuer_id`)
The entity that issued the instrument and owes the payments. Not necessarily the entity whose credit risk the investor takes: see guarantor.
### guarantor (CSV column `guarantor_id`)
An entity that guarantees the instrument's payments if the issuer does not pay. A guaranteed instrument carries the guarantor's credit risk, so it is rated in line with the guarantor's issuer rating, not the issuer's.
### seniority (CSV column `seniority`)
Where the instrument ranks in repayment if the issuer fails: a concept of the scheme Seniorities.
### currency (CSV column `currency`)
The currency the instrument pays in, as an ISO 4217 code, or one of two local codes: XVD, the Valdorian dollar, the domestic currency of VD; and CVK, the Corvenian krone, the domestic currency of CV. Debt in a currency other than the domestic one of the issuer's country is exposed to that country's transfer and convertibility risk: see Country Ceiling (CC). Debt in the domestic currency is local-currency debt and is not capped by the ceiling.
### maturity (CSV column `maturity`)
The date the instrument is due to be repaid.
### date (CSV column `date`)
The date the action took effect.
### rated thing (CSV column `rated_id`)
What the action is about: an entity (for issuer ratings and Country Ceilings) or an instrument (for instrument ratings).
### rating type (CSV column `rating_type`)
Which kind of rating the action concerns: a concept of the scheme Rating types. Different types are different ratings and are never compared or combined with each other.
### currency basis (CSV column `ccy_basis`)
For issuer ratings, whether the rating covers foreign-currency (FC) or local-currency (LC) obligations: a concept of the scheme Currency bases. An entity can have both, with different values.
### action (CSV column `action`)
What was done: a concept of the scheme Action types. Only upgrades and downgrades change a rating.
### rating (CSV column `rating`)
The rating after the action, on the scale of its rating type. Long-term scale, strongest to weakest: AAA, AA+, AA, AA-, A+, A, A-, BBB+, BBB, BBB-, BB+, BB, BB-, B+, B, B-, CCC, CC, C, RD, D. Investment grade means BBB- or higher; BB+ and below is speculative grade (high yield). RD (restricted default) means the issuer has defaulted on some material obligations, for instance by completing a distressed debt exchange, without being wound up: RD is a default. D means a general default. Short-term scale, strongest to weakest: F1+, F1, F2, F3, B, C, RD, D. WD means the rating was withdrawn (see Withdrawn (WD)): it is not a point on either scale.
### outlook (CSV column `outlook`)
The likely direction of a long-term rating over the next one to two years: a concept of the scheme Outlooks. An outlook is not a rating: revising it does not change the rating.
### rating watch (CSV column `watch`)
Set when the rating is on Rating Watch: a concept of the scheme Rating Watches. A Watch is not a rating change.
### comment (CSV column `comment`)
The analyst's note on the action, such as the reason for a withdrawal.
## Codes
The codes as they appear in the data, grouped by list.
### Rating types
- **LTIDR**, Long-term Issuer Default Rating: The issuer's own creditworthiness: how likely it is to default on its obligations, on the long-term scale. This is what people usually mean by an entity's rating. The foreign-currency (FC) one is the headline rating; there may also be a local-currency (LC) one.
- **STIDR**, Short-term Issuer Default Rating: The issuer's ability to meet obligations falling due within about a year, on the short-term scale (F1+ to D). Not comparable with long-term ratings.
- **INST**, Instrument rating: The rating of one specific instrument. It starts from the issuer's long-term rating and is notched for the instrument's seniority and expected recovery: subordinated debt is usually rated below the issuer, and guaranteed debt is rated on the guarantor. An instrument rating is never the rating of the issuer.
- **CC**, Country Ceiling: Not a rating of anyone. A cap, set for a country, on the foreign-currency ratings of entities domiciled there and of their foreign-currency debt. It reflects transfer and convertibility risk: the risk that the government stops money being converted or sent abroad, so even a sound company could not pay foreign-currency debt. Foreign-currency ratings of entities in the country are generally no higher than the ceiling; local-currency ratings are not capped. A Country Ceiling is not the sovereign's own issuer rating.
- **CO**, Credit opinion: A private, point-in-time view of an entity's credit, given to one client. It is not a published rating and not an issuer rating: never count it as a rating, and never report its value as the entity's rating.
### Currency bases
- **FC**, Foreign currency: Covers obligations in foreign currency, so it is subject to the Country Ceiling.
- **LC**, Local currency: Covers obligations in the currency of the entity's own country; not subject to the Country Ceiling.
### Action types
- **AS**, Assigned: A first rating is given.
- **AF**, Affirmed: The rating is reviewed and kept the same. The outlook may be revised in the same action; that does not make it an upgrade or a downgrade.
- **UG**, Upgraded: The rating is raised.
- **DG**, Downgraded: The rating is lowered. The only action that counts as a downgrade.
- **RW**, Placed on Rating Watch: The rating is flagged as likely to change soon, usually within about six months, in the direction rating watch gives. The rating itself is unchanged: not a downgrade.
- **WD**, Withdrawn: The agency stops maintaining the rating, often for commercial reasons (the issuer no longer pays for it, or the debt is repaid). After a withdrawal the entity has no rating of that type. A withdrawal is not a credit event: it says nothing about default, and is not a downgrade.
- **EX**, Expected rating: A rating signalled before an instrument's final documents are signed. It is not yet a rating: the instrument stays unrated until an Assigned (AS) action confirms it.
### Outlooks
- **STA**, Stable: No direction expected.
- **POS**, Positive: The rating may go up over one to two years.
- **NEG**, Negative: The rating may go down over one to two years. Not a downgrade.
### Rating Watches
- **RWN**, Rating Watch Negative: A downgrade is likely in the near term. Not a downgrade yet.
### Seniorities
- **SU**, Senior unsecured: Ranks with the issuer's ordinary debts; usually rated at the level of the issuer's long-term rating.
- **SUB**, Subordinated: Repaid only after senior debt, so investors recover less in a default; usually rated one or more notches below the issuer's long-term rating.
### Entity types
- **CORP**, Corporate: A non-financial company.
- **BANK**, Bank: A bank.
- **FINSUB**, Finance subsidiary: A subsidiary that exists to raise debt for its parent group. It usually has no issuer rating of its own; its debt is guaranteed by the parent, so investors take the parent's credit risk.
- **SOV**, Sovereign: A national government. A sovereign record can carry a Country Ceiling, issuer ratings, or both: they are different things, and the ceiling is not the sovereign's rating.
## 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 entities and instruments.
```sql
SELECT * FROM entities ORDER BY name LIMIT 600;
```
```sql
SELECT * FROM instruments ORDER BY issuer_id;
```Query results
Query 1:
| entity_id | name | lei | country | entity_type | parent_id | source_system |
|---|---|---|---|---|---|---|
| E5168 | BELIR MINING SA | 54930011OTFCAUKB0A28 | FR | CORP | E5086 | RESEARCH |
| E1057 | Batan Foods plc | 2138009BPHEDKSZHFF68 | GB | BANK | | RATINGS |
| E1278 | Bavil Chemicals plc | 815600LDQIUCNNTOL286 | GB | CORP | | RATINGS |
| E1308 | Bavom Logistics AG | 549300IGMPC8HEIKND87 | DE | CORP | | RATINGS |
| E1292 | Bavon Industries plc | 549300RN36RWXRZPV988 | GB | CORP | E1061 | RATINGS |
| E5083 | Belir Airlines plc | 815600VWRV7PTZ2G2598 | GB | CORP | E5075 | RATINGS |
| E5082 | Belir Bovid Telecom plc | 815600N0YPG44MRFH213 | GB | BANK | E5074 | RATINGS |
| E5067 | Belir Capital AG | 724500PEM92TFIBH3E89 | DE | CORP | E5063 | RATINGS |
| E5071 | Belir Chemicals SA | 724500EPR0DH4ZXK1N07 | FR | CORP | E5066 | RATINGS |
| E5080 | Belir Foods AG | 815600W19TGJNKXFFO22 | DE | CORP | E5072 | RATINGS |
| E5075 | Belir Gitid Industries plc | 815600DW5IX6LC8W8V29 | GB | CORP | E5068 | RATINGS |
| E5059 | Belir Group AG | 969500YPO4CFVEL1XX12 | DE | CORP | | RATINGS |
| E5063 | Belir Harem Property AG | 391200DIHCC3BA4VZZ12 | DE | CORP | E5060 | RATINGS |
| E5064 | Belir Holdings plc | 724500Q0JKSMWBXVBU93 | GB | CORP | E5061 | RATINGS |
| E5074 | Belir Industries plc | 549300KXQ2S560AVV453 | GB | CORP | E5068 | RATINGS |
| E5072 | Belir Katin Telecom AG | 815600R2EBVJ16RD3A20 | DE | CORP | E5067 | RATINGS |
| E5068 | Belir Kator Energy plc | 969500LH6R0LMYUZA394 | GB | CORP | E5064 | RATINGS |
| E5084 | Belir Luton Media SA | 815600NALYO1JPB0Y303 | FR | BANK | E5076 | RATINGS |
| E5077 | Belir Media SA | 213800PX54IYKA21SV31 | FR | CORP | E5069 | RATINGS |
| E5062 | Belir Mining SA | 54930011OTFCAUKB0A28 | FR | CORP | E5060 | RATINGS |
| E5065 | Belir Nelad Property AG | 549300L03V06VLA93J12 | DE | CORP | E5061 | RATINGS |
| E5076 | Belir Property SA | 96950092K7EM4MPGLP04 | FR | CORP | E5069 | RATINGS |
| E5073 | Belir Puvir Mining plc | 549300Z4E2ZBV3ZWA751 | GB | CORP | E5067 | RATINGS |
| E5060 | Belir Retail AG | 549300PQXT9OXKZVXP03 | DE | CORP | E5059 | RATINGS |
| E5070 | Belir Rusin Media SA | 8156004IQIH39FK9VH78 | FR | CORP | E5066 | RATINGS |
| E5085 | Belir Rutel Water SA | 213800K6R3NB1ZT7Y709 | CV | CORP | E5077 | RATINGS |
| E5066 | Belir Shipping SA | 2138006F3FLNO4C1FU85 | FR | CORP | E5062 | RATINGS |
| E5079 | Belir Sitom Logistics SA | 213800N76YAEEVTGC136 | FR | CORP | E5071 | RATINGS |
| E5061 | Belir Steel Inc | 5493004QWM1AN9Q59M90 | US | BANK | E5059 | RATINGS |
| E5078 | Belir Vasin Water plc | 969500OGDTR8B14SH139 | GB | BANK | E5070 | RATINGS |
| E5081 | Belir Vusad Telecom SA | 549300C58DC34KK7FK00 | VD | CORP | E5073 | RATINGS |
| E5069 | Belir Water SA | 391200PZ4I0VQJK2W457 | FR | CORP | E5065 | RATINGS |
| E1335 | Belor Telecom Finance plc | 9695001Q1J0GREF1Y798 | NL | FINSUB | E1234 | RATINGS |
| E1234 | Belor Telecom SpA | 815600HZK0IK4Q5GF769 | IT | CORP | | RATINGS |
| E1159 | Benem Property AG | 213800VMJXKPLM9ZIL74 | DE | BANK | | RATINGS |
| E1105 | Betin Pharma SA | 3912002RB0IGZZN6RN49 | GR | CORP | | RATINGS |
| E1288 | Binod Foods AG | 213800QEX3DTCPW3E621 | DE | BANK | | RATINGS |
| E1340 | Biram Steel plc | 213800CSTQH7UO0A8E29 | GB | CORP | | QA |
| E1351 | Bisad Property plc | 969500MERFFSB2CHQE09 | GB | CORP | | QA |
| E1322 | Bivid Mining SA | 7245003MRSQ8C823Z590 | FR | CORP | | RATINGS |
| E1343 | Bolem Energy plc | 969500F1DAQZF8FNJS41 | GB | CORP | | QA |
| E1191 | Boler Steel SA | 815600G5CMC2QEQUCG23 | FR | CORP | E1177 | RATINGS |
| E1135 | Bosar Retail plc | 549300C138N2A3615Y70 | GB | BANK | | RATINGS |
| E1242 | Botin Logistics SpA | 213800VNDQV0VN6FVU72 | IT | BANK | | RATINGS |
| E16 | Brindle Capital Ltd | 5493003Z3PXXR7KNFM81 | GB | CORP | | QA |
| E1010 | Buvir Industries Inc | 3912004R2GZJL49URX69 | US | CORP | | RATINGS |
| E5167 | CERID CHEMICALS SA | 391200B1GR4AGTV5WY99 | VD | CORP | | RESEARCH |
| E1180 | COTAN FOODS SA | 391200USHZVHBK9FHP01 | IT | CORP | | RESEARCH |
| E1112 | Calem Logistics Inc | 969500QJ1AV6AZJSB088 | US | CORP | | RATINGS |
| E1305 | Cenin Media SA | 724500OHVHFTDDP42261 | FR | CORP | | RATINGS |
| E5008 | Cerid Airlines BV | 815600M8RE9386DDQB31 | NL | CORP | E5003 | RATINGS |
| E5051 | Cerid Butad Capital SA | 969500P4S8FH9839YS39 | FR | CORP | E5039 | RATINGS |
| E5019 | Cerid Buvom Mining plc | 2138002W9KTVILKQ8Q89 | GB | CORP | E5009 | RATINGS |
| E5036 | Cerid Calin Energy SpA | 549300RJ7KMPDJVQY167 | IT | CORP | E5024 | RATINGS |
| E5056 | Cerid Capital plc | 391200Q0XXMZJQSOR362 | GB | CORP | E5044 | RATINGS |
| E5005 | Cerid Chemicals SA | 391200B1GR4AGTV5WY99 | VD | CORP | E5002 | RATINGS |
| E5058 | Cerid Cirad Industries BV | 391200XLOZO7S6T1FI61 | NL | BANK | E5046 | RATINGS |
| E5045 | Cerid Curel Water SA | 7245006QVOPQQK3JUP45 | CV | CORP | E5033 | RATINGS |
| E5023 | Cerid Dilal Utilities SA | 549300MXQ7UU7852PG70 | VD | CORP | E5011 | RATINGS |
| E5041 | Cerid Dolem Mining AG | 391200FXD4CH3FVZ4165 | DE | BANK | E5029 | RATINGS |
(480 more rows not shown)
Query 2:
| instrument_id | description | issuer_id | guarantor_id | seniority | currency | maturity |
|---|---|---|---|---|---|---|
| I02 | Kestrel Energy 6.25% notes due 2031 | E01 | | SUB | GBP | 2031-09-30 |
| I01 | Kestrel Energy 4.50% notes due 2030 | E01 | | SU | GBP | 2030-03-15 |
| 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 |
| I07 | Valdoria Telecom 4.25% notes due 2027 | E05 | | SU | XVD | 2027-08-31 |
| 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 |
| I05 | Halden Leasing 2.90% notes due 2028 | E11 | E10 | SU | EUR | 2028-06-30 |
| I1033 | Vavam Pharma 8.75% notes due 2032 | E1103 | | SUB | USD | 2032-06-30 |
| I1034 | Kisil Logistics 8.50% notes due 2031 | E1108 | | SU | EUR | 2033-06-30 |
| I1035 | Verod Logistics 3.00% notes due 2035 | E1114 | | SU | GBP | 2029-06-30 |
| I1036 | Piren Foods 2.50% notes due 2030 | E1115 | | SU | USD | 2033-06-30 |
| I1037 | Reter Shipping 8.00% notes due 2028 | E1118 | | SU | EUR | 2027-06-30 |
| I1038 | Conan Capital 4.75% notes due 2033 | E1131 | | SU | EUR | 2031-06-30 |
| I1039 | Larid Steel 8.50% notes due 2028 | E1141 | | SU | GBP | 2033-06-30 |
| I1040 | Woner Media 5.75% notes due 2027 | E1143 | | SUB | EUR | 2027-06-30 |
| I1041 | Kanim Pharma 3.25% notes due 2033 | E1145 | | SUB | EUR | 2036-06-30 |
| I1042 | Daren Mining 5.75% notes due 2030 | E1147 | | SU | EUR | 2035-06-30 |
| I1043 | Honel Shipping 4.50% notes due 2028 | E1149 | | SUB | EUR | 2029-06-30 |
| I1044 | Wavad Foods 6.75% notes due 2035 | E1155 | | SU | USD | 2036-06-30 |
| I1045 | Ruven Airlines 5.75% notes due 2032 | E1156 | | SUB | EUR | 2036-06-30 |
| I1046 | Diled Steel 8.75% notes due 2027 | E1160 | | SU | EUR | 2029-06-30 |
| I1047 | Wunam Telecom 5.25% notes due 2032 | E1162 | | SU | EUR | 2029-06-30 |
| I1048 | Wenar Water 8.25% notes due 2028 | E1163 | | SUB | EUR | 2028-06-30 |
| I1049 | Ranim Shipping 8.00% notes due 2028 | E1166 | | SUB | USD | 2036-06-30 |
| I1050 | Fivan Holdings 2.25% notes due 2035 | E1168 | | SU | EUR | 2027-06-30 |
| I1051 | Molar Shipping 3.25% notes due 2031 | E1188 | | SU | EUR | 2028-06-30 |
| I1052 | Divid Property 4.25% notes due 2033 | E1189 | | SUB | GBP | 2032-06-30 |
| I1053 | Piran Logistics 7.25% notes due 2034 | E1190 | | SU | EUR | 2028-06-30 |
| I1054 | Lenam Industries 2.50% notes due 2036 | E1195 | | SU | GBP | 2030-06-30 |
(62 more rows not shown)
Run more queries, or give the final answers.The model
I'll look at the core named entities and their rating actions first.
```sql
SELECT * FROM entities WHERE entity_id NOT SIMILAR TO 'E1[0-9]{3}' AND entity_id NOT SIMILAR TO 'E50[0-9]{2}' AND entity_id NOT SIMILAR TO 'E51[0-9]{2}' ORDER BY entity_id;
```
```sql
SELECT * FROM rating_actions WHERE rated_id IN ('E01','E02','E03','E04','E05','E06','E07','E08','E09','E10','E11','E12','E13','E14','E15','E16','E17','E18','E19','E20','I01','I02','I03','I04','I05','I07') ORDER BY rated_id, rating_type, ccy_basis, date;
```
```sql
SELECT * FROM instruments WHERE instrument_id NOT SIMILAR TO 'I1[0-9]{3}' ORDER BY instrument_id;
```Query results
Query 1:
| entity_id | name | lei | country | entity_type | parent_id | source_system |
|---|---|---|---|---|---|---|
| CV | Republic of Corvenia | | CV | SOV | | RATINGS |
| 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 |
| 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 |
| E15 | Corvenia Power SA | 213800PBQVHVBBH6GV02 | CV | CORP | | RATINGS |
| E16 | Brindle Capital Ltd | 5493003Z3PXXR7KNFM81 | GB | CORP | | QA |
| E17 | HALDEN BANK | 391200QYPVFF2O9K2039 | LU | BANK | | RESEARCH |
| VD | Republic of Valdoria | | VD | SOV | | RATINGS |
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 | | |
| A14 | 2025-04-01 | E05 | LTIDR | FC | AS | BB | STA | | |
| A13 | 2025-04-01 | E05 | LTIDR | LC | AS | BBB- | 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 |
| 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 | | |
| A32 | 2024-07-01 | E13 | LTIDR | FC | AS | BBB | 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 | | |
| A41 | 2024-03-01 | E15 | LTIDR | FC | AS | A | STA | | |
| A40 | 2024-03-01 | E15 | LTIDR | LC | AS | A+ | STA | | |
| A43 | 2024-04-01 | E16 | LTIDR | FC | AS | BBB- | STA | | |
| A44 | 2026-06-01 | E16 | LTIDR | FC | DG | BB+ | 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 | | | |
| A28 | 2023-06-01 | I05 | INST | | AS | A- | | | |
| A29 | 2026-04-15 | I05 | INST | | DG | BBB+ | | | |
| A45 | 2025-04-01 | I07 | INST | | AS | BBB- | | | |
Query 3:
| 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 |
| 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 |
Run more queries, or give the final answers.The model
```sql
SELECT lei, string_agg(entity_id||'|'||name||'|'||country||'|'||coalesce(parent_id,'')||'|'||source_system, ' ;; ') AS recs FROM entities WHERE lei<>'' GROUP BY lei HAVING count(*)>1 ORDER BY lei;
```
```sql
SELECT rating_type, ccy_basis, action, count(*) FROM rating_actions GROUP BY ALL ORDER BY ALL;
```
```sql
SELECT * FROM rating_actions WHERE rated_id IN ('CV','VD') OR rating_type='CC' ORDER BY rated_id, date;
```
```sql
SELECT * FROM rating_actions WHERE rated_id LIKE 'E5%' OR rated_id LIKE 'I5%' ORDER BY rated_id, rating_type, ccy_basis, date;
```Query results
Query 1:
| lei | recs |
|---|---|
| 213800PHEIYNJMHTDV74 | E02|Northwind Holdings plc|GB||RATINGS ;; E03|NORTHWIND HLDGS|GB||RESEARCH |
| 3912003R00FP6CNV6210 | E1001|Tunod Steel SA|FR||RATINGS ;; E1002|TUNOD STEEL SA|FR||RESEARCH |
| 391200B1GR4AGTV5WY99 | E5005|Cerid Chemicals SA|VD|E5002|RATINGS ;; E5167|CERID CHEMICALS SA|VD||RESEARCH |
| 391200E9TAHDZV7CY568 | E1147|Daren Mining SA|FR||RATINGS ;; E1148|DAREN MINING SA|FR||RESEARCH |
| 391200JN4T4KY2HCRU75 | E1116|Hener Energy plc|GB||RATINGS ;; E1117|HENER ENERGY|GB||RESEARCH |
| 391200KLG6G4KVIMIU52 | E1021|Niner Pharma plc|GB||RATINGS ;; E1022|NINER PHARMA|GB||RESEARCH |
| 391200QYPVFF2O9K2039 | E10|Halden Bank AG|DE|E09|RATINGS ;; E17|HALDEN BANK|LU||RESEARCH |
| 391200USHZVHBK9FHP01 | E1179|Cotan Foods SA|ES|E1162|RATINGS ;; E1180|COTAN FOODS SA|IT||RESEARCH |
| 54930011OTFCAUKB0A28 | E5062|Belir Mining SA|FR|E5060|RATINGS ;; E5168|BELIR MINING SA|FR|E5086|RESEARCH |
| 5493004IM0PRT8BSDK29 | E1238|Wevin Capital SA|GR||RATINGS ;; E1239|WEVIN CAPITAL SA|GR||RESEARCH |
| 549300A64I73OEIC4R87 | E1213|Winim Mining SA|FR||RATINGS ;; E1214|WINIM MINING SA|NL||RESEARCH |
| 549300CRXZL5I1OT6L14 | E1059|Kelim Media SA|CV|E1015|RATINGS ;; E1060|KELIM MEDIA SA|CV||RESEARCH |
| 549300E50JHDJNBUGF22 | E1152|Kivel Property plc|GB||RATINGS ;; E1153|KIVEL PROPERTY|GB||RESEARCH |
| 549300H1N0EQEAZLE362 | E1261|Munam Water SA|ES||RATINGS ;; E1262|MUNAM WATER SA|ES||RESEARCH |
| 549300HWTXXHJP2HKU38 | E1209|Malid Mining SpA|IT||RATINGS ;; E1210|MALID MINING SPA|DE||RESEARCH |
| 549300NTCTGRKRYIAN83 | E1096|Ravon Capital SA|CV||RATINGS ;; E1097|RAVON CAPITAL SA|CV||RESEARCH |
| 549300XV49ES64RGNQ00 | E1169|Seren Telecom plc|GB||RATINGS ;; E1170|SEREN TELECOM|GB||RESEARCH |
| 724500BSV4X2J7KUR535 | E1138|Konel Energy BV|NL||RATINGS ;; E1139|KONEL ENERGY BV|NL||RESEARCH |
| 724500UQKUINIUB80J18 | E1318|Sutem Water plc|GB||RATINGS ;; E1319|SUTEM WATER|GB||RESEARCH |
| 724500YEJSJ19G17TW94 | E1258|Nirad Retail SA|FR||RATINGS ;; E1259|NIRAD RETAIL SA|FR||RESEARCH |
| 8156008DPX4I9DNKWN26 | E1029|Leson Telecom Inc|US||RATINGS ;; E1030|LESON TELECOM INC|US||RESEARCH |
| 815600HDI8Y3IWGOOH22 | E1103|Vavam Pharma Inc|US||RATINGS ;; E1104|VAVAM PHARMA INC|US||RESEARCH |
| 815600LRX1P8142NMF42 | E1245|Gater Holdings SA|CV||RATINGS ;; E1246|GATER HOLDINGS SA|FR||RESEARCH |
| 815600RCZP0ISY44E024 | E1298|Faner Steel SA|ES||RATINGS ;; E1299|FANER STEEL SA|ES||RESEARCH |
| 9695000PSF2HLPO9AE57 | E1310|Natil Retail SpA|IT||RATINGS ;; E1311|NATIL RETAIL SPA|IT||RESEARCH |
| 969500KYKHRI6N2WRN19 | E1156|Ruven Airlines AG|DE||RATINGS ;; E1157|RUVEN AIRLINES|US||RESEARCH |
| 969500PM41NS2PBZU440 | E1160|Diled Steel SA|FR||RATINGS ;; E1161|DILED STEEL SA|FR||RESEARCH |
| 969500QXEZ0NSV6EIW69 | E1253|Vusir Telecom SA|ES||RATINGS ;; E1254|VUSIR TELECOM SA|ES||RESEARCH |
| 969500W1342GHBTOGH81 | E5106|Wonod Steel BV|NL|E5105|RATINGS ;; E5169|WONOD STEEL BV|VD||RESEARCH |
Query 2:
| rating_type | ccy_basis | action | count_star() |
|---|---|---|---|
| CC | | AS | 2 |
| CO | | AS | 7 |
| INST | | AF | 1 |
| INST | | AS | 113 |
| INST | | DG | 3 |
| INST | | EX | 9 |
| LTIDR | FC | AF | 81 |
| LTIDR | FC | AS | 426 |
| LTIDR | FC | DG | 108 |
| LTIDR | FC | RW | 45 |
| LTIDR | FC | UG | 45 |
| LTIDR | FC | WD | 39 |
| LTIDR | LC | AF | 4 |
| LTIDR | LC | AS | 19 |
| LTIDR | LC | DG | 4 |
| LTIDR | LC | RW | 3 |
| LTIDR | LC | UG | 3 |
| LTIDR | LC | WD | 1 |
| STIDR | FC | AF | 1 |
Query 3:
| 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 | | |
| A12 | 2025-04-01 | VD | CC | | AS | BB | | | |
Query 4:
| action_id | date | rated_id | rating_type | ccy_basis | action | rating | outlook | watch | comment |
|---|---|---|---|---|---|---|---|---|---|
| A5001 | 2025-10-16 | E5002 | LTIDR | FC | AS | A+ | STA | | |
| A5002 | 2023-11-03 | E5007 | LTIDR | FC | AS | B | STA | | |
| A5003 | 2023-04-15 | E5008 | LTIDR | FC | AS | BBB+ | STA | | |
| A5004 | 2023-06-05 | E5010 | LTIDR | FC | AS | BB- | STA | | |
| A5005 | 2022-03-08 | E5012 | LTIDR | FC | AS | BB | STA | | |
| A5006 | 2022-12-20 | E5013 | LTIDR | FC | AS | B- | STA | | |
| A5007 | 2024-06-01 | E5013 | LTIDR | FC | DG | B- | NEG | | |
| A5008 | 2023-01-14 | E5016 | LTIDR | FC | AS | BB | STA | | |
| A5009 | 2025-04-24 | E5017 | LTIDR | FC | AS | A- | STA | | |
| A5010 | 2024-10-14 | E5018 | LTIDR | FC | AS | A | STA | | |
| A5011 | 2024-07-07 | E5019 | LTIDR | FC | AS | A- | STA | | |
| A5012 | 2026-03-19 | E5019 | LTIDR | FC | DG | BBB+ | NEG | | |
| A5013 | 2022-12-14 | E5020 | LTIDR | FC | AS | A- | STA | | |
| A5014 | 2024-07-26 | E5020 | LTIDR | FC | DG | BBB+ | NEG | | |
| A5015 | 2022-08-10 | E5021 | LTIDR | FC | AS | B | STA | | |
| A5016 | 2023-06-22 | E5022 | LTIDR | FC | AS | BB- | STA | | |
| A5017 | 2024-03-11 | E5023 | LTIDR | FC | AS | B | STA | | |
| A5018 | 2025-06-20 | E5023 | LTIDR | FC | DG | B- | NEG | | |
| A5019 | 2024-05-10 | E5024 | LTIDR | FC | AS | B- | STA | | |
| A5020 | 2023-10-13 | E5025 | LTIDR | FC | AS | BB | STA | | |
| A5021 | 2025-05-21 | E5027 | LTIDR | FC | AS | BBB+ | STA | | |
| A5022 | 2023-04-10 | E5028 | LTIDR | FC | AS | B- | STA | | |
| A5023 | 2022-02-05 | E5029 | LTIDR | FC | AS | BB+ | STA | | |
| A5024 | 2022-09-13 | E5030 | LTIDR | FC | AS | B | STA | | |
| A5025 | 2022-09-11 | E5031 | LTIDR | FC | AS | A+ | STA | | |
| A5026 | 2025-12-04 | E5032 | LTIDR | FC | AS | BBB- | STA | | |
| A5027 | 2025-04-14 | E5033 | LTIDR | FC | AS | A+ | STA | | |
| A5028 | 2026-11-06 | E5033 | LTIDR | FC | DG | A | NEG | | |
| A5029 | 2023-06-09 | E5036 | LTIDR | FC | AS | A- | STA | | |
| A5030 | 2025-04-05 | E5037 | LTIDR | FC | AS | B+ | STA | | |
| A5031 | 2024-06-18 | E5039 | LTIDR | FC | AS | BB | STA | | |
| A5032 | 2025-04-08 | E5039 | LTIDR | FC | DG | BB- | NEG | | |
| A5033 | 2023-07-26 | E5041 | LTIDR | FC | AS | B- | STA | | |
| A5034 | 2024-12-19 | E5042 | LTIDR | FC | AS | BB | STA | | |
| A5035 | 2022-07-23 | E5047 | LTIDR | FC | AS | BB | STA | | |
| A5036 | 2022-10-09 | E5048 | LTIDR | FC | AS | B- | STA | | |
| A5037 | 2024-09-15 | E5049 | LTIDR | FC | AS | BBB- | STA | | |
| A5038 | 2024-08-26 | E5050 | LTIDR | FC | AS | A- | STA | | |
| A5039 | 2025-03-25 | E5050 | LTIDR | FC | DG | BBB+ | NEG | | |
| A5040 | 2023-11-18 | E5053 | LTIDR | FC | AS | BBB | STA | | |
| A5041 | 2024-01-25 | E5057 | LTIDR | FC | AS | A+ | STA | | |
| A5042 | 2025-10-04 | E5057 | LTIDR | FC | DG | A | NEG | | |
| A5044 | 2025-10-13 | E5059 | LTIDR | FC | AS | BBB- | STA | | |
| A5045 | 2026-05-25 | E5059 | LTIDR | FC | DG | BB+ | NEG | | |
| A5046 | 2022-09-10 | E5061 | LTIDR | FC | AS | BB | STA | | |
| A5047 | 2024-05-17 | E5062 | LTIDR | FC | AS | B | STA | | |
| A5048 | 2025-02-08 | E5062 | LTIDR | FC | DG | B- | NEG | | |
| A5049 | 2023-07-12 | E5066 | LTIDR | FC | AS | B | STA | | |
| A5050 | 2024-11-27 | E5067 | LTIDR | FC | AS | A- | STA | | |
| A5051 | 2024-03-01 | E5069 | LTIDR | FC | AS | BBB- | STA | | |
| A5052 | 2023-04-17 | E5070 | LTIDR | FC | AS | B+ | STA | | |
| A5053 | 2023-04-04 | E5071 | LTIDR | FC | AS | BB | STA | | |
| A5054 | 2024-01-09 | E5072 | LTIDR | FC | AS | BB | STA | | |
| A5055 | 2023-10-14 | E5073 | LTIDR | FC | AS | BBB | STA | | |
| A5056 | 2024-02-01 | E5073 | LTIDR | FC | DG | BBB- | NEG | | |
| A5057 | 2025-08-06 | E5075 | LTIDR | FC | AS | BBB+ | STA | | |
| A5058 | 2025-10-14 | E5076 | LTIDR | FC | AS | BBB+ | STA | | |
| A5059 | 2025-05-20 | E5082 | LTIDR | FC | AS | A- | STA | | |
| A5060 | 2025-08-09 | E5083 | LTIDR | FC | AS | A- | STA | | |
| A5061 | 2025-08-09 | E5084 | LTIDR | FC | AS | A+ | STA | | |
(67 more rows not shown)
Run more queries, or give the final answers.The model
<invoke name="sql">
SELECT 1;
</invoke>
```sql
CREATE OR REPLACE VIEW ent AS
SELECT e.entity_id, coalesce(nullif(e.lei,''), e.entity_id) AS k, e.source_system, e.country, e.parent_id, e.entity_type, e.name FROM entities e WHERE e.source_system<>'QA';
```
```sql
CREATE OR REPLACE VIEW act AS
SELECT a.*, e.k FROM rating_actions a JOIN ent e ON e.entity_id=a.rated_id WHERE a.rating_type IN ('LTIDR','STIDR','CC','CO');
```
```sql
CREATE OR REPLACE VIEW st AS
SELECT * FROM (SELECT *, row_number() OVER (PARTITION BY k,rating_type,coalesce(ccy_basis,'') ORDER BY date DESC, action_id DESC) rn FROM act WHERE date<='2026-10-01') WHERE rn=1;
```
```sql
SELECT 'default' q, string_agg(DISTINCT k,',') FROM st WHERE rating_type='LTIDR' AND rating IN ('RD','D')
UNION ALL SELECT 'everdefault', string_agg(DISTINCT k,',') FROM act WHERE rating_type='LTIDR' AND rating IN ('RD','D')
UNION ALL SELECT 'issuers_rated', count(DISTINCT k)::varchar FROM st WHERE rating_type='LTIDR' AND rating<>'WD'
UNION ALL SELECT 'rwn', string_agg(DISTINCT k,',') FROM st WHERE rating_type='LTIDR' AND watch='RWN' AND rating<>'WD'
UNION ALL SELECT 'neg', string_agg(DISTINCT k,',') FROM st WHERE rating_type='LTIDR' AND outlook='NEG' AND rating<>'WD'
UNION ALL SELECT 'lost', string_agg(DISTINCT k,',') FROM act WHERE rating_type='LTIDR' AND k NOT IN (SELECT k FROM st WHERE rating_type='LTIDR' AND rating<>'WD')
UNION ALL SELECT 'dg2026', string_agg(DISTINCT k,',') FROM act WHERE rating_type='LTIDR' AND action='DG' AND date BETWEEN '2026-01-01' AND '2026-12-31'
UNION ALL SELECT 'dg_count_E14', count(*)::varchar FROM act WHERE k='E14' AND action='DG';
```
<invoke name="sql">
SELECT 1;
</invoke>
```sql
SELECT 'instIG', count(*)::varchar FROM (SELECT *, row_number() OVER (PARTITION BY rated_id ORDER BY date DESC, action_id DESC) rn FROM rating_actions WHERE rating_type='INST' AND action<>'EX' AND date<='2026-10-01') WHERE rn=1 AND rating IN ('AAA','AA+','AA','AA-','A+','A','A-','BBB+','BBB','BBB-')
UNION ALL SELECT 'instRated', count(*)::varchar FROM (SELECT *, row_number() OVER (PARTITION BY rated_id ORDER BY date DESC, action_id DESC) rn FROM rating_actions WHERE rating_type='INST' AND action<>'EX' AND date<='2026-10-01') WHERE rn=1 AND rating<>'WD'
UNION ALL SELECT 'GB_issuers', count(DISTINCT s.k)::varchar FROM st s JOIN (SELECT k, coalesce(max(CASE WHEN source_system='RESEARCH' THEN country END), max(country)) c FROM ent GROUP BY k) c ON c.k=s.k WHERE s.rating_type='LTIDR' AND s.rating<>'WD' AND c.c='GB'
UNION ALL SELECT 'LU', count(*)::varchar FROM (SELECT k, coalesce(max(CASE WHEN source_system='RESEARCH' THEN country END), max(country)) c FROM ent GROUP BY k) WHERE c='LU'
UNION ALL SELECT 'entities', count(DISTINCT k)::varchar FROM ent
UNION ALL SELECT 'ceil_eq', string_agg(s.k,',') FROM st s JOIN (SELECT k, coalesce(max(CASE WHEN source_system='RESEARCH' THEN country END), max(country)) c FROM ent GROUP BY k) c ON c.k=s.k JOIN st cc ON cc.rating_type='CC' AND cc.k=c.c WHERE s.rating_type='LTIDR' AND s.ccy_basis='FC' AND s.rating=cc.rating
UNION ALL SELECT 'inst_status', string_agg(rated_id||':'||action||':'||rating||':'||date,' ') FROM rating_actions WHERE rating_type='INST' AND rated_id IN ('I06','I08','I07','I04','I5007','I02');
```
```sql
SELECT * FROM rating_actions WHERE rated_id IN ('I06','I08','I5007','E15','E5133','E5145','E5132') OR (rating_type='INST' AND action IN ('EX','AF','DG')) ORDER BY rated_id, date;
```
<invoke name="sql">
SELECT 1;
</invoke>
```sql
SELECT e.entity_id,e.k,e.name,e.country,e.source_system,e.parent_id FROM ent e WHERE name ILIKE '%cerid%' OR name ILIKE '%rotam%' OR name ILIKE '%wonod%' OR name ILIKE '%vesol%' OR name ILIKE '%belir%' OR name ILIKE '%geren%' ORDER BY entity_id;
```
<invoke name="sql">
SELECT 1;
</invoke>Query results
Query 1:
(no rows)
Query 2:
(no rows)
Query 3:
(no rows)
Query 4:
| q | string_agg(DISTINCT k, ',') |
|---|---|
| default | 969500KOTZ1JFIZSG796 |
| everdefault | 969500KOTZ1JFIZSG796 |
| issuers_rated | 377 |
| rwn | 815600GVTRTKVHG8BO41,549300PSORKEO25SHT85,213800XQVJ5IKNNVXY16,724500HD5AQ2MDSXXU69,7245002QMS1HJ8LWKI72,969500U072SAPPW32N81,549300AMVE3VRVG7HK43,3912006PQEEWVJETOG62,969500D8VQO3X7NDHQ76,549300N9NKGSRIO34Y39,724500W08E6JP9P9NC97,7245008Y7HAJI3ZSJK12,391200YYRT4OCYJBQT44,213800QG4ZGLWRUBIQ31,815600379XSXXQR72R46,5493002BLV266QJVIH90,549300CRXZL5I1OT6L14,5493004IM0PRT8BSDK29,549300WSZI986L1XA988,549300GS8TRRRJCSVZ45,549300HWTXXHJP2HKU38,213800WSVEOAQ5HD4C43,969500HA9D5I7F73PW83,213800VNDQV0VN6FVU72,9695000MJJR7IQP71F01,8156006G7EEYC0O0U554,391200GSFO0F68KKUC67,724500CD625Q9LIJG838,213800VQSNQ2434DKS91,391200OBAXI8590VQN12,815600VWY9ZIH3XVHE31,549300HH75F3NXLKV336 |
| neg | 969500W1RDU3ZPX1YB94,815600UU6JEHIIMLC927,96950092DKV427KADB93,391200Z1OH1HXMHTW971,9695003VHLA8O9WU7N54,815600ASM9EHDG931T89,815600KLV84WAQGPSX27,724500I4E8HLVDTIKT27,549300FMGCHAUC6SYX63,391200F077WCSDTMTP77,815600SERWD64UWU8808,724500EU84AMOZS7U244,549300DBENKHP53C1C31,549300JP8CDGC9RN3314,54930011OTFCAUKB0A28,549300ENXJ8RIUXUHZ80,2138002W9KTVILKQ8Q89,549300CRXZL5I1OT6L14,9695008UP74QEOJ3KW74,213800TWNH19JCPPPE80,5493008DY4URIBMCWM93,213800YPXA4OJXD8EB91,549300H1N0EQEAZLE362,549300MXQ7UU7852PG70,3912002RB0IGZZN6RN49,213800XN4WOS9M0UP985,724500WWWM8KJ2Q08398,213800M91M3NKSWT8K97,549300Z4E2ZBV3ZWA751,213800KKF07D3TEWYS82,724500GZZJO3VTZ5OY05,549300ZM08IADSAK3L87,969500PM41NS2PBZU440,969500DMA3PCFLMC4U98,969500YPO4CFVEL1XX12,7245002OOPBG04092E43,969500ZM445IDEYHCL85,5493000MDIWO1KHI0272,8156008DPX4I9DNKWN26,815600JRN7AOE36KFR35,724500JFK718P3DNW233,3912008BZ54JQ8UNFG51,391200WPOJY9F1NTH725,815600O0Y6S2CPCDAA82,2138006JVQYZA2IAU357,391200SY8W07WDP69G34,724500S6MKGNUW1YNO80 |
| lost | 391200922SWGGGCXM514,3912003R00FP6CNV6210,391200KLG6G4KVIMIU52,549300JU1O5MP1HSKQ01,2138009BPHEDKSZHFF68,391200428FS1WJP3AG75,39120035C3L494GPV335,969500QXEZ0NSV6EIW69,549300F5R74KW6K96H13,815600YLA1GXMHYMXP16,815600N2UAHQREHHWF76,8156008Z86BWAKVE7I73,9695003B8HVZN6WVB082,9695000T21G05UQMGF10,724500BSV4X2J7KUR535,969500B6IUACELPI2291,9695003FBHLB9KIKNT76,2138005XQUSYXQWKHP15,3912001DEUC7UPZYE471,391200IBY0WQGAT3R586,724500L96DLBJOLSDZ06,969500SQSSYT8HOYOP58,391200H4MC1UG4HGZY09,2138006H9XCYN2P1K228,815600MZAUY1OCZWJF49,213800VMJXKPLM9ZIL74,724500AXGCJXTB1DVL94,815600HZK0IK4Q5GF769,549300QT2LSIX31F9O17,391200MB5QFXCD5X8I15,815600NAKDQJ2L7WWJ01,549300IGMPC8HEIKND87,724500R7NQF1BMLIW829,815600IJD373PYH08A24,549300P8CEPUO96H4Y59 |
| dg2026 | 549300A64I73OEIC4R87,391200J1XGI3MNYV2584,2138002W9KTVILKQ8Q89,815600SERWD64UWU8808,391200F077WCSDTMTP77,213800YPXA4OJXD8EB91,213800VMJXKPLM9ZIL74,549300OCOVKZOF4FO259,969500Y1Y66M1421WE10,5493000NGCMTDC4BZ653,391200Z1OH1HXMHTW971,391200QYPVFF2O9K2039,549300SBMAQCEKT3IC98,549300GJM0MMFEH84V77,969500YPO4CFVEL1XX12,969500CNC5SOCN5K2N29,2138009BPHEDKSZHFF68,969500799KP9QCVM7739,815600KLV84WAQGPSX27,969500QJ1AV6AZJSB088,724500I4E8HLVDTIKT27,549300FMGCHAUC6SYX63,391200WPOJY9F1NTH725,3912008BZ54JQ8UNFG51,969500PM41NS2PBZU440,7245002EC45UEUXQJA30,549300XHVH0VBXX4D156,5493001E7O9QDD98PV36,213800QV7J1EXLC4YX51,549300XV49ES64RGNQ00,213800TWNH19JCPPPE80,5493005YGBG4Z7ZGH950,724500JFK718P3DNW233,2138008SWUJK7JUSMR14,815600RCZP0ISY44E024,724500WO4TZY2027IZ62,969500KOTZ1JFIZSG796,969500IYLWO8RRIOIL83 |
| dg_count_E14 | 0 |
Query 5:
| 'instIG' | CAST(count_star() AS VARCHAR) |
|---|---|
| instIG | 72 |
| instRated | 113 |
| GB_issuers | 79 |
| LU | 1 |
| entities | 497 |
| ceil_eq | 969500HA9D5I7F73PW83,213800PBQVHVBBH6GV02,213800TJ32NARU0BI982,815600GVTRTKVHG8BO41,815600YUVYKAXDN9LE93,3912002FNTE1EKOY9W74,724500I4E8HLVDTIKT27,213800QG4ZGLWRUBIQ31,7245007V26QZ8EY8MZ45,391200LESH03LMOY2U61,549300TPHB19IJU6VV67,8156004CDHFBVRR3LT54,213800CPQNCG46SCSV94 |
| inst_status | I02:DG:BB+:2025-06-20 I04:AS:BB:2025-04-01 I02:AS:BBB:2024-03-12 I06:AS:A-:2024-03-01 I07:AS:BBB-:2025-04-01 I08:EX:A:2026-09-01 I5007:AS:BBB:2025-02-14 |
Query 6:
| action_id | date | rated_id | rating_type | ccy_basis | action | rating | outlook | watch | comment |
|---|---|---|---|---|---|---|---|---|---|
| A40 | 2024-03-01 | E15 | LTIDR | LC | AS | A+ | STA | | |
| A41 | 2024-03-01 | E15 | LTIDR | FC | AS | A | STA | | |
| A5101 | 2023-12-02 | E5132 | LTIDR | FC | AS | BB+ | STA | | |
| A5102 | 2022-01-15 | E5133 | LTIDR | FC | AS | BBB- | STA | | |
| A06 | 2025-06-20 | I01 | INST | | DG | BBB | | | |
| A07 | 2025-06-20 | I02 | INST | | DG | BB+ | | | |
| A11 | 2025-09-15 | I03 | INST | | AF | 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 | | | |
| A1011 | 2026-11-17 | I1001 | INST | | EX | A+ | | | |
| A1029 | 2026-11-11 | I1007 | INST | | EX | AA- | | | |
| A1033 | 2026-05-23 | I1008 | INST | | EX | B+ | | | |
| A1051 | 2026-07-22 | I1012 | INST | | EX | A- | | | |
| A1078 | 2026-12-17 | I1015 | INST | | EX | B+ | | | |
| A1120 | 2026-09-18 | I1021 | INST | | EX | AA- | | | |
| A1345 | 2026-05-18 | I1046 | INST | | EX | B+ | | | |
| A1357 | 2026-03-17 | I1049 | INST | | EX | BB- | | | |
| A5126 | 2025-02-14 | I5007 | INST | | AS | BBB | | | |
Query 7:
| entity_id | k | name | country | source_system | parent_id |
|---|---|---|---|---|---|
| E5001 | 815600F48PANJQE75352 | Cerid Group plc | GB | RATINGS | |
| E5002 | 3912006ACANJUP8PLJ39 | Cerid Energy plc | GB | RATINGS | E5001 |
| E5003 | 724500EXQA91TPK6WL60 | Cerid Media BV | NL | RATINGS | E5001 |
| E5004 | 969500SFWGRHVUTANY40 | Cerid Utilities plc | GB | RATINGS | E5001 |
| E5005 | 391200B1GR4AGTV5WY99 | Cerid Chemicals SA | VD | RATINGS | E5002 |
| E5006 | 969500HZQBDFIIHLYK06 | Cerid Foods plc | GB | RATINGS | E5002 |
| E5007 | 391200Q98UGZZQTV1C88 | Cerid Holdings BV | NL | RATINGS | E5003 |
| E5008 | 815600M8RE9386DDQB31 | Cerid Airlines BV | NL | RATINGS | E5003 |
| E5009 | 96950033222B9BRCGP58 | Cerid Leror Logistics plc | GB | RATINGS | E5004 |
| E5010 | 724500E2OQMMMZVTBS53 | Cerid Gator Steel Inc | US | RATINGS | E5004 |
| E5011 | 391200IX7WB68Q29NJ46 | Cerid Guven Energy SA | VD | RATINGS | E5167 |
| E5012 | 549300TPHB19IJU6VV67 | Cerid Gevin Pharma SA | VD | RATINGS | E5005 |
| E5013 | 724500EU84AMOZS7U244 | Cerid Telecom SA | ES | RATINGS | E5006 |
| E5014 | 724500YWGS7BR1AKHD13 | Cerid Gusom Pharma SpA | IT | RATINGS | E5006 |
| E5015 | 969500C1TQV008QIYL28 | Cerid Logistics BV | NL | RATINGS | E5007 |
| E5016 | 549300WMHA09HQ7NGF72 | Cerid Rovem Industries BV | NL | RATINGS | E5007 |
| E5017 | 213800BAYNUVR2EE0Y41 | Cerid Steel BV | NL | RATINGS | E5008 |
| E5018 | 815600DDEIUOIMDS3N14 | Cerid Mining BV | NL | RATINGS | E5008 |
| E5019 | 2138002W9KTVILKQ8Q89 | Cerid Buvom Mining plc | GB | RATINGS | E5009 |
| E5020 | 9695003VHLA8O9WU7N54 | Cerid Tivim Retail SA | FR | RATINGS | E5009 |
| E5021 | 724500S8Q4HUNT229Y84 | Cerid Retail Inc | US | RATINGS | E5010 |
| E5022 | 213800S7QJ9EVK96PK05 | Cerid Industries Inc | US | RATINGS | E5010 |
| E5023 | 549300MXQ7UU7852PG70 | Cerid Dilal Utilities SA | VD | RATINGS | E5011 |
| E5024 | 39120041ZCI02VDN2I18 | Cerid Fatal Shipping SA | VD | RATINGS | E5012 |
| E5025 | 213800AXPZD5MSP2GW32 | Cerid Fater Media SA | ES | RATINGS | E5013 |
| E5026 | 724500GF9ADSAA20FI77 | Cerid Hosad Retail Inc | US | RATINGS | E5014 |
| E5027 | 391200TO1KK187R1JQ78 | Cerid Hutem Water plc | GB | RATINGS | E5015 |
| E5028 | 724500EVQNRETR9CVD02 | Cerid Galon Chemicals BV | NL | RATINGS | E5016 |
| E5029 | 21380057HMIY2LIM5A29 | Cerid Walol Water BV | NL | RATINGS | E5017 |
| E5030 | 549300M13MMEINCT8W03 | Cerid Tivor Holdings BV | NL | RATINGS | E5018 |
| E5031 | 815600Q07VLOKJE53L06 | Cerid Velin Water plc | GB | RATINGS | E5019 |
| E5032 | 213800CIZLWWL071KP85 | Cerid Meron Media SA | FR | RATINGS | E5020 |
| E5033 | 969500799KP9QCVM7739 | Cerid Pitam Energy Inc | US | RATINGS | E5021 |
| E5034 | 7245008XDA202762F829 | Cerid Shipping BV | NL | RATINGS | E5022 |
| E5035 | 724500637K0GA6PFC081 | Cerid Water SA | VD | RATINGS | E5023 |
| E5036 | 549300RJ7KMPDJVQY167 | Cerid Calin Energy SpA | IT | RATINGS | E5024 |
| E5037 | 2138003NRPV4IDSP9314 | Cerid Holom Water SA | ES | RATINGS | E5025 |
| E5038 | 969500HETRKT6OQMNS48 | Cerid Holen Chemicals BV | NL | RATINGS | E5026 |
| E5039 | 549300DBENKHP53C1C31 | Cerid Property SA | ES | RATINGS | E5027 |
| E5040 | 9695007VBLZNWG66LZ43 | Cerid Lovan Energy BV | NL | RATINGS | E5028 |
| E5041 | 391200FXD4CH3FVZ4165 | Cerid Dolem Mining AG | DE | RATINGS | E5029 |
| E5042 | 724500N6QZUJJJ1BJI79 | Cerid Feral Property BV | NL | RATINGS | E5030 |
| E5043 | 724500TQEHDQ1U12GG60 | Cerid Retil Chemicals plc | GB | RATINGS | E5031 |
| E5044 | 969500Q2MORWVR40BH37 | Cerid Masim Retail plc | GB | RATINGS | E5032 |
| E5045 | 7245006QVOPQQK3JUP45 | Cerid Curel Water SA | CV | RATINGS | E5033 |
| E5046 | 5493004EWDCN8OTFZZ22 | Cerid Gevom Media BV | NL | RATINGS | E5034 |
| E5047 | 8156004CDHFBVRR3LT54 | Cerid Rosor Holdings SA | VD | RATINGS | E5035 |
| E5048 | 969500Z6AXSJ33YYZX35 | Cerid Pharma plc | GB | RATINGS | E5036 |
| E5049 | 969500W280QA6A7WLO22 | Cerid Ritir Foods plc | GB | RATINGS | E5037 |
| E5050 | 213800KKF07D3TEWYS82 | Cerid Futir Utilities BV | NL | RATINGS | E5038 |
| E5051 | 969500P4S8FH9839YS39 | Cerid Butad Capital SA | FR | RATINGS | E5039 |
| E5052 | 391200Z0R0NKUJT0LS48 | Cerid Viron Property SA | FR | RATINGS | E5040 |
| E5053 | 549300GMLMV9DA645M00 | Cerid Setom Media AG | DE | RATINGS | E5041 |
| E5054 | 549300UVWD2URAQCNQ18 | Cerid Linin Media BV | NL | RATINGS | E5042 |
| E5055 | 391200627RBIC2DTG305 | Cerid Gosim Media SA | CV | RATINGS | E5043 |
| E5056 | 391200Q0XXMZJQSOR362 | Cerid Capital plc | GB | RATINGS | E5044 |
| E5057 | 5493008DY4URIBMCWM93 | Cerid Manid Airlines Inc | US | RATINGS | E5045 |
| E5058 | 391200XLOZO7S6T1FI61 | Cerid Cirad Industries BV | NL | RATINGS | E5046 |
| E5059 | 969500YPO4CFVEL1XX12 | Belir Group AG | DE | RATINGS | |
| E5060 | 549300PQXT9OXKZVXP03 | Belir Retail AG | DE | RATINGS | E5059 |
(109 more rows not shown)
Query 8:
| 1 |
|---|
| 1 |
Run more queries, or give the final answers.The model
```sql
SELECT 'Q49_50' q, (SELECT string_agg(DISTINCT t.tk||' depth '||t.d,';') FROM top t JOIN gp ON gp.k=t.k WHERE gp.id='E5047') v
UNION ALL SELECT 'sizes', (SELECT string_agg(gp.id||'='||x.c,', ') FROM (SELECT tk, count(*) c FROM top GROUP BY tk) x JOIN gp ON gp.k=x.tk WHERE gp.id IN ('E09','E02','E5001','E5059') OR gp.name ILIKE 'Rotam Group%' OR gp.name ILIKE 'Wonod Group%' OR gp.name ILIKE 'Vesol Group%')
UNION ALL SELECT 'Q53', (SELECT string_agg(gp.id||'->'||tp.id,',') FROM top t JOIN gp ON gp.k=t.k JOIN gp tp ON tp.k=t.tk WHERE gp.id='E5062' OR gp.name ILIKE 'Rotam Group%')
UNION ALL SELECT 'Q59', (SELECT count(*)::varchar FROM top t JOIN gp ON gp.k=t.tk WHERE gp.id='E5001' AND t.d=3)
UNION ALL SELECT 'Q57', (SELECT string_agg(DISTINCT a1.anc||'@'||a1.d||'/'||a2.d,',') FROM anc a1 JOIN anc a2 ON a1.anc=a2.anc JOIN gp x ON x.k=a1.k JOIN gp y ON y.k=a2.k WHERE x.id='E5011' AND y.id='E5013')
UNION ALL SELECT 'Q61', (SELECT count(DISTINCT s.k)::varchar FROM top t JOIN cur s ON s.k=t.k AND s.rating_type='LTIDR' AND s.ccy_basis='FC' WHERE t.tk=(SELECT k FROM gp WHERE id='E5001') AND s.rating NOT IN ('WD','AAA','AA+','AA','AA-','A+','A','A-','BBB+','BBB','BBB-'))
UNION ALL SELECT 'Q55', (SELECT count(DISTINCT s.k)::varchar FROM cur s JOIN anc a ON a.k=s.k AND a.d>0 JOIN gp p ON p.k=a.anc WHERE s.rating_type='LTIDR' AND s.rating<>'WD' AND p.country='VD')
UNION ALL SELECT 'Q56', (SELECT string_agg(gp.id||':'||s.rating,',') FROM top t JOIN gp ON gp.k=t.k JOIN gp tp ON tp.k=t.tk JOIN cur s ON s.k=t.k AND s.rating_type='LTIDR' AND s.ccy_basis='FC' WHERE tp.name ILIKE 'Vesol Group%')
UNION ALL SELECT 'Q54', (SELECT string_agg(gp.id,',') FROM top t JOIN gp ON gp.k=t.k JOIN gp tp ON tp.k=t.tk WHERE tp.name ILIKE 'Wonod Group%' AND gp.country='VD')
UNION ALL SELECT 'Q58', (SELECT string_agg(i.instrument_id||':'||i.issuer_id||'g'||i.guarantor_id||' '||(ti.tk=tg.tk)::varchar,'; ') FROM instruments i JOIN ent ei ON ei.entity_id=i.issuer_id JOIN ent eg ON eg.entity_id=i.guarantor_id JOIN top ti ON ti.k=ei.k JOIN top tg ON tg.k=eg.k WHERE i.guarantor_id<>'')
UNION ALL SELECT 'Q33', (SELECT string_agg(k||':'||rating,',') FROM cur WHERE k IN ('391200QYPVFF2O9K2039') AND rating_type='LTIDR');
```
```sql
SELECT 'Q25' q, (SELECT count(*)||'/'||sum(CASE WHEN rating IN ('AAA','AA+','AA','AA-','A+','A','A-','BBB+','BBB','BBB-') THEN 1 ELSE 0 END) FROM (SELECT r.*, row_number() OVER (PARTITION BY rated_id ORDER BY date DESC, action_id DESC) rn FROM rating_actions r JOIN instruments i ON i.instrument_id=r.rated_id JOIN ent e ON e.entity_id=i.issuer_id WHERE r.rating_type='INST' AND r.action<>'EX' AND r.date<='2026-10-01') WHERE rn=1 AND rating<>'WD') v
UNION ALL SELECT 'Q22', (SELECT string_agg(DISTINCT g.id,',') FROM act a JOIN g USING(k) WHERE a.rating_type='LTIDR' AND a.rating IN ('RD','D'))
UNION ALL SELECT 'Q30', (SELECT string_agg(DISTINCT g.id,',') FROM st s JOIN g ON g.k=s.k JOIN st cc ON cc.rating_type='CC' AND cc.k=g.country WHERE s.rating_type='LTIDR' AND s.ccy_basis='FC' AND s.rating=cc.rating)
UNION ALL SELECT 'Q31', (SELECT string_agg(g.id||':'||s.rating||'>'||cc.rating,',') FROM st s JOIN g ON g.k=s.k JOIN st cc ON cc.rating_type='CC' AND cc.k=g.country WHERE s.rating_type='LTIDR' AND s.ccy_basis='FC' AND s.rating<>'WD' AND list_position(['AAA','AA+','AA','AA-','A+','A','A-','BBB+','BBB','BBB-','BB+','BB','BB-','B+','B','B-','CCC','CC','C','RD','D'],s.rating) < list_position(['AAA','AA+','AA','AA-','A+','A','A-','BBB+','BBB','BBB-','BB+','BB','BB-','B+','B','B-','CCC','CC','C','RD','D'],cc.rating))
UNION ALL SELECT 'Q7n', (SELECT count(DISTINCT k)::varchar FROM act WHERE rating_type='LTIDR' AND action='DG' AND date BETWEEN '2026-01-01' AND '2026-11-05')
UNION ALL SELECT 'Q18n', (SELECT count(DISTINCT k)::varchar FROM st WHERE rating_type='LTIDR' AND watch='RWN' AND rating<>'WD')
UNION ALL SELECT 'Q19n', (SELECT count(DISTINCT k)::varchar FROM st WHERE rating_type='LTIDR' AND outlook='NEG' AND rating<>'WD')
UNION ALL SELECT 'Q21n', (SELECT count(DISTINCT k)::varchar FROM act WHERE rating_type='LTIDR' AND k NOT IN (SELECT k FROM st WHERE rating_type='LTIDR' AND rating<>'WD'));
```Query results
Query 1 failed: Catalog Error: Table with name top does not exist!
Query 2 failed: Catalog Error: Table with name g does not exist!
Run more queries, or give the final answers.The model
<invoke name="sql">
SELECT 1;
</invoke>
```sql
CREATE OR REPLACE VIEW gp AS
SELECT r.entity_id id, r.k, r.name, coalesce(res.country, r.country) country, pe.k pk
FROM ent r LEFT JOIN ent pe ON pe.entity_id=r.parent_id
LEFT JOIN (SELECT k, max(country) country FROM ent WHERE source_system='RESEARCH' GROUP BY k) res ON res.k=r.k
WHERE r.source_system='RATINGS';
```
```sql
CREATE OR REPLACE VIEW g AS SELECT * FROM gp;
```
```sql
CREATE OR REPLACE VIEW anc AS
WITH RECURSIVE a(k, anc, d) AS (
SELECT k, k, 0 FROM gp
UNION ALL SELECT a.k, gp.pk, a.d+1 FROM a JOIN gp ON gp.k=a.anc WHERE gp.pk IS NOT NULL)
SELECT * FROM a;
```
```sql
CREATE OR REPLACE VIEW top AS
SELECT a.k, a.anc tk, a.d FROM anc a JOIN gp ON gp.k=a.anc WHERE gp.pk IS NULL;
```
```sql
CREATE OR REPLACE VIEW cur AS
SELECT * FROM (SELECT *, row_number() OVER (PARTITION BY k,rating_type,coalesce(ccy_basis,'') ORDER BY date DESC, action_id DESC) rn FROM act WHERE date<='2026-11-05') WHERE rn=1;
```
```sql
SELECT 'Q49_50' q, (SELECT string_agg(DISTINCT tp.id||' depth '||t.d,';') FROM top t JOIN gp ON gp.k=t.k JOIN gp tp ON tp.k=t.tk WHERE gp.id='E5047') v
UNION ALL SELECT 'sizes', (SELECT string_agg(tp.id||'='||x.c,', ') FROM (SELECT tk, count(*) c FROM top GROUP BY tk) x JOIN gp tp ON tp.k=x.tk WHERE tp.id IN ('E09','E02','E5001') OR tp.name ILIKE 'Rotam Group%' OR tp.name ILIKE 'Wonod Group%' OR tp.name ILIKE 'Vesol Group%')
UNION ALL SELECT 'Q53', (SELECT string_agg(gp.id||'->'||tp.id,',') FROM top t JOIN gp ON gp.k=t.k JOIN gp tp ON tp.k=t.tk WHERE gp.id='E5062' OR gp.name ILIKE 'Rotam Group%')
UNION ALL SELECT 'Q59', (SELECT count(*)::varchar FROM top t JOIN gp ON gp.k=t.tk WHERE gp.id='E5001' AND t.d=3)
UNION ALL SELECT 'Q57', (SELECT string_agg(DISTINCT a1.anc||'@'||a1.d||'/'||a2.d,',') FROM anc a1 JOIN anc a2 ON a1.anc=a2.anc JOIN gp x ON x.k=a1.k JOIN gp y ON y.k=a2.k WHERE x.id='E5011' AND y.id='E5013')
UNION ALL SELECT 'Q61', (SELECT count(DISTINCT s.k)::varchar FROM top t JOIN cur s ON s.k=t.k AND s.rating_type='LTIDR' AND s.ccy_basis='FC' WHERE t.tk=(SELECT k FROM gp WHERE id='E5001') AND s.rating NOT IN ('WD','AAA','AA+','AA','AA-','A+','A','A-','BBB+','BBB','BBB-'))
UNION ALL SELECT 'Q55', (SELECT count(DISTINCT s.k)::varchar FROM cur s JOIN anc a ON a.k=s.k AND a.d>0 JOIN gp p ON p.k=a.anc WHERE s.rating_type='LTIDR' AND s.rating<>'WD' AND p.country='VD')
UNION ALL SELECT 'Q56', (SELECT string_agg(gp.id||':'||s.rating,',') FROM top t JOIN gp ON gp.k=t.k JOIN gp tp ON tp.k=t.tk JOIN cur s ON s.k=t.k AND s.rating_type='LTIDR' AND s.ccy_basis='FC' WHERE tp.name ILIKE 'Vesol Group%')
UNION ALL SELECT 'Q54', (SELECT string_agg(gp.id,',') FROM top t JOIN gp ON gp.k=t.k JOIN gp tp ON tp.k=t.tk WHERE tp.name ILIKE 'Wonod Group%' AND gp.country='VD')
UNION ALL SELECT 'Q58', (SELECT string_agg(i.instrument_id||':'||i.issuer_id||'g'||i.guarantor_id||' '||(ti.tk=tg.tk)::varchar,'; ') FROM instruments i JOIN ent ei ON ei.entity_id=i.issuer_id JOIN ent eg ON eg.entity_id=i.guarantor_id JOIN top ti ON ti.k=ei.k JOIN top tg ON tg.k=eg.k WHERE i.guarantor_id<>'')
UNION ALL SELECT 'Q33', (SELECT string_agg(k||':'||rating||':'||date,',') FROM cur WHERE k='391200QYPVFF2O9K2039' AND rating_type='LTIDR');
```
```sql
SELECT 'Q22' q, (SELECT string_agg(DISTINCT g.id,',') FROM act a JOIN g USING(k) WHERE a.rating_type='LTIDR' AND a.rating IN ('RD','D')) v
UNION ALL SELECT 'Q30', (SELECT string_agg(DISTINCT g.id,',') FROM st s JOIN g ON g.k=s.k JOIN st cc ON cc.rating_type='CC' AND cc.k=g.country WHERE s.rating_type='LTIDR' AND s.ccy_basis='FC' AND s.rating=cc.rating)
UNION ALL SELECT 'Q31', (SELECT string_agg(g.id||':'||s.rating||'>'||cc.rating,',') FROM st s JOIN g ON g.k=s.k JOIN st cc ON cc.rating_type='CC' AND cc.k=g.country WHERE s.rating_type='LTIDR' AND s.ccy_basis='FC' AND s.rating<>'WD' AND list_position(['AAA','AA+','AA','AA-','A+','A','A-','BBB+','BBB','BBB-','BB+','BB','BB-','B+','B','B-','CCC','CC','C','RD','D'],s.rating) < list_position(['AAA','AA+','AA','AA-','A+','A','A-','BBB+','BBB','BBB-','BB+','BB','BB-','B+','B','B-','CCC','CC','C','RD','D'],cc.rating))
UNION ALL SELECT 'Q7', (SELECT string_agg(DISTINCT g.id,',') FROM act a JOIN g USING(k) WHERE a.rating_type='LTIDR' AND a.action='DG' AND a.date BETWEEN '2026-01-01' AND '2026-11-05')
UNION ALL SELECT 'Q18', (SELECT string_agg(DISTINCT g.id,',') FROM st s JOIN g USING(k) WHERE s.rating_type='LTIDR' AND s.watch='RWN' AND s.rating<>'WD')
UNION ALL SELECT 'Q19', (SELECT string_agg(DISTINCT g.id,',') FROM st s JOIN g USING(k) WHERE s.rating_type='LTIDR' AND s.outlook='NEG' AND s.rating<>'WD')
UNION ALL SELECT 'Q21', (SELECT string_agg(DISTINCT g.id,',') FROM act a JOIN g USING(k) WHERE a.rating_type='LTIDR' AND a.k NOT IN (SELECT k FROM st WHERE rating_type='LTIDR' AND rating<>'WD'))
UNION ALL SELECT 'Q25', (SELECT count(*)||'/'||sum(CASE WHEN rating IN ('AAA','AA+','AA','AA-','A+','A','A-','BBB+','BBB','BBB-') THEN 1 ELSE 0 END) FROM (SELECT r.*, row_number() OVER (PARTITION BY rated_id ORDER BY date DESC, action_id DESC) rn FROM rating_actions r WHERE r.rating_type='INST' AND r.action<>'EX' AND r.date<='2026-10-01') WHERE rn=1 AND rating<>'WD')
UNION ALL SELECT 'noRATINGSrec', (SELECT string_agg(DISTINCT k,',') FROM ent WHERE k NOT IN (SELECT k FROM gp));
```Query results
Query 1:
(no rows)
Query 2:
(no rows)
Query 3:
(no rows)
Query 4:
(no rows)
Query 5:
(no rows)
Query 6:
| q | v |
|---|---|
| Q49_50 | E5001 depth 6 |
| sizes | E5105=27, E5132=13, E09=3, E5001=58, E02=2, E5086=19 |
| Q53 | E5086->E5086,E5062->E5059 |
| Q59 | 12 |
| Q57 | 3912006ACANJUP8PLJ39@2/2,815600F48PANJQE75352@3/3 |
| Q61 | 19 |
| Q55 | 31 |
| Q56 | E5144:BB-,E5143:A,E5141:BB,E5140:A+,E5136:BBB-,E5133:BBB-,E5132:BB+ |
| Q54 | E5106,E5124,E5130 |
| Q58 | I1099:E1331gE1025 true; I1105:E1337gE1038 true; I1094:E1326gE1052 true; I1100:E1332gE1068 true; I1097:E1329gE1069 true; I1106:E1338gE1073 true; I1101:E1333gE1082 true; I1093:E1325gE1084 true; I1095:E1327gE1119 true; I1104:E1336gE1176 true; I1103:E1335gE1234 true; I1107:E1339gE1241 true; I1096:E1328gE1244 true; I1102:E1334gE1260 true; I5001:E5005gE5001 true; I5002:E5062gE5059 true; I5003:E5090gE5086 true; I5004:E5108gE5105 true; I5005:E5135gE5132 true; I5006:E5149gE5145 true; I03:E04gE02 true; I1098:E1330gE1021 true; I5007:E5133gE5145 false; I05:E11gE10 true |
| Q33 | 391200QYPVFF2O9K2039:BBB+:2026-04-15 |
Query 7:
| q | v |
|---|---|
| Q22 | E08 |
| Q30 | E1039,E1028,E1126,E1101,E05,E5047,E1236,E5091,E1194,E5116,E5124,E15,E5012 |
| Q31 | |
| Q7 | E1058,E1167,E1285,E1290,E08,E1112,E1186,E1169,E5116,E1080,E5059,E10,E1160,E1064,E1093,E1151,E1294,E5156,E5019,E5113,E1053,E1057,E1144,E1159,E1243,E1051,E1228,E1229,E1255,E1263,E1307,E1298,E5097,E1163,E1300,E1213,E1034 |
| Q18 | E1039,E1266,E1059,E1099,E1132,E1260,E1013,E1061,E1297,E1238,E06,E1133,E1181,E1037,E1242,E1317,E1209,E1098,E1126,E1088,E1194,E1267,E1006,E1019,E1264,E1066,E1146,E1203,E1314,E1323,E1109,E1168 |
| Q19 | E5019,E5113,E5131,E09,E1211,E1046,E5116,E1005,E1080,E1228,E5050,E5073,E5099,E1263,E1105,E1158,E5039,E5156,E1072,E1190,E5013,E5023,E1056,E1282,E1059,E5062,E5020,E5059,E1029,E1160,E1248,E5057,E1034,E1188,E01,E1064,E1118,E1261,E5097,E5102,E1300,E1079,E1271,E5119,E5141,E1055,E1294 |
| Q21 | E07,E1166,E1021,E1076,E1206,E1219,E1320,E1041,E1063,E1107,E1140,E1138,E1048,E1084,E1244,E1316,E1218,E1007,E1032,E1057,E1155,E1159,E1308,E1253,E1062,E1277,E1121,E1205,E1233,E1200,E1225,E1234,E1124,E1172,E1001 |
| Q25 | 113/72 |
| noRATINGSrec | |
Query 8:
| 1 |
|---|
| 1 |
Run more queries, or give the final answers.The model
**Q1.** A-. E01's rating was set by A01 (assigned 2024-03-12) and not changed until the downgrade A02 on 2025-06-20.
**Q2.** No. The only 2026 actions on E01 are A03 (affirmed, outlook moved to NEG) and A04 (short-term affirmed), and neither is a downgrade.
**Q3.** No, BB+. The 2031 note is I02, a subordinated note; its latest action is the downgrade A07 to BB+, which is speculative grade.
**Q4.** POS. E02 and E03 share one LEI and are one entity, and the latest action is A09 (E03, 2025-09-15) with a Positive outlook.
**Q5.** The holder takes E02's credit risk, rated A. I03 is issued by the finance subsidiary E04 and guaranteed by E02, whose latest rating is A (A08/A09).
**Q6.** Valdoria Telecom's FC rating is BB and its LC rating is BBB- (A14, A13). The FC rating is capped by Valdoria's Country Ceiling of BB (A12), while LC is not capped.
**Q7.** See the list in the JSON. These are the entities with an LTIDR downgrade (DG) in 2026 up to today, 2026-11-05, with duplicate records merged by LEI. A5028 is dated 2026-11-06, after today, so E5033 is not counted.
**Q8.** E08. A22 on 2026-07-08 moved it to RD, a restricted default, after a distressed debt exchange.
**Q9.** 377. This counts distinct entities (merged by LEI) whose latest LTIDR on or before 2026-10-01 is not WD, excluding QA records.
**Q10.** Depends. E05 is BB on foreign currency (A14) and BBB- on local currency (A13), so the answer depends on which basis is meant.
**Q11.** BBB+. The downgrade A36 on 2024-09-30 applies, and the later RW (A35) leaves the rating unchanged.
**Q12.** A-, set by A34 on 2023-01-15.
**Q13.** 1. The only downgrade of E14 is A36.
**Q14.** None. E12's first rating, A30, is dated 2024-02-01.
**Q15.** A-. E10's downgrade to BBB+ (A27) is dated 2026-04-15, after 1 January 2026.
**Q16.** No. E14 was BBB+ on 1 January 2025 and is BBB+ now (A33).
**Q17.** No. E06's only 2026 action is A17, a Rating Watch placement with the rating unchanged.
**Q18.** See the list in the JSON. These are entities whose latest LTIDR action on or before 2026-10-01 carries an RWN watch, including E06 (A17).
**Q19.** See the list in the JSON. These are entities whose latest LTIDR action on or before 2026-10-01 carries a NEG outlook, including E01 and E09.
**Q20.** No. E07 was withdrawn (A19, commercial reasons), which is not a default, and its last rating before that was BB.
**Q21.** See the list in the JSON. These are entities that had an LTIDR but whose latest LTIDR on 2026-10-01 is a withdrawal, including E07.
**Q22.** E08. It is the only entity with an RD or D rating (A22).
**Q23.** F2, from A04.
**Q24.** Yes. E01's rating is BBB (A02, affirmed by A03).
**Q25.** 72. Of 113 instruments with a rating on 2026-10-01, 72 are investment grade; expected ratings (EX) are not counted.
**Q26.** A+, from A40.
**Q27.** A-. I06 was assigned A- by A42.
**Q28.** BBB+, from A38. The Country Ceiling of A (A37) is not the sovereign's rating.
**Q29.** None. VD has only a Country Ceiling (A12) and no issuer rating.
**Q30.** See the list in the JSON. These are entities whose FC LTIDR equalled their country's ceiling on 2026-10-01, using the RESEARCH country where records disagree.
**Q31.** No. No FC rating sits above the ceiling of its country.
**Q32.** E09. E11's parent is E10, whose parent is E09, which has no parent.
**Q33.** The holder takes E10's credit risk, rated BBB+. I05 is guaranteed by E10, and E10's latest rating is BBB+ (A27).
**Q34.** No. E12 has no parent and is not linked to E09 or E10.
**Q35.** 3 (E09, E10, E11).
**Q36.** 2 (E02, E04).
**Q37.** 497. This counts distinct LEIs, or the record ID where there is no LEI, excluding QA records.
**Q38.** No. E06 and E13 have different LEIs.
**Q39.** A, from A08 and A09. The Positive outlook does not change the rating.
**Q40.** 79. This counts distinct entities rated on 2026-10-01 and domiciled in GB.
**Q41.** None. E16 is a QA record and is ignored.
**Q42.** LU. The RESEARCH record E17 holds for domicile, overriding E10's DE.
**Q43.** 1.
**Q44.** Yes. I07 pays in XVD, the domestic currency of VD.
**Q45.** No. I07 is rated BBB- (A45) against a ceiling of BB, but local-currency debt is not capped by the ceiling.
**Q46.** No. E11 has only a credit opinion (A46), which is not an issuer rating.
**Q47.** None. I08 has only an expected rating (A47), so it is still unrated.
**Q48.** 113. This counts instruments with a non-withdrawn rating on 2026-10-01 and excludes 9 with EX only.
**Q49.** E5001. The chain from E5047 reaches E5001 at depth 6.
**Q50.** 6.
**Q51.** 58.
**Q52.** 19. This is the group of E5086.
**Q53.** No. RATINGS holds for parent links, so E5062 sits in the E5059 group, while E5086 heads its own group. The RESEARCH record E5168 that points to E5086 is overridden.
**Q54.** E5106, E5124, E5130.
**Q55.** 31.
**Q56.** BB-, held by E5144.
**Q57.** E5002. Both E5011 and E5013 reach it at 2 levels up; the next shared ancestor is E5001.
**Q58.** E5145. It guarantees I5007, which is issued by E5133, in a different group.
**Q59.** 12.
**Q60.** The holder takes E5145's credit risk, and E5145 is not in the same group as the issuer E5133. E5133 sits in the group of E5132, while E5145 heads its own group.
**Q61.** 19. This counts group members whose current FC LTIDR is below BBB-.
```json
{
"Q1":{"rating":"A-"},
"Q2":{"downgraded":"no"},
"Q3":{"investment_grade":"no","rating":"BB+"},
"Q4":{"outlook":"POS"},
"Q5":{"risk_of":"E02","rating":"A"},
"Q7":{"issuers":["E1058","E1167","E1285","E1290","E08","E1112","E1186","E1169","E5116","E1080","E5059","E10","E1160","E1064","E1093","E1151","E1294","E5156","E5019","E5113","E1053","E1057","E1144","E1159","E1243","E1051","E1228","E1229","E1255","E1263","E1307","E1298","E5097","E1163","E1300","E1213","E1034"]},
"Q8":{"entities":["E08"]},
"Q9":{"count":377},
"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":["E1039","E1266","E1059","E1099","E1132","E1260","E1013","E1061","E1297","E1238","E06","E1133","E1181","E1037","E1242","E1317","E1209","E1098","E1126","E1088","E1194","E1267","E1006","E1019","E1264","E1066","E1146","E1203","E1314","E1323","E1109","E1168"]},
"Q19":{"issuers":["E5019","E5113","E5131","E09","E1211","E1046","E5116","E1005","E1080","E1228","E5050","E5073","E5099","E1263","E1105","E1158","E5039","E5156","E1072","E1190","E5013","E5023","E1056","E1282","E1059","E5062","E5020","E5059","E1029","E1160","E1248","E5057","E1034","E1188","E01","E1064","E1118","E1261","E5097","E5102","E1300","E1079","E1271","E5119","E5141","E1055","E1294"]},
"Q20":{"in_default":"no"},
"Q21":{"entities":["E07","E1166","E1021","E1076","E1206","E1219","E1320","E1041","E1063","E1107","E1140","E1138","E1048","E1084","E1244","E1316","E1218","E1007","E1032","E1057","E1155","E1159","E1308","E1253","E1062","E1277","E1121","E1205","E1233","E1200","E1225","E1234","E1124","E1172","E1001"]},
"Q22":{"entities":["E08"]},
"Q23":{"rating":"F2"},
"Q24":{"investment_grade":"yes","rating":"BBB"},
"Q25":{"count":72},
"Q26":{"rating":"A+"},
"Q27":{"rating":"A-"},
"Q28":{"rating":"BBB+"},
"Q29":{"rating":"none"},
"Q30":{"entities":["E1039","E1028","E1126","E1101","E05","E5047","E1236","E5091","E1194","E5116","E5124","E15","E5012"]},
"Q31":{"any":"no"},
"Q32":{"parent":"E09"},
"Q33":{"risk_of":"E10","rating":"BBB+"},
"Q34":{"same_group":"no"},
"Q35":{"count":3},
"Q36":{"count":2},
"Q37":{"count":497},
"Q38":{"same":"no"},
"Q39":{"rating":"A"},
"Q40":{"count":79},
"Q41":{"rating":"none"},
"Q42":{"country":"LU"},
"Q43":{"count":1},
"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":58},
"Q52":{"count":19},
"Q53":{"same_group":"no"},
"Q54":{"entities":["E5106","E5124","E5130"]},
"Q55":{"count":31},
"Q56":{"rating":"BB-"},
"Q57":{"entity":"E5002"},
"Q58":{"entities":["E5145"]},
"Q59":{"count":12},
"Q60":{"risk_of":"E5145","same_group":"no"},
"Q61":{"count":19}
}
```