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