🙏 We need your help! SQLtest.online has no ads and lives only on donations. Even a small amount helps. Donate now →
SQL code copied to buffer
Task 58:

Longer Phones, Email and an Active Flag

SQL Server 2022
The task runs on a small copy of the Customer table: CustomerID, FirstName, LastName and Phone (nvarchar(15), optional), 3 customers. Change the table without recreating it:
- international numbers don't fit: make Phone up to 25 characters, still optional;
- add an optional column EmailAddress, Unicode text up to 50 characters;
- add a required column IsActive of type bit with the default value 1, so that the existing customers become active.
Expected result Columns: 4 · Rows: 6
column_name data_type nullable default_value

Sample rows open after wrong checks: 0 of 2

Write your query below and click "Check it!". Tables are described in the right pane.

Tutorial

By checking a query, you agree that it is stored without your account details and may be included in anonymized datasets, including for AI training. Learn more

The query result will appear here. Ctrl+Enter - Run query