Can you add a customer with an existing name?
In the iv_customers table, id is declared as PRIMARY KEY, and name is defined as VARCHAR(50) NOT NULL. The table already contains a customer named Alice with id = 1. A query now inserts another customer named Alice, but with a different ID. Will the insert succeed, and what will the final statement return?
Predict the resultDDL, keys, and normalizationJuniorBackendQAData Engineer
Input data · iv_customers
| id | name | city |
|---|---|---|
| 1 | Alice | Berlin |
| 2 | Bob | Paris |
| 3 | Carol | NULL |
| 4 | Dan | Berlin |
| 5 | Eve | Paris |
Query
INSERT INTO iv_customers (id, name, city)
VALUES (6, 'Alice', 'Paris');
SELECT id,
name,
city
FROM iv_customers
WHERE name = 'Alice'
ORDER BY id