The CREATE TABLE command establishes a fresh table within the database.
In the provided SQL, it generates a table named “Persons” with five columns: PersonID, LastName, FirstName, Address, and City.
CREATE TABLE Persons ( PersonID int, LastName varchar(255), FirstName varchar(255), Address varchar(255), City varchar(255) ); |
This SQL statement creates a new table named “TestTables,” which duplicates two columns from the “Customers” table.
CREATE TABLE TestTable AS SELECT customername, contactname FROM customers; |