CREATE TABLE ... **EMPTY** AS SELECT

**Use case**

Create a table with the same structure as SELECT query returns but don't fill it.

**Describe alternatives you've considered**

CREATE TABLE ... AS DESCRIBE (SELECT ...)

\- more consistent but also more clunky.
{
    auto it = tables.find(table_name);
    if (it != tables.end())
        return it->second;
    throw Exception(ErrorCodes::UNKNOWN_TABLE, "Table {}.{} doesn't exist",
                    backQuote(database_name), backQuote(table_name));
}
DatabaseTablesIteratorPtr DatabaseWithOwnTablesBase::getTablesIteratorForBackup(const BackupEntriesCollector & backup_entries_collector) const
{
    
    
    auto skip_internal_tables = [](const String & table_name) { return !table_name.starts_with(".inner_id."); };
    return getTablesIterator(backup_entries_collector.getContext(), skip_internal_tables);
}
void DatabaseWithOwnTablesBase::checkCreateTableQueryForBackup(const ASTPtr &, const BackupEntriesCollector &) const
{
}
void DatabaseWithOwnTablesBase::createTableRestoredFromBackup(const ASTPtr & create_table_query, const RestorerFromBackup & restorer)
{
    
    restorer.executeCreateQuery(create_table_query);
}
}