Company: ZS Associates BTSA

Difficulty: medium

Problem Statement

A database has a "Students" table with columns StudentId, StudentName and Class, where StudentName stores each student's full name. Which query below correctly pulls out just the first name? SELECT SUBSTRING(StudentName, 1, CHARINDEX(' ', StudentName)) FROM Students; SELECT SUBSTRING(StudentName, 0, CHARINDEX(' ', StudentName)) FROM Students; SELECT SUBSTRING(0, StudentName, CHARINDEX(' ', StudentName)) FROM Students; SELECT SUBSTRING(1, StudentName, CHARINDEX(' ', StudentName)) FROM Students; Consider the EMPLOYEES table with these columns and the query shown below it: EMPLOYEES table columns: LAST_NAME VARCHAR2 (25), SALARY NUMBER (8, 2), COMMISSION_PCT NUMBER (6) Query: SELECT LAST_NAME, SALARY * COMMISSION_PCT FROM EMPLOYEES WHERE COMMISSION_PCT IS NOT NULL; Of the three outcomes listed below, how many will actually happen when this query runs? A. It shows salary multiplied by commission_pct B. It leaves out employees whose commission_pct is zero C. It shows zero for employees whos

More ZS Associates BTSA OA questionsInterview experiences