SQLab
LearnPracticeProblemsArenaLeaderboard

SQLab

Practice

Mission 8 / 8

Final test: the first sale

M:N · join × 2 · sum

The last job is to record sales. One customer buys many medicines, and one medicine is bought by many customers. Such a many-to-many link needs a third table in between. No templates here — use what you have learned.

Customers

Create the table mijoz: mijoz_id (bigint, primary key, identity), ism (varchar(100), not null), telefon (varchar(20)).

Preparing the database…