human
Considering the provided database schema and associated query, produce SQL code to retrieve the answer to the query. 
###Database Schema: Rank, Nation, Gold, Silver, Bronze, Total
###Question: What is the average silver with more than 0 gold, a Rank of 1, and a Total smaller than 30?
gpt
SELECT AVG Silver FROM table WHERE Gold > 0 AND Rank = 1 AND Total < 30