Question: Suppose you created the following table: CREATE TABLE book ( book _ id SERIAL PRIMARY KEY, book _ name VARCHAR NOT NULL ) ; Which

Suppose you created the following table:
CREATE TABLE book(
book_id SERIAL PRIMARY KEY,
book_name VARCHAR NOT NULL
);
Which of the following INSERT statements uses the NEXTVAL() function correctly to add a new record to the table?
launch database
A.)
INSERT INTO book (book_id, book_name)
VALUES (NEXTVAL('book_book_id_seq'),'Lord of the Rings');
B.)
INSERT INTO book (book_id, book_name)
VALUES (NEXTVAL 'book_book_id_seq','Lord of the Rings');
C.)
INSERT INTO book (book_name)
VALUES (NEXTVAL('book_book_id_seq'),'Lord of the Rings');
D.)
INSERT INTO book (book_id, book_name)
VALUES (NEXTVAL(book_book_id_seq),'Lord of the Rings');

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Programming Questions!