Hope this helps you ... let's create one table first:
create table prop (custom varchar (max), varchar (max) property)
enter the values โโof prop ('john', 'car'), insert the values โโof prop ('john', 'car'), insert into the values โโof prop ('john', 'house'), insert into the values โโof prop ('peter', ' car '),
enter the values โโof prop ('peter', 'car'), insert the values โโof prop ('amanda', 'house'), insert the values โโof prop ('amanda', 'house')
1) how many times was the car purchased?
ANS: select count (property) from prop, where property = 'car' (4)
2) How many times has the car been bought twice?
ANS: select user, COUNT (property) from prop, where property = 'car' group by user having COUNT (property) = 2
2-John 2-Peter
3) How many times have I bought a house?
ANS: select COUNT (property) from prop, where property = 'house' (3) 4) How many times has the house been bought twice? ANS: select the user, COUNT (property) from prop, where property = 'house' group the user having COUNT (property) = 2 2-Amanda 1-John