Write the output produced by the following SQL statement: SELECT LEFT("INDIA",3), RIGHT("Computer Science",4), MID("Informatics",3,4), SUBSTR("Practices",3);
IND, ence, form, actices
Explanation
According to the textbook context: LEFT(string, N) returns N characters from the left side, so LEFT("INDIA",3) = "IND". RIGHT function works similarly from the right side, so RIGHT("Computer Science",4) = "ence". MID(string, pos, n) returns n characters starting from position pos, and the example shows MID("Informatics", 3, 4) = "form". For SUBSTR, the context states "If n is not specified, it returns the substring from the position pos till end of the string", so SUBSTR("Practices",3) returns "actices" (from position 3 to end).
Solution Steps
Step 1: LEFT("INDIA",3) extracts 3 characters from left → IND
Step 2: RIGHT("Computer Science",4) extracts 4 characters from right → ence
Step 3: MID("Informatics",3,4) extracts 4 characters starting from position 3 → form
Step 4: SUBSTR("Practices",3) extracts from position 3 to end → actices