Given a table created with:
CREATE TABLE simple_tab (col1 VARCHAR PRIMARY KEY);
Which of the following queries will be executed correctly? Select all that apply.
Explanation
VARCHAR in table's definition is equivalent to VARCHAR(1)
Following rules should be kept in mind while working with string literals in most SQL databases:
1. If database tries to insert a value that is longer than specified CHAR or VARCHAR field length - database will try to truncate it to the specified maximum length.
2. Error is returned if symbols other than spaces are truncated.

Follow CodeGalaxy

Mobile Beta

Get it on Google Play
Send Feedback
Cosmo
Sign Up Now
or Subscribe for future quizzes