85.0k views
5 votes
Which line in the following SQL statement raises an error?

1. SELECT name, title
2. FROM books JOIN publisher
3. WHERE =
4. AND
5. cost < 45.95
A.line 1
B.line 2
C.line 3
D.line 4
E.line 5

1 Answer

3 votes

Final answer:

Line 3 raises an error because the WHERE clause lacks operands on either side of the '=' operator, resulting in a syntax error.

Step-by-step explanation:

The error in the SQL statement is found in line 3. The correct syntax for a WHERE clause must include a column name or expression followed by a comparison operator and a value or another column. In this case, the WHERE clause simply contains an equals sign '=' without any operands which will raise a syntax error. The line should specify a valid condition, for example, WHERE column_name = value.

User Steve Broberg
by
7.8k points