Customers' Insurance Rates
Not what you're looking for?
The questions are also in the pdf file.
Question 3. Following a new rule of the company, some customers' insurance rates need to be adjusted. The following query counts the number of such customers.
Select count(*)
From customer
Where (age > 20 and ticketNumber >= 5) or age < 18
Assume that the date distribution of the customer relation is as follows:
Age percentage Ticket number Percentage
0 - 20 10% 0 50%
20 - 40 40% 1 10%
40 - 60 35% 2 20%
> 60 15% 3 15%
4 3%
5 1%
6 0.5%
>6 0.5%
How would you evaluate this query under the following circumstances?
(a) No index.
(b) Only a clustered index on age.
(c) Only a clustered index on ticketNumber.
(d) Separate indices on age and on ticketNumber, clustered on age.
(e) Separate indices on age and on ticketNumber, clustered on ticketNumber.
(f) Separate indices on age and on ticketNumber, both non‐clustered.
Purchase this Solution
Solution Summary
The following solution helps with problems regarding customers' insurance rates.
Solution Preview
Hello
Please find the solution in the attached file.
Thanks
Rajender
1. Select count(*)
From customer
Where (age > 20 and ticketNumber >= 5) or age < 18
2. CREATE CLUSTERED INDEX [ix_Customer_Age] ON [dbo].[Customers]
(
[customer.age] ASC
)
query-->
Select count(*)
From customer
where age<18 or(age>20 and ticketNumber>=5) //here in "and" operation first it is obtained on basis of age and then on basis of ticket no. as age is clustered index
3. ...
Purchase this Solution
Free BrainMass Quizzes
Java loops
This quiz checks your knowledge of for and while loops in Java. For and while loops are essential building blocks for all Java programs. Having a solid understanding of these constructs is critical for success in programming Java.
Basic Networking Questions
This quiz consists of some basic networking questions.
Excel Introductory Quiz
This quiz tests your knowledge of basics of MS-Excel.
C++ Operators
This quiz tests a student's knowledge about C++ operators.
Basic UNIX commands
Use this quiz to check your knowledge of a few common UNIX commands. The quiz covers some of the most essential UNIX commands and their basic usage. If you can pass this quiz then you are clearly on your way to becoming an effective UNIX command line user.