# Onze database

Er is een mooie database die wij kunnen gebruiken voor om oefening mee te gaan maken. Ook wordt deze database gebruikt om de toets die jij gaat krijgen over dit onderwerp.&#x20;

De betreffende database is te bekijken op [gihub](https://github.com/lerocha/chinook-database).

Hieronder het datamodel van de database, deze ga je nog veel gebruiken. Je hoeft er nu nog niet echt naar te kijken.

![](/files/-M93TNjmCF8Kfk5eZcar)

Dit is een database die veel wordt gebruikt voor cursusen. Ik heb voor ons deze database al even op [repl.it](https://repl.it/@chrisvdberg/SQLLitechinook) gezet. Als je inlogd met je account kun je mijn versie dupliseren en zo heb je een 'eigen' versie van de database.&#x20;

## De werkomgeving klaar maken

1. Log in op repl.it met je eigen account.
2. Ga naar de volgende repl.it: [repl.it](https://repl.it/@chrisvdberg/SQLLitechinook)&#x20;

![](/files/-M93VsOteTxDUDt0x4xV)

3\. Druk op de Fork knop\
4\. Druk op de Run knop

![](/files/-M93WK9BxTtWhfTVqGZe)

5\. Voer het volgende sql commando even uit om de testen of het werk:

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

6\. Als de output hierop - lijkt werkt het!

```sql
> select * from Artist LIMIT 10;
1|AC/DC
2|Accept
3|Aerosmith
4|Alanis Morissette
5|Alice In Chains
6|Antônio Carlos Jobim
7|Apocalyptica
8|Audioslave
9|BackBeat
10|Billy Cobham
```

*Test deze 2 commando's even die zijn super handig!*&#x20;

```sql
>.schema Customer
```

Dan krijg je de velden in de Tabel.

```sql
CREATE TABLE [Customer]
(
    [CustomerId] INTEGER  NOT NULL,
    [FirstName] NVARCHAR(40)  NOT NULL,
    [LastName] NVARCHAR(20)  NOT NULL,
    [Company] NVARCHAR(80),
    [Address] NVARCHAR(70),
    [City] NVARCHAR(40),
    [State] NVARCHAR(40),
    [Country] NVARCHAR(40),
    [PostalCode] NVARCHAR(10),
    [Phone] NVARCHAR(24),
    [Fax] NVARCHAR(24),
    [Email] NVARCHAR(60)  NOT NULL,
    [SupportRepId] INTEGER,
    CONSTRAINT [PK_Customer] PRIMARY KEY  ([CustomerId]),
    FOREIGN KEY ([SupportRepId]) REFERENCES [Employee] ([EmployeeId]) 
        ON DELETE NO ACTION ON UPDATE NO ACTION
);
CREATE INDEX [IFK_CustomerSupportRepId] ON [Customer] ([SupportRepId]);
```

```sql
.tables
```

Dan krijg je een overzicht van alle tabellen die in de database zijn.

```sql
Album          Employee       InvoiceLine    PlaylistTrack
Artist         Genre          MediaType      Track        
Customer       Invoice        Playlist     
```


---

# Agent Instructions: 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:

```
GET https://metis-montessori-lyceum.gitbook.io/informatica/modules/databases/1-inleiding/onze-database.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
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.
