# `fkeys`

_Foreign-key columns of a table_
```syntax
fkeys x    fkeys[x]
```

Where `x` is a table, or the name of a table as a symbol, returns a dictionary that maps foreign-key columns to their tables.
```q
q)f:([x:1 2 3]y:10 20 30)
q)t:([]a:`f$2 2 2;b:0;c:`f$1 1 1)
q)meta t
c| t f a
-| -----
a| j f
b| j
c| j f
q)fkeys t
a| f
c| f
q)fkeys `t
a| f
c| f
```

The key columns of a keyed table are included.
```q
q)fkeys ([k:`f$1 2]v:3 4)
k| f
```

---

[`meta`](meta.md),
[Metadata](metadata.md)
