Given an empty table created using the following query:
CREATE TABLE simple_tab (col1 varchar(10) primary key);
Which of the following queries will be executed correctly?
Explanation
NULL value cannot be inserted because of a PRIMARY KEY constraint.
'a\'a' is incorrect. Single quotation mark should be escaped using another single quote: 'a''a'.
Some databases (e.g., MySQL) has a mode that allows a backslash escape character, but it is better not to rely on this.

@Kurush Thanks! Added to explanation

2017 Dec 4, 6:20:21 PM

MySQL also allows a backslash escape character.

2017 Dec 4, 12:00:10 PM

SQL
SQL Quiz
Start Quiz

or Read more about SQL Quiz

Follow CodeGalaxy

Mobile Beta

Get it on Google Play
Send Feedback