> For the complete documentation index, see [llms.txt](https://program.hackyourfuture.dk/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://program.hackyourfuture.dk/course-content/foundation/databases/week1/assignment.md).

# Assignment

Write SQL queries to answer the following:

1. How many tasks are in the task table?
2. How many tasks in the task table do not have a valid due date?
3. Find all the tasks that are marked as done.
4. Find all the tasks that are not marked as done.
5. Get all the tasks, sorted with the most recently created first.
6. Get the single most recently created task.
7. Get the title and due date of all tasks where the title or description contains **database**.
8. Get the title and status (as text) of all tasks.
9. Get the name of each status, along with a count of how many tasks have that status.
10. Get the names of all statuses, sorted by the status with most tasks first.

## How to submit

1. After running your queries in DBeaver, make sure to save them in one script file.
2. Make sure the file is of type `.sql`
3. Add task items as comments before your queries so it is easier to review:

```sql
-- 1. How many tasks are in the task table?
SELECT ... FROM ...;
-- 2. How many tasks in the task table do not have a valid due date?
SELECT ... FROM ...;
-- etc...
```

4. Create a pull request in your assignment repo as usual.


---

# 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://program.hackyourfuture.dk/course-content/foundation/databases/week1/assignment.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.
