Question: SQL questions. Select the appropriate letter/option only. Multiple choice. 1.Which of the following statements identifies the syntax error in this query? select Lastname, Firstname from

SQL questions. Select the appropriate letter/option only. Multiple choice.

1.Which of the following statements identifies the syntax error in this query?

select Lastname, Firstname from charity.donors where Donation > 1000 and; Lastname not in select Lastname from charity.current; 

a. The subquery requires a semicolon prior to the SELECT statement in the WHERE clause.
b. The subquery has an extra semicolon after the AND operator.
c. The subquery must reside inside a HAVING clause.
d. The subquery must reference the same table as the outer query.

2.Which query finds the ID, Job_Title and Salary of all employees who make more than the average of all employees?

partial staff

ID Job_Title Salary
001 Director $163,040
046 Sales Manager $108,255
074 Office Assistant $36,256
085 Service Assistant $29,147

a.
select ID, Job_Title, Salary from staff where Salary > (mean(Salary)); 
b.
select ID, Job_Title, Salary from staffwhere Salary > (select mean(Salary));
c.
select ID, Job_Title, Salary from staff where Salary > (select mean(Salary) from staff);

3.Which query finds the ID, Job_Title and Salary of all employees in the Engineering department?

partial staff

ID Job_Title Salary Department
001 Director $163,040 Sales Management
074 Office Assistant $36,256 Administration
085 Service Assistant $29,147 Engineering

a.
select ID, Job_Title, Salary from staff where ID in (select ID from staff where Department ="Engineering");
b.
select ID, Job_Title, Salary from staff where ID = (select ID from staff where Department ="Engineering");

4.Suppose you need to use the most up-to-date data from a complex query and want multiple users to be able to access the information. Which of the following solutions would be best?

a. Create a table with the complex query and allow users access to the table.
b. Create a view with the complex query and allow users to access the view.
c. Send users the complex query to copy and paste in their queries as an in-line view.

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!