Write an SQL statement (for the database schema given in Exercise 5.22) to ?re all brokers who lost money in at least 40% of their accounts. Assume that every broker has at least one account. (Hint : De?ne intermediate views to facilitate formulation of the query.)
What will be an ideal response?
```
CREATE VIEW BrokerTotalNumber(Id, Number) AS
SELECT A.BrokerId, COUNT(*)
FROM Account A
GROUP BY A.BrokerId
```
```
CREATE VIEW BrokerLoosingNumber(Id, Number) AS
SELECT A.BrokerId, COUNT(*)
FROM Account A
WHERE A.Gain < 0
GROUP BY A.BrokerId
```
```
DELETE FROM Broker
WHERE Id IN
(SELECT B1.Id
FROM BrokerTotalNumber B1,
BrokerLoosingNumber B2
WHERE B1.Id = B2.Id
AND B2.Number >= 0.4 * B1.Number)
```
You might also like to view...
NumberFormat method ________ returns a String representation of its argument in the specified numeric format.
a. number b. toNumeric c. format d. numeric
Which gradient type blends from the starting point outward in a diamond pattern?
A. reflected B. diamond C. angle D. radial
A ________ is tweet that is visible only to a person's approved Twitter followers
A) Tweeter B) tweet C) protected tweet D) retweet
Critical Thinking QuestionsCase 3-2Your new volunteer position is to work with middle school youth in the computer lab. The Volunteer Coordinator has asked if you would be available to answer student questions during today's lab session. Becky is spell-checking her presentation. PowerPoint has marked a proper name as misspelled; but Becky is sure that the spelling is correct. She asks how to indicate that the word is correctly spelled. You tell her to click the _____ button in the Spelling dialog box. a. Suggestc. Closeb. Changed. Ignore
What will be an ideal response?