Interactive-sql

Run SQL Interactively in Revealjs Presentation Made with Quarto

Shafayet Khan Shafee

28 May, 2023

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. And to create the database, a SQLite script file was used when rendering the document. Read the extension docs for details.

ERD of HR database

The following database diagram illustrates the HR sample database:

Figure 1: ERD of HR database

Editable Example

And now, you can run all sort of queries from the tables of the HR databases.

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

select * from employees;