ExamGecko
Question list
Search
Search

Question 54 - DS0-001 discussion

Report
Export

Which of the following statements contains an error?

A.
Select EmpId from employee where EmpId=90030
Answers
A.
Select EmpId from employee where EmpId=90030
B.
Select EmpId where EmpId=90030 and DeptId=34
Answers
B.
Select EmpId where EmpId=90030 and DeptId=34
C.
Select* from employee where EmpId=90030
Answers
C.
Select* from employee where EmpId=90030
D.
Select EmpId from employee
Answers
D.
Select EmpId from employee
Suggested answer: B

Explanation:

The statement that contains an error is option B. This statement is missing theFROMclause, which specifies the table or tables from which to retrieve data. TheFROMclause is a mandatory clause in aSELECTstatement, unless the statement uses a subquery or a set operator. The correct syntax for option B would be:

SELECT EmpId FROM employee WHERE EmpId=90030 AND DeptId=34

Copy

The other options are either correct or valid SQL statements. For example, option A selects the employee ID from the employee table where the employee ID is equal to 90030; option C selects all columns from the employee table where the employee ID is equal to 90030; option D selects the employee ID from the employee table without any filter condition.Reference:CompTIA DataSys+ Course Outline, Domain 1.0 Database Fundamentals, Objective 1.2 Given a scenario, execute database tasks using scripting and programming languages.

asked 02/10/2024
Barbara Bailey
42 questions
User
Your answer:
0 comments
Sorted by

Leave a comment first