Oracle
1Z0-071 · Question #150
Examine the SQL statement used to create the TRANSACTION table. SQL > CREATE TABLE transaction (trn_id char(2) primary key, Start_date date DEFAULT SYSDATE, End_date date NOT NULL); The value 'A1'…
The correct answer is C. INSERT INTO transaction (trn_id, end_date) VALUES ('A1', '10-DEC-2014'). See the full explanation below for the reasoning.
Question
Examine the SQL statement used to create the TRANSACTION table. SQL > CREATE TABLE transaction (trn_id char(2) primary key, Start_date date DEFAULT SYSDATE, End_date date NOT NULL); The value 'A1' does not exist for trn_id in this table. Which SQL statement successfully inserts a row into the table with the default value for START_DATE?
Options
- AINSERT INTO transaction VALUES ('A1', DEFAULT, TO_DATE(DEFAULT+10))
- BINSERT INTO transaction VALUES ('A1', DEFAULT, TO_DATE('SYSDATE+10'))
- CINSERT INTO transaction (trn_id, end_date) VALUES ('A1', '10-DEC-2014')
- DINSERT INTO transaction (trn_id, start_date, end_date) VALUES ('A1', , '10-DEC-2014')
How the community answered
(35 responses)- A3% (1)
- B14% (5)
- C77% (27)
- D6% (2)
Community Discussion
No community discussion yet for this question.