본문 바로가기

SQL69

SQL: Right and Left You are given a table named repositories, format as below: ** repositories table schema ** project commits contributors address The table shows project names of major cryptocurrencies, their numbers of commits and contributors and also a random donation address ( not linked in any way :) ). For each row: Return first x characters of the project name where x = commits. Return last y characters of.. 2022. 7. 13.
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 NULL handling For this challenge you need to create a SELECT statement, this select statement must have NULL handling, using COALESCE and NULLIF. If no name is specified you must replace with [product name not found] If no card_name is specified you must replace with [card name not found] If no price is specified you must throw away the record, you must also filter the dataset by prices greater than 50. eusal.. 2022. 7. 11.
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.
SQL Basics: Simple EXISTS For this challenge you need to create a SELECT statement that will contain data about departments that had a sale with a price over 98.00 dollars. This SELECT statement will have to use an EXISTS to achieve the task. departments table schema id name sales table schema id department_id (department foreign key) name price card_name card_number transaction_date resultant table schema id name Soluti.. 2022. 7. 9.
GROCERY STORE: Real Price! You are the owner of the Grocery Store. All your products are in the database, that you have created after CodeWars SQL exercises! :) Customer often need to now how much really they pay for the products. Manufacturers make different sizes of same product so it is hard to compare prices, sometimes they make packages look big, but the weight of the product is small. Make a SELECT query which will .. 2022. 7. 8.