Write a query to create a table in SQL.
Asked in the technical interview stage. Create a PostgreSQL table named sql_records for storing records with an identifier, name, amount, status, and creation timestamp. The table should enforce appropriate required fields, valid status values, nonnegative amounts, and uniqueness for a record name and creation timestamp.
record_id, record_name, amount, status, and created_at.amount descending and record_id ascending.| Column | Type | Description |
|---|---|---|
| record_idPK | BIGINT | Unique record identifier |
| record_name | VARCHAR(100) | Name assigned to the record |
| amount | NUMERIC(12,2) | Nonnegative record amount |
| status | VARCHAR(20) | Record state |
| created_at | TIMESTAMPTZ | Timestamp when the record was created |