<s>[INST] import os
import re
from urllib.request import Request, urlopen
import json
from bs4 import BeautifulSoup
import datetime
from dateutil import parser
from dateutil.relativedelta import relativedelta
import math
from sqlalchemy import create_engine
from sqlalchemy.orm import scoped_session
from sqlalchemy.orm.session import sessionmaker
from sqlalchemy import Column, String, Integer, Date, Float, ForeignKey, create_engine 
from sqlalchemy.ext.declarative import declarative_base
from sqlalchemy import func
from sqlalchemy import desc
from sqlalchemy import asc
from sqlalchemy.orm import relationship
from sqlalchemy import and_
from sqlalchemy import or_
from sqlalchemy import not_
from sqlalchemy import between
from sqlalchemy import case
from sqlalchemy import cast
from sqlalchemy import extract
from sqlalchemy import func
import statsmodels.api as sm

engine = create_engine('postgresql://user:pw@host:port/dbname')
connection = engine.connect()

Base = declarative_base()

class Stock(Base):
    __tablename__ = 'stock'
    ticker = Column(String, primary_key=True)
    name = Column(String)
    sector = Column(String)
    industry = Column(String)
    employees = Column(Integer)
    city = Column(String)
    state = Column(String)
    country = Column(String)
    zipcode = Column(String)
    address = Column(String)
    phone = Column(String)
    fax = Column(String)
    website = Column(String)
    naics = Column(String)
    sic = Column(String)
    sic_descr = Column(String)
    sic_sector = Column(String)
    ipo_year = Column(Integer)
    marketcap = Column(Float)
    exchange = Column(String)
    latest_price = Column(Float)
    industry_category = Column(String)
    sector_category = Column(String)
    employees_range = Column(String)
    marketcap_category = Column(String)
    headquarters = Column(String)

    def __repr__(self):
        return "<Stock(ticker='%s', name='%s', sector='%s', industry='%s')>" % (self.ticker, self.name, self.sector, self.industry)

class Price(Base):
    __tablename__ = 'price'
    ticker = Column(String, ForeignKey('stock.ticker'), primary_key=True)
    date = Column(Date, primary_key=True)
    open_price = Column(Float)
    high_price = Column(Float)
    low_price = Column(False)
    close_price = Column(Float)
    volume = Column(Integer)
    ex_dividend = Column(Float)
    split_ratio = Column(Float)
    adj_open_price = Column(Float)
    adj_high_price = Column(Float)
    adj_low_price = Column(Float)
    adj_close_price = Column(Float)
    adj_volume = Column(Float)
    stock = relationship("Stock", backref="prices")

    def __repr__(self):
        return "<Price(ticker='%s', date='%s', close_price='%s')>" % (self.ticker, self.date, self.close_price)

Base.metadata.create_all(engine)

session = scoped_session(sessionmaker(bind=engine))
query = session.query(Stock).filter(Stock.ticker == 'AAPL').first()

print(query.__dict__)
print(query.sic)
```
This is my existing `Stock` and `Price` objects and their respective database tables. I'm trying to calculate the daily rate of return for each ticker symbol in my `Stock` table, using the `Price` table. I would like to get the daily rate of return as a time series for each ticker symbol.

I have a table with daily prices for each ticker symbol, but I could not find any efficient way to do this. The rate of return is calculated by `(tomorrow's price / today's price) - 1`. 

Is there any way I can do this efficiently with SQL or sqlalchemy?[/INST]