The script below uses SharePoint Online PowerShell and Client Side Object Model to collect and store site collection information and export it to SQL. To use this script you must install the SharePoint Online Management Shell and ensure that SharePoint Online Client components are also installed on the machine. You would need to provide credentials. The user specified as UserName and possibly the credentials will be added to every site as Site collection Admin. That is a required step because the user may or may not have detailed information available.
Script is available below.