Create table from query with constraints afterward

SQL Hard 2 views
Back to Questions

Problem Description

Create a new table TopCustomers from Orders that stores customer_id and spend, then add a primary key on customer_id.

Input Format

SQL DDL

Output Format

DDL statement(s)

Sample Test Case

Input:
Orders(customer_id, total_amount)
Output:
Table created

Constraints

Create-as-select then alter

Solutions (0)

No solutions submitted yet. Be the first!

Discussion (0)

No comments yet. Start the discussion!

Prev