-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathexample-revealjs.qmd
47 lines (32 loc) · 1.57 KB
/
example-revealjs.qmd
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
---
title: "Interactive-sql"
subtitle: "Run SQL Interactively in Revealjs Presentation Made with Quarto"
author: Shafayet Khan Shafee
date: last-modified
date-format: "DD MMM, YYYY"
format: revealjs
filters:
- interactive-sql
databases:
- name: hr
path: "https://raw.githubusercontent.com/shafayetShafee/interactive-sql/main/hr.sql"
- name: hr-not-editable
path: "https://raw.githubusercontent.com/shafayetShafee/interactive-sql/main/hr.sql"
editable: false
---
## HR sample data
Here we will use a sample Database called HR that manages the HR data of the small businesses which is collected from [www.sqltutorial.org](https://www.sqltutorial.org/sql-sample-database/). And to create the database, a SQLite script file was used when rendering the document. Read the [extension docs](https://github.com/shafayetShafee/interactive-sql#using) for details.
## ERD of HR database
The following database diagram illustrates the HR sample database:
![ERD of HR database](hr-SQL-Sample-Database-Schema.png){#fig-erd-hr}
## Editable Example
And now, you can run all sort of queries from the tables of the HR databases.
```{.sql .interactive .hr}
select * from regions;
```
## Not editable example
You can also create "not-editable" code chunk (that is, you simply can run the query but won't be able to edit/modify it) for HR database. And to do this, just use another instance of database under the `database` key in the yaml with a different name and use the option `editable: false`.
## Not editable example
```{.sql .interactive .hr-not-editable}
select * from employees;
```