10 SQL Problems for Database Management

User Generated

bst997

Writing

Description

I've attached a word file that has 10 SQL questions that need to be answered.

Attachment preview

Problem 7.1

Write the SQL code required to list the employee number, last name, first name, and middle initial of all employees whose last names start with Smith. In other words, the rows for both Smith and Smithfield should be included in the listing. Sort the results by employee number. Assume case sensitivity.

Problem 7.2

Using the EMPLOYEE, JOB, and PROJECT tables in the Ch07_ConstructCodatabase, write the SQL code that will join the JOB, EMPLOYEE, and PROJECTtables using common attributes. Display

User generated content is uploaded by users for the purposes of learning and should be used following Studypool's honor code & terms of service.

Explanation & Answer

Attached.

Problem 7.1
Write the SQL code required to list the employee number, last name, first name, and middle
initial of all employees whose last names start with Smith. In other words, the rows for both
Smith and Smithfield should be included in the listing. Sort the results by employee number.
Assume case sensitivity.

SELECT emp_num, emp_lname, emp_fname, emp_initial
FROM employee
WHERE emp_lname Like ‘Smith%’
ORDER BY emp_num;
Problem 7.2
Using the EMPLOYEE, JOB, and PROJECT tables in the Ch07_ConstructCodatabase, write
the SQL code that will join the JOB, EMPLOYEE, and PROJECTtables using common
attributes. Display the attributes shown in the results presented in Figure P7.2, sorted by
project value.

SELECT Project.proj_name, Project.proj_value, Project.proj_balance
FROM Project
INNER JOIN Employee ON Project.proj_name=Employee.proj_name
INNER JOIN Job ON Employee.job_code=Job.job_code;

Problem 7.3
Write the SQL code that will produce the same information that was shown in Problem 2,
but sorted by the employee’s la...


Anonymous
Great! 10/10 would recommend using Studypool to help you study.

Studypool
4.7
Trustpilot
4.5
Sitejabber
4.4

Similar Content

Related Tags