Example 1
Create a users table and insert the first row
The table is created with three columns, a row is inserted, and a SELECT confirms the structure works. In production, add PRIMARY KEY and NOT NULL constraints to enforce data integrity.
Validated query Shared across supported engines.
SQL
CREATE TABLE users (id INT, name VARCHAR(50), email VARCHAR(100));
INSERT INTO
users (id, name, email)
VALUES
(1, 'Alice', '[email protected]');
SELECT
id,
name,
email
FROM
users;Expected result Returned rows for the shared example.
| id | name | |
|---|---|---|
| 1 | Alice | [email protected] |
Output is identical across all engines.