Creating a Demo Database Before You Start
You will use Adventureworks
as an example because it is a common database used by Microsoft and has just enough complexity to learn about databases topic.
Perform the following steps to do so:
- Open the command line and make a directory where you will call
AdventureWorks
database and move to that directory:C:\<change-with-your-download-path-to-The-C-Sharp-Workshop>\Chapter06\AdventureWorks\>
Note
Replace
<change-with-your-download-path-to-The-C-Sharp-Workshop>
with a directory where you downloaded the The-C-Sharp-Workshop repository. - Create an empty
Adventureworks
database by running the following command in the console:psql -U postgres -c "CREATE DATABASE \"Adventureworks\";"
- Create tables and populate them with data using the installation script.
Note
The installation script is found at https://packt.link/0SHd5.
- Run the following command pointing to the installation script:
psql -d Adventureworks...