Download the data, run one script, and check the numbers. About 55 tables and 24 lakh rows, in a database called retailmart. Same steps on Mac and Windows.
Jo video mein bola, yahan nukte mein likha hai.
What I said in the video, written here as key points.
Asli data, apne laptop par. Real data, on your own laptop. Same steps on Mac and Windows.
Once the tools are installed, load the practice data: 55 tables and about 24 lakh rows. It goes into its own database called retailmart. Your practice database stays separate, for the tables you create yourself. Never edit the retailmart tables. The steps are the same on Mac and Windows. Only the way you open the folder differs, and this page shows both.
Mac: double-click. Windows: Extract All.
Download the dataset (about 54 MB) with the button above, or from the Setup page. On Mac, double-click the zip. On Windows, right-click it and choose Extract All. You get a folder that contains two folders: csv and sql.
File ▸ Open Folder ▸ pick select-from-shiraverse-datasetTerminal ▸ New Terminal (Ctrl + `). It opens already inside this folder.Terminal: Select Default Profile ▸ Git Bash. Mac: skip, the default is fine.No cd needed: VS Code starts the terminal inside the folder. You will use this same terminal all course.
We will run everything from VS Code, so the terminal, the files and later your SQL all live in one window. After you unzip, open VS Code and choose File → Open Folder, then pick the select-from-shiraverse-dataset folder. (Or, from any terminal inside that folder, type code .)
Open the terminal with Terminal → New Terminal (shortcut Ctrl + `). It starts inside the folder you opened, so you do not need cd. Type ls: you must see csv and sql.
ls
Windows: the terminal may open as PowerShell. We want Git Bash (it came with Git), because the same commands then work on Windows and Mac. Press Ctrl + Shift + P, type Terminal: Select Default Profile, choose Git Bash, then close the terminal and open a new one. You only do this once. Mac: the default terminal already works, nothing to change.
If you opened a terminal somewhere else instead, go to the folder yourself:
cd ~/Downloads/select-from-shiraverse-dataset ls
Password for user postgres: Type postgres and press Enter. The letters do not show while you type. That is normal.Same command on both. A page called watch-the-load.html opens in your browser by itself and shows your laptop loading it, live. Wait for Setup Complete.
Run this on Mac or Windows. It is the same command:
psql -U postgres -d postgres -f sql/setup_retailmart.sql
On Windows it asks for the password: you will see Password for user postgres:. Type postgres (the password our installer set) and press Enter. The letters do not appear while you type, that is normal. On Mac it does not ask for a password, it just starts. The load takes about a minute. While it works you will see 4 simple steps and one line with an icon for each group of tables, with the rows loaded. Nothing to type, nothing to fix: just wait for the green tick and Setup Complete. This is what a normal run looks like (it prints "Setup Complete" at the end):
==============================================================
๐ RETAILMART - building your practice shop
Sit back. This takes about a minute. Nothing for you to do.
==============================================================
๐พ Step 1 of 4 Database "retailmart" created
๐จ Step 2 of 4 Built 16 almirahs (schemas) and 55 books (tables)
๐ฅ Step 3 of 4 Filling the shelves with data
๐งญ core ................. 960 rows โ
๐ฌ stores ............... 23,200 rows โ
๐ฆ products ............. 1,21,106 rows โ
๐ฅ customers ............ 1,55,000 rows โ
๐ sales ................ 7,80,104 rows โ
๐ฐ finance .............. 40,788 rows โ
๐ hr ................... 1,24,310 rows โ
๐ฃ marketing ............ 4,750 rows โ
๐ง support .............. 10,000 rows โ
๐ web_events ........... 7,00,000 rows โ
๐ supply_chain ......... 38,505 rows โ
๐ loyalty .............. 40,004 rows โ
๐ญ manufacture .......... 15,010 rows โ
๐ต payroll .............. 12,006 rows โ
๐ call_center .......... 50,000 rows โ
๐ audit ................ 80,000 rows โ
๐ฐ finance (more) ....... 1,43,159 rows โ
๐ฅ customers (more) ..... 50,000 rows โ
๐ audit (more) ......... 2,700 rows โ
๐ Step 4 of 4 Adding a short note on every almirah and book
==============================================================
โ
Setup Complete! Connected to retailmart
16 almirahs (schemas) | 55 books (tables) | 23,91,602 pages (rows)
==============================================================
๐ Next, check it: psql -U postgres -d retailmart -c "SELECT count(*) FROM sales.orders;"To start over at any time, run the same command again.
While it runs, a page called watch-the-load.html (it is in the sql folder) opens in your browser by itself. It shows your own laptop loading RetailMart, tile by tile, with the rows counting up, like the animation above. If it does not open, double-click that file.
It rebuilds the retailmart database from scratch.
See 150000? All of RetailMart is there. Mubarak ho!
Run:
psql -U postgres -d retailmart -c "SELECT count(*) FROM sales.orders;"
You should see 150000. On Windows it asks for the password every time you run psql: type postgres and press Enter. On Mac it does not ask. (If any list ever stops with (END) at the bottom, just press q to leave it.) In pgAdmin 4, refresh the server list and you will see the retailmart database with 16 schemas.
could not open file "csv/..." | You are not inside the unzipped folder. List the folder and check you see csv and sql. |
password authentication failed | Use the password you chose during install (postgres for our installer). |
psql not found | Open a new Terminal (Mac) or Git Bash (Windows) window. Still no? See the check page for your system. |
Terminal says PowerShell, or psql is not recognized | Windows: in VS Code press Ctrl+Shift+P, choose Terminal: Select Default Profile, pick Git Bash, then open a new terminal. |
psql not found right after installing | Close VS Code completely and open it again. It picks up the new PATH when it starts. |
| Want to start over | Run the same load command again. It rebuilds retailmart from scratch. |
Tell me exactly what the screen says. Ghabrana nahi.
could not open file "csv/...": you are not inside the unzipped folder. List the folder and check you see csv and sql.password authentication failed: use the password you chose during install (postgres for our installer).psql not found: open a new Terminal (Mac) or Git Bash (Windows) window. Still no? See the check page for Mac or Windows.psql is not recognized: on Windows press Ctrl + Shift + P in VS Code, choose Terminal: Select Default Profile, pick Git Bash, then open a new terminal.psql not found right after installing: close VS Code completely and open it again so it picks up the new PATH.retailmart from scratch.Tell me in the comments. Milte hain agli video mein. Next: a tour of the database.