Create a UNIQUE constraint for email
SQL
Easy
6 views
Problem Description
Create table Users(user_id, email, phone). Ensure email is unique and not null.
Output Format
DDL statement(s)
Sample Test Case
Input:
Users(user_id, email, phone)
Constraints
Use standard constraint syntax
Official Solution
CREATE TABLE Users (user_id INT PRIMARY KEY, email VARCHAR(255) NOT NULL UNIQUE, phone VARCHAR(20));
Solutions (0)
No solutions submitted yet. Be the first!
No comments yet. Start the discussion!