From the course: Master Next.js by Building Scalable Apps with Routing, Databases, and Performance

Unlock this course with a free trial

Join today to access over 25,200 courses taught by industry experts.

Preparing recent order report

Preparing recent order report

In this lecture, we will prepare the report for recent orders in the tabular form, where we will display the buyer's name, purchase date, amount, payment mode, and the purchased products. So we need the sales data from the sales master and the sales transaction as well as the buyer's data linked to the sales master record. So we will get the products and the buyer associated with the particular order. To view the relations practically in the database, let me open the Prisma Studio. It is a tool which offers a really good interface of the database from where you can watch and manage the tables. So let me open the terminal and write the command npx prisma studio and it takes us to the studio opened on the browser. Let me go to the sales master table. And you can see that we have a buyer column where the associated buyers data is available. And the sales transaction column where we have the products associated with the purchase. Now this is because we have added relations between those…

Contents