Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

1 . Personal Insurance, Inc. is a national company that insures homeowners and renters. As a regional manager, you need to be able to use

1. Personal Insurance, Inc. is a national company that insures homeowners and renters. As a regional manager, you need to be able to use the extended management capabilities available through SQL. Create a new query in SQL View based on the ClaimTypes table with the following requirements:
a. Add all fields from the ClaimTypes table to the new query using the asterisk (*) in the SELECT clause.
b. Be sure to end the SQL command with a semicolon (;).
c. Run the query to produce the results shown in Figure 1.
d. Save the query using ClaimTypesQuery as the query name and then close the query.
Figure 1: ClaimTypesQuery Results
2. Open the ClaimsRepQuery in SQL View, and then add the LastName field to the SELECT clause after the FirstName field. Run the query and confirm that the results match those shown in Figure 2. Save and close the ClaimsRepQuery.
Figure 2: ClaimsRepQuery Results
3. Open the TotalCoverageQuery in SQL View. Add a computed field to the SELECT clause (after the Liability field) as described below:
a. The computed field should calculate the total coverage for the insurance policy by adding the Liability and the PropertyDamage field values. (Hint: Enter Liability + PropertyDamage as the computation.)
b. Use TotalCoverage as the name (alias) for this computed field. (Hint: Use the AS clause.)
c. Run the query and confirm that the results match those shown in Figure 3.(Hint: Your records may be in a different order. Only a portion of the query results is shown in Figure 3.)
Save and close the TotalCoverageQuery.
Figure 3: Portion of TotalCoverageQuery Results
4. Open the PremiumCriteriaQuery in SQL View. Add a WHERE clause to the query in the position shown in Figure 4 that restricts retrieval to only those policies where the premium is greater than 2000.(Hint: Figure 4 demonstrates the proper location for the WHERE clause, but it does not show the criteria that should be included in the WHERE clause.) Run the query, and check your results to confirm that eight records meet the criteria. Save and close the PremiumCritieraQuery.
Figure 4: PremiumCriteriaQuery in SQL View
5. Open the CustomerRegionsQuery in SQL View. Add an OR clause to the WHERE clause in the query so that the query retrieves only those records in which the Region field is equal to Northeast or MidAtlantic. (Hint: Currently, the query only retrieves records where the Region field is equal to Northeast.) Run the query and ensure that the results match those shown in Figure 5.(Hint: Your records may be in a different order. Only a portion of the query results is shown in Figure 5.) Save and close the CustomerRegionsQuery.
Figure 5: Portion of CustomerRegionsQuery
6. Open the CustomerCityStateQuery in SQL View. Add an AND clause to the WHERE clause in the query so that the query retrieves only those records in which the State field is equal to PA and the City field is equal to Lansdale. (Hint: Currently, the query only retrieves records in which the State field is equal to PA.) Run the query, then confirm that the results match those shown in Figure 6. Save and close the CustomerCityStateQuery.
Figure 6: CustomerCityStateQuery Results
7. Open the MichiganCountQuery in SQL View. Modify the SELECT clause to count the number of customers that are located in MI.(Hint: Change the SELECT clause to COUNT(CustomerID). Use the AS clause to set the alias of the function result to StateCount. Run the query and confirm that the results match those shown in Figure 7. Save and close the MichiganCountQuery.
Figure 7: MichiganCountQuery Results
8. Open the JoinClaimsClaimRepQuery in SQL View. Add a WHERE clause that joins the Claims table and the ClaimsRep table. The common field in both tables is ClaimRepNumber. You will need to qualify the ClaimRepNumber field in the WHERE clause. Run the query, and confirm that the results match those shown in Figure 8.(Hint: Your records may be in a different order.) Save and close the query.
Figure 8: JoinClaimsClaimRepQuery
9. Open the UmbrellaLiabilityQuery in SQL View. Add a caption to the Coverage field in the SELECT clause. (Hint: Use the AS clause.) Use AddLiability as the caption for the Coverage field. Run the query, and confirm that the last field in the query displays as AddLiability, as shown in Figure 9. Save and close the UmbrellaLiabilityQuery.
Figure 9: UmbrellaLiabilityQuery Results
10. Open the StateSortQuery in SQL View. Modify the query to sort the records in ascending order by the State field. (Hint: Use the ORDER BY clause.) Run the query and confirm that the results match those shown in Figure 10. Save and close the StateSortQuery.
Figure 10: StateSortQuery Results
11. Open the GroupbyStateQuery in SQL View. Modify the query by completing the following tasks:
a. Add the State field to the SELECT statement. The State field should appear before the COUNT(C

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

The Temple Of Django Database Performance

Authors: Andrew Brookins

1st Edition

1734303700, 978-1734303704

More Books

Students also viewed these Databases questions