Documentation Home
MySQL Shell for VS Code


Chapter 6 SQL

This chapter provides examples for common tasks in MySQL Shell for VS Code using SQL. You can run the examples after executing the \sql command in DB Notebooks or GUI Console shell sessions.

Note

The closing semicolon character (;) is optional for individual SQL queries executed using the MySQL Shell for VS Code editors. If you run multiple SQL statements together, a semicolon is required at the end of each statement.

Database samples used in this chapter are:

To set the active schema from a DB Notebook editor, switch to SQL mode (\sql) and execute the USE statement.

sql> USE sakila

To set the active schema from a GUI Console shell session, switch to any mode (\sql, \js, or \py) and issue the \use command.

sql> \use sakila

Press Ctrl+Enter to process each statement or command.

SQL notes

The examples and output represent connections established using MySQL 8.0.31 server.