Trying to find a way to use Python or SQL to loop through geodatabases and print the feature classes. I'm not sure what the difference between while and for loops are; I'm brand new to scripting. A point in the right direction would be great.
If you're asking about Esri geodatabases, arcpy.ListFeatureClasses does exactly this given an input workspace (e.g. geodatabase connection).
The code (Python 3) from their example:
import arcpy import os arcpy.env.workspace = "c:/base/gdb.gdb" datasets = arcpy.ListDatasets(feature_type='feature') datasets = [''] + datasets if datasets is not None else  for ds in datasets: for fc in arcpy.ListFeatureClasses(feature_dataset=ds): path = os.path.join(arcpy.env.workspace, ds, fc) print(path)
A while loop is used because we don't know how many items there are so the loop continues until it reaches the last item. A for loop is used when you want to explicitly determine how many times the loop will be executed.