Skip to content

SQL

{
title: "SQL: create and drop database",
variables: [{ key: "db", prompt: "Database name" }],
structure: {
files: [
{
name: "create_{db.snake}.sql",
content: [
"-- Create the database: {db.raw}",
"CREATE DATABASE IF NOT EXISTS {db.snake};",
"USE {db.snake};",
],
},
{
name: "drop_{db.snake}.sql",
content: [
"-- Delete the database: {db.raw}",
"DROP DATABASE IF EXISTS {db.snake};",
],
},
],
},
}

Enter online shop:

  • Directorydb
    • create_online_shop.sql
    • drop_online_shop.sql
-- Create the database: online shop
CREATE DATABASE IF NOT EXISTS online_shop;
USE online_shop;