Reviewed by Aditya Kumar · Last reviewed 2026-03-24
**PostgreSQL**: CREATE TABLE new_t (LIKE old_t INCLUDING ALL); **Structure only**: CREATE TABLE new_t (LIKE old_t); **Zero rows**: CREATE TABLE new_t AS SELECT * FROM old_t WHERE 1=0; **SQL Server**: SELECT * INTO new_t FROM old_t WHERE 1=0. **Storage**: INCLUDING STORAGE for...
PostgreSQL: CREATE TABLE new_t (LIKE old_t INCLUDING ALL); Structure only: CREATE TABLE new_t (LIKE old_t); Zero rows: CREATE TABLE new_t AS SELECT FROM old_t WHERE 1=0; SQL Server: SELECT INTO new_t FROM old_t WHERE 1=0. Storage: INCLUDING STORAGE for PostgreSQL. Some systems: CREATE TABLE new_t AS SELECT * FROM old_t LIMIT 0.
Red Flag: Forgetting indexes/constraints—structure differs. Pro-Move: 'We used CREATE TABLE ... (LIKE ... INCLUDING DEFAULTS INCLUDING CONSTRAINTS) for test fixtures.'
According to DataEngPrep.tech, this is one of the most frequently asked SQL interview questions, reported at 1 company. DataEngPrep.tech maintains an editor-reviewed database of 1,863 data engineering interview questions across 7 categories.