> For the complete documentation index, see [llms.txt](https://metis-montessori-lyceum.gitbook.io/sql-0/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://metis-montessori-lyceum.gitbook.io/sql-0/1-inleiding/onze-database.md).

# Onze database

Er is een mooie database die wij kunnen gebruiken voor om oefeningen mee te gaan maken.&#x20;

De betreffende database is te downloaden via de volgende [link](https://raw.githubusercontent.com/lerocha/chinook-database/refs/heads/master/ChinookDatabase/DataSources/Chinook_Sqlite.sql) (of de [volgende link](https://msa2.sharepoint.com/:f:/s/mml/208/IgDx2YqvIpMiRar5au5sKDpNAYjsfb7wLHCvhEeSdUr0IEQ?e=6XFfvT))

Hieronder het datamodel van de database, deze ga je nog veel gebruiken.&#x20;

![](/files/-MOeolaycro29-uakZhs)

Dit is een database die veel wordt gebruikt voor cursusen. Het is een complete database waarmee je de basis van de SQL taal goed kunt aanleren.

## De werkomgeving klaar maken

Allereerst moeten we een dus de zogenaamde Chinook database gaan importeren. Hiervoor kun je een kant-en-klaar script openen en uitvoeren in sqliteonline. Neem hiervoor de volgende stappen:

1. Kopieer de inhoud van het [volgende bestand](https://raw.githubusercontent.com/lerocha/chinook-database/refs/heads/master/ChinookDatabase/DataSources/Chinook_Sqlite.sql) door eerst op de link te klikken en vervolgens alles te selecteren en te kopiëren:&#x20;
2. Ga naar [https://www.sqliteonline.com](https://www.sqliteonline.com/) Dat scherm ziet er zo uit:

   <figure><img src="/files/FwpZgF3QzyNjaBgjlFdo" alt=""><figcaption></figcaption></figure>
3. Verwijder de zin `SELECT * FROM demo;` en plak nu de inhoud van het script in het venster. Klik vervolgens op **Run**.
4. Met dit script worden nu alle benodigde tabellen gemaakt en gevuld met gegevens. Je scherm moet er dan als volgt uitzien:

<figure><img src="/files/HVG930TsubuPdQYWWoOH" alt="" width="284"><figcaption></figcaption></figure>

5. Je script is al uitgevoerd dus de code mag je nu verwijderen. Vanaf nu kun je op deze plek je SQL queries schrijven en uitvoeren. Je kunt als test de volgende query proberen door het erin te schrijven:

```sql
select * from Artist LIMIT 10;
```

6\. Druk nu op **Run**. Ziet het scherm er als volgt uit, dan heb je alles goed gedaan!

<figure><img src="/files/LAh6W9ocaQcCpF5S5uNF" alt=""><figcaption></figcaption></figure>

{% hint style="info" %}
**LET OP:** Als je om een of andere reden je browserscherm afsluit en opnieuw wilt oefenen, dan moet je het database script eerst opnieuw uitvoeren. Anders heb je de database en de daarbij horende tabellen niet tot je beschikking.
{% endhint %}


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter, and the optional `goal` query parameter:

```
GET https://metis-montessori-lyceum.gitbook.io/sql-0/1-inleiding/onze-database.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
