# SQL

## Recommended Readings

| **Item**                                                              | Links                                                                                                                                                                                                                                                                          |
| --------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
| **Documentation / Tutorials**                                         | <ul><li><a href="https://www.youtube.com/watch?v=YufocuHbYZo">SQL for Beginners</a></li><li><a href="https://online.maryville.edu/online-bachelors-degrees/management-information-systems/careers/">Management Information Systems Careers</a></li></ul>                       |
| <p><strong>Industry /</strong> <br><strong>Case-studies</strong> </p> | <ul><li></li></ul>                                                                                                                                                                                                                                                             |
| **Books**                                                             | <ul><li></li></ul>                                                                                                                                                                                                                                                             |
| **Cheatsheet**                                                        | <p></p><ul><li><a href="https://www.sqltutorial.org/sql-cheat-sheet/"><https://www.sqltutorial.org/sql-cheat-sheet/></a></li><li><strong>Luke Harrison:</strong> <a href="https://websitesetup.org/sql-cheat-sheet/"><https://websitesetup.org/sql-cheat-sheet/></a></li></ul> |

```
select
from
where
order by [desc]
```

## Google Sheets

### [Multiple contains ](https://infoinspired.com/google-docs/spreadsheet/multiple-contains-in-where-clause-in-query/)

```
=QUERY(A1:A,"Select * Where not A Matches '.*AB.*|.*DJ.*' ",1)
=query(C323:C335,"Select C where not C contains 'soccer'")
=QUERY(C:C,"Select C Where not C Matches '.*ezoic.*|.*soccer.*' ",1)

```

### Referencing cells in query&#x20;

```
query(sheet2!A:G,"select A where G contains '"&L3&"'")

=query(SX_Sessions!$B$2:$E$120, 
"select B,D 
where E ='" &B3&"' 
AND C = '"&$B$1&"'")
```

### Hyperlinks

```
=IMPORTXML(B3, "//a/@href")
```


---

# 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://docs.nosleepcreative.com/dev/archive/sql.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.
