Back to problems

Create and query an e-commerce schema

SQL · Cvs Health · Medium

Use PostgreSQL for every part of this exercise. There are five deliverables: define a schema, load a fixed sample dataset, and then write three statements that run against that dataset. Schema. Create four tables — products, customers, orders, order_items — choosing the narrowest suitable column types and attaching all of the following: products: product_id is the primary key; neither name nor category may be NULL; price is a DECIMAL(10,2) that must be strictly positive.…

Checking your access…