본문 바로가기

order by12

GROCERY STORE: Logistic Optimisation You are the owner of the Grocery Store. All your products are in the database, that you have created after CodeWars SQL excercises!:) You have reached a conclusion that you waste to much time because you have to many different warehouse to visit each week. You have to find out how many different type of products you buy from each producer. If you take only few items from some of them you will st.. 2022. 7. 16.
SQL Basics: Top 10 customers by total payments amount Overview For this kata we will be using the DVD Rental database. You are working for a company that wants to reward its top 10 customers with a free gift. You have been asked to generate a simple report that returns the top 10 customers by total amount spent ordered from highest to lowest. Total number of payments has also been requested. The query should output the following columns: customer_i.. 2022. 7. 14.
SQL Basics - Monsters using CASE You have access to two tables named top_half and bottom_half, as follows: top_half schema id heads arms bottom_half schema id legs tails You must return a table with the format as follows: output schema id heads legs arms tails species The IDs on the tables match to make a full monster. For heads, arms, legs and tails you need to draw in the data from each table. For the species, if the monster .. 2022. 7. 12.
SQL Basics: Simple JOIN and RANK For this challenge you need to create a simple SELECT statement that will return all columns from the people table, and join to the sales table so that you can return the COUNT of all sales and RANK each person by their sale_count. people table schema id name sales table schema id people_id sale price You should return all people fields as well as the sale count as "sale_count" and the rank as ".. 2022. 7. 10.
GROCERY STORE: Support Local Products You are the owner of the Grocery Store. All your products are in the database, that you have created after CodeWars SQL excercises!:) You care about local market, and want to check how many products come from United States of America or Canada. Please use SELECT statement and IN to filter out other origins. In the results show how many products are from United States of America and Canada respec.. 2022. 7. 7.
Easy SQL: Counting and Grouping Given a demographics table in the following format: ** demographics table schema ** id name birthday race you need to return a table that shows a count of each race represented, ordered by the count in descending order as: ** output table schema ** race count Solution: SELECT race, COUNT(id) FROM demographics GROUP BY race ORDER BY count DESC Result: race count American Indian or Alaska Native 2.. 2022. 6. 29.