Change column type with caution
SQL
Medium
2 views
Problem Description
In Customers table, phone is stored as INT but you want to keep leading zeros and '+' sign. Change phone column to VARCHAR(20).
Output Format
DDL statement(s)
Sample Test Case
Input:
Customers(phone INT)
Constraints
Assume PostgreSQL-style ALTER syntax
Official Solution
ALTER TABLE Customers ALTER COLUMN phone TYPE VARCHAR(20);
Solutions (0)
No solutions submitted yet. Be the first!
No comments yet. Start the discussion!