Create a table ratings(book_id int NOT NULL, stars int NOT NULL CHECK (stars BETWEEN 1 AND 5)), insert (1, 5), and RETURN all columns.
Create a table ratings(book_id int NOT NULL, stars int NOT NULL CHECK (stars BETWEEN 1 AND 5)), insert (1, 5), and RETURN all columns.
Answer
CREATE TABLE ratings ( book_id int NOT NULL, stars int NOT NULL CHECK (stars BETWEEN 1 AND 5) ); INSERT INTO ratings VALUES (1, 5) RETURNING *;