Skip to content

Tag: aggregate

Why does this suggested solution prefer a different way of calculating percentages based on aggregations?

I’m working through a problem set from CMU’s public db systems course. I have the following two tables: Order Id CustomerId EmployeeId OrderDate RequiredDate ShippedDate ShipVia Freight ShipName ShipAddress ShipCity ShipRegion ShipPostalCode ShipCountry 10248 VINET 5 2012-07-04 2012-08-01 2012-07-16 3 16.75 Vins et alcools Chevalier 59 rue de l’Abbaye Reims Western Europe 51100 France 10249 TOMSP 6 2012-07-05 2012-08-16 2012-07-10

grouping equal values – aggregate function problem

I’ve created a table that lists venues in which several events take place. The same event in the same venue can have a different price. The last column calculates the total revenue for one venue. venue event totalprice sum Venue A Event A 5 30 Venue A Event A 10 30 Venue A Event B 5 30 Venue A Event

SQL Create a new calculated column based on values of multi rows and cols

I have a data about airline’s booking, using Oracle db, sample is structured as below: Recordlocator is booking code Sequencenmbr: whenever there is a change in booking, it records new status of a booking with higher Sequencenmbr. So the highest Sequencenmbr in the database shows the latest/current status of bookings Sequenceair: is the sequence of flights in bookings, it may