what have you tried ? please share your code so it can be improved upon..
Are you familiar with dplyr / tidyverse ?
It provides an elegant way to approach data filtering and selection from dataframes(tabular structures).
You can learn a lot very fast from
If you want your input to read from the database and present valid choices to the user then the key way to do that is to include a updateSelectInput function in your server to change the choices argument (https://shiny.rstudio.com/reference/shiny/0.14/updateSelectInput.html). It needs a selectInput set in the ui and matches it by id.