You have two test tables:
Code_innodb as InnoDB engine
Code_ myisam as MYISAM engine
The tables have the same structure:
The tables have one row of data:
You execute an INSERT statement on both code_myisam tables and receive duplicate key
errors:
mysql> INSERT INTO code_innodb VALUES (1, ‘Alpha’), (2, ‘Beta’), (3, ‘charlie,),(4,
‘Delta’);
ERROR 1062 (23000): Duplicate entry ‘3’ for key ‘PRIMARY’
Mysql> INSERT INTO code_myisam VALUES (1, ‘Alpha’), (2, ‘Beta’), (3, ‘charlie’),
(4, ‘Delta’);
ERROR 1062 (23000); Duplicate entry ‘3’ for key ‘PRIMARY’
What is the expected output of the SELECT statements?
A.
Option A
B.
Option B
C.
Option C
D.
Option D
correct is A
I got A.
create table Code_innodb
(
id int(11) not null primary key default 0,
`code` varchar(20) null default null
) engine = InnoDB;
create table Code_myisam
(
id int(11) not null primary key default 0,
`code` varchar(20) null default null
) engine = myisam;
INSERT INTO code_innodb VALUES(3,’charlie’);
INSERT INTO code_myisam VALUES(3,’charlie’);
INSERT INTO code_innodb VALUES (1, ‘Alpha’), (2, ‘Beta’), (3, ‘charlie’),(4, ‘Delta’);
INSERT INTO code_myisam VALUES (1, ‘Alpha’), (2, ‘Beta’), (3, ‘charlie’),(4, ‘Delta’);
select * from code_innodb;
id, code
‘3’, ‘charlie’
select * from code_myisam;
id, code
‘3’, ‘charlie’
‘1’, ‘Alpha’
‘2’, ‘Beta’
A
A
myISAM does not support transactions, A.