I am learning some SQL from the book Essential SQLAlchemy by Rick Copeland
I have not really used SQL much, and relied on frameworks like Pandas and Dask for data-processing tasks. As I am going through the book, I realise all the column names of a table are often part of the table attributes, and hence seems they need to be hard-coded, instead of being dealt with as strings. Example, from the book.
#!/usr/bin/env python3
# encoding: utf-8
class LineItem(Base):
    __tablename__ = 'line_items'
    line_item_id = Column(Integer(), primary_key=True)
    order_id = Column(Integer(), ForeignKey('orders.order_id'))
    cookie_id = Column(Integer(), ForeignKey('cookies.cookie_id'))
    quantity = Column(Integer())
    extended_cost = Column(Numeric(12, 2))
    order = relationship("Order", backref=backref('line_items', 
                                                  order_by=line_item_id))
    cookie = relationship("Cookie", uselist=False)
When I work with pandas dataframe, I usually deal with it like
#!/usr/bin/env python3
# encoding: utf-8 
col_name:str='cookie_id'
df[col_name] # To access a column
Is there any way to make the column names in SQL-alchemy dynamic, i.e. be represented (and added to table) purely as strings, and tables be created dynamically with different column names (the strings coming from some other function or even user input etc.), that I can later access with strings as well?
Or is my expectation wrong in the sense somehow SQL is not supposed to be used like that?