<p>For ADA balance, you can use the <code>utxo_view</code> table like this:</p>
<pre class="lang-sql prettyprint-override"><code>select * from utxo_view where
  address = 'addr1w9742z4fewans7ry6cjp95pc4ecv7y54cx298lp5qfw7s9gv8ukrj' ; 
</code></pre>
<p>If you look at how <code>utxo_view</code> is defined, you can probably copy and tweak it so you are looking at the relevant multi_asset tables instead.</p>

CC BY-SA 4.0
2022-08-31T22:08:20.537Z
Thanks for your question. I understand that the utxo_view is for querying the number of ADA. But I still do not get how to get other assets. Could you please provide a rough idea of how to get other assets?
cdt
CC BY-SA 4.0
2022-08-31T22:26:55.143Z
You will need to create a new SQL view (call it say `ma_utxo_view`) that uses the multi asset tables rather than the main tables.
Erik de Castro Lopo
CC BY-SA 4.0
2022-09-01T14:05:18.003Z
I guess something like this, right?

```select multi_asset.name::text, ma_tx_out.*, tx_out.*
from public.multi_asset, public.tx_out, public.ma_tx_out
where multi_asset.id = ma_tx_out.ident and tx_out.id =  ma_tx_out.tx_out_id and
tx_out.address ='addr1w9742z4fewans7ry6cjp95pc4ecv7y54cx298lp5qfw7s9gv8ukrj'```
cdt
CC BY-SA 4.0
2022-09-07T06:50:30.807Z
That seems correct, but I would suggest that you create a view (ie something like the `utxo_view`) and submit that via GH so I can add that as to the default `db-sync` distribution.
Erik de Castro Lopo
CC BY-SA 4.0
2022-08-22T00:55:23.913Z
2022-08-22T00:55:23.913Z
Erik de Castro Lopo
<p>It seems like a simple question, but I was struggling to find the answer.</p>
<p>I am trying to get information of Cardano blockchain from cexplorer database.</p>
<p>Given an address such as 'addr1w9742z4fewans7ry6cjp95pc4ecv7y54cx298lp5qfw7s9gv8ukrj'
How can I get all the assets currently belonging to this address.
(the assets are minted tokens, nfts, amount of ADA, etc)</p>
<p>Thank you very much.</p>

<nft><cardano-db-sync><address><token>
How to get all assets of a certain addresss using SQL on Cexplorer
# How to get all assets of a certain addresss using SQL on Cexplorer

(Asked by: username_0 on 2022-08-21)

It seems like a simple question, but I was struggling to find the answer.

I am trying to get information of Cardano blockchain from cexplorer database.

Given an address such as 'addr1w9742z4fewans7ry6cjp95pc4ecv7y54cx298lp5qfw7s9gv8ukrj'
How can I get all the assets currently belonging to this address.
(the assets are minted tokens, nfts, amount of ADA, etc)

Thank you very much.

**Tags:** nft, cardano-db-sync, address, token

---

## 1 answers

### Answer by username_1 on 2022-08-22. Score: 2

For ADA balance, you can use the utxo_view table like this:
select * from utxo_view where
  address = 'addr1w9742z4fewans7ry6cjp95pc4ecv7y54cx298lp5qfw7s9gv8ukrj' ; 

If you look at how utxo_view is defined, you can probably copy and tweak it so you are looking at the relevant multi_asset tables instead.

> **Comments:**
> **username_0**: Thanks for your question. I understand that the utxo_view is for querying the number of ADA. But I still do not get how to get other assets. Could you please provide a rough idea of how to get other assets?  
> **username_1**: You will need to create a new SQL view (call it say `ma_utxo_view`) that uses the multi asset tables rather than the main tables.  
> **username_0**: I guess something like this, right?  ```select multi_asset.name::text, ma_tx_out.*, tx_out.* from public.multi_asset, public.tx_out, public.ma_tx_out where multi_asset.id = ma_tx_out.ident and tx_out.id =  ma_tx_out.tx_out_id and tx_out.address ='addr1w9742z4fewans7ry6cjp95pc4ecv7y54cx298lp5qfw7s9gv8ukrj'```  
> **username_1**: That seems correct, but I would suggest that you create a view (ie something like the `utxo_view`) and submit that via GH so I can add that as to the default `db-sync` distribution.  

---

