The Employees table contains six fields. The EmpNum, Rate, and DeptCode fields are numeric. The LastName, FirstName,

Question:

The Employees table contains six fields. The EmpNum, Rate, and DeptCode fields are numeric. The LastName, FirstName, and Status fields contain text. The Status field contains either the letter F (for full time) or the letter P (for part time). The DeptCode field identifies the employee’s department: 1 for Accounting, 2 for Advertising, 3 for Personnel, and 4 for Inventory. 

a. Write a SQL SELECT statement that selects all of the fields and records in the table and then sorts the records in ascending order by the DeptCode field.
b. Write a SQL SELECT statement that selects only the EmpNum, LastName, and FirstName fields from all of the records.
c. Write a SQL SELECT statement that selects only the records for full-time employees.
d. Write a SQL SELECT statement that selects the EmpNum, Rate, and DeptCode fields for employees in the Personnel department.

e. Write a SQL SELECT statement that selects the EmpNum, LastName, and FirstName fields for employees whose last name is Smith. 

f. Write a SQL SELECT statement that selects the EmpNum, LastName, and FirstName fields for employees whose last name begins with the letter S.

g. Write a SQL SELECT statement that selects only the first and last names for part-time employees and then sorts the records in descending order by he LastName field. 

h. Write a SQL SELECT statement that selects the records for employees earning more than $15 per hour and sorts them in ascending order by the Rate field.
i. Write a SQL SELECT statement that selects the records for employees whose Rate field contains a value that is at least $12 but not more than $15.
j. Write a SQL SELECT statement that selects the records for employee numbers 103 and 109.
k. Write a SQL SELECT statement that selects the records matching the Status provided by the user. 

l. Write a SQL SELECT statement that selects the records whose Rate field value is greater than the first amount provided by the user but less than the second amount he or she provides. 

m. Write a SQL SELECT statement that selects records that match both the Status and the DeptCode provided by the user. (For example, if the user provides P and 1, the statement should select only part-time employees in the Accounting department.) 

n. Open the Incor Solution.sln file contained in the VB2017\Chap12\Incor Solution folder. The application is already connected to the Incor.mdf database, and the IncorDataSet has already been created. Start the application to view the records contained in the dataset and then stop the application. Open the DataSet Designer window and then start the TableAdapter Query Configuration Wizard. Open the Query Builder dialog box. Use the Query Builder dialog box to test your SELECT statements from Steps a through m.
o. Now, use the Query Builder dialog box to create a statement that selects only the LastName and FirstName fields for employees whose last name begins with the letter J. Sort the records in ascending order by the last name. If two or more employees have the same last name, those records should be sorted in ascending order by the first name. (You can complete the Sort Type box for more than one field.) What SQL statement appears in the SQL pane? 

p. Finally, use the Query Builder dialog box to create a statement that selects the records for all part-time employees earning more than $11 per hour. (You can complete the Filter box for more than one field.) What SQL statement appears in the SQL pane? 

Fantastic news! We've Found the answer you've been seeking!

Step by Step Answer:

Question Posted: