Posts

Showing posts from March 26, 2019

MySQL a query from two tables

Image
1 1 I have 2 tables created with SQL. The first one has an unique id and a name of a provider. The second one has a product name, the amount of that product and the id of the provider. I need a query that gives me the name of each provider and the total sum of the product amount that they have. Ex: CREATE TABLE IF NOT EXISTS provider (id int unique auto_increment primary key, name char(50)); CREATE TABLE IF NOT EXISTS product (id int unique auto_increment primary key, name char(30), provider_id int NOT NULL, amount int NOT NULL); Provider: (id, name) 1 Mike 2 Peter 3 John Product: (id, name, provider_id, amount) 1 RedCar 1 100 2 BlueCar 1 50 3 RedCar 3 35 4 OrangeCar 2 500 5 GreenCar 3 250 Query: Mike 150 Peter 500 John 285 mysql share | improve this question edited Nov 13 '18 at 13:27 Madhur Bhaiya 19.6k 6 22 36 asked Nov 13 '18 at 13:01 Cristian Pacurar Cristian Pacurar 8 4 try this stackoverflow.com/question

List of sports rivalries

Image
A sports rivalry is intense competition between athletic teams or athletes, affecting participants [1] , management [2] and supporters [3] all to verying degrees, with the pressure perhaps felt strongest by the latter. The intensity of the rivalry can range greatly from a friendly/exhibition game and light hearted banter to serious violence. A rivalry that gets out of control can lead to fighting, hooliganism, rioting and some instances with career-ending and even fatal consequences. In "The football war", along with other factors, it was suggested to have been the tipping point in leading to military conflicts [4] . Owners have been known to encourage rivalries as they tend to improve game attendance and television ratings for rivalry matches [5] . Clubs can reduce fan aggression surrounding rivalry games by acknowledging rather than downplaying the conflict [6] because the rivalry is an integral part of fan identity. [7] Games between two rivals that are based in areas