Bazaar SQL practice

0 / 60 solved
Question 1 of 60 Easy

Every customer's name and email

Show the first name, last name and email of every customer.

MySQL Loading database…

Run a query to see the result here.

Tip: SHOW TABLES and DESCRIBE orders work too.
About the database

Bazaar: Indian e-commerce marketplace

Customers, orders, products, sellers, coupons, shipments and reviews from a fictional online store. 30 months of data, from simple SELECTs to window functions. Every customer, seller and brand is fictional.

statesIndian states and union territories with their region.20 rows
citiesCities Bazaar delivers to, with a tier (1 = metro, 3 = small town).51 rows
customersEveryone who has signed up on Bazaar.1,006 rows
categoriesProduct categories. Sub-categories point to a parent category.33 rows
sellersMerchants who list products on Bazaar.80 rows
productsThe product catalogue: price, stock and who sells it.480 rows
couponsDiscount coupons that customers can apply to an order.12 rows
ordersOne row per order placed by a customer.7,677 rows
order_itemsProducts inside each order (one row per product per order).11,897 rows
shipmentsCourier shipment for each order that left the warehouse.7,130 rows
reviewsStar ratings customers left for products.3,244 rows
FAQ

Customers, orders, products, sellers, coupons, shipments and reviews from a fictional online store. 30 months of data, from simple SELECTs to window functions. It has 11 related tables with primary and foreign keys, so you can practise joins the way they work at a real company. All names and data are fictional.

Write MySQL 8 syntax. Functions such as DATE_FORMAT, DATEDIFF, TIMESTAMPDIFF, YEAR, MONTH, IF, IFNULL, CONCAT, GROUP_CONCAT, ROUND, CASE, CTEs and window functions (ROW_NUMBER, RANK, DENSE_RANK, LAG, LEAD, SUM OVER) all work.

When you run a query, your result is compared with the result of the model answer. The number of columns, the rows and the values must match. Column names and aliases do not matter. Row order is only checked when the question asks for a specific order. Decimals are compared to 4 places.

You can run INSERT, UPDATE and DELETE to experiment, but every run starts from a fresh copy of the database, so changes never carry over and you cannot break anything.

Yes. Solved questions, attempts and your last query for each question are saved to your Codeayan account, and your progress shows on your account page.