Fixed query 7, didn't realize count was already there, wayyyyyyyyyy too sleeeppyyyyyy to see that 😫
This commit is contained in:
parent
02e284ad48
commit
3175ea83b5
@ -127,7 +127,7 @@ SELECT Iname, Pquantity FROM Purchase INNER JOIN Customers ON Purchase.Cno = Cus
|
|||||||
|
|
||||||
7. Create view which shows Iname, Price and Count of all stationary items in descending order of price.
|
7. Create view which shows Iname, Price and Count of all stationary items in descending order of price.
|
||||||
```sql
|
```sql
|
||||||
CREATE VIEW itemView AS SELECT Iname, Iprice, COUNT(*) FROM Items GROUP BY Iname, Iprice ORDER BY Iprice DESC;
|
CREATE VIEW itemView AS SELECT Iname, Iprice, Icount FROM Items ORDER BY Iprice DESC;
|
||||||
SELECT * FROM itemView;
|
SELECT * FROM itemView;
|
||||||
|
|
||||||
```
|
```
|
||||||
|
Loading…
Reference in New Issue
Block a user