From 60ae0a331f2727975fd8c6dbda58d5de93a1e574 Mon Sep 17 00:00:00 2001 From: nikita Date: Tue, 17 Dec 2024 15:14:09 +0100 Subject: [PATCH] solved --- create-database.sql | 2 +- task.sql | 8 +++++++- 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/create-database.sql b/create-database.sql index ecd693a..94297dc 100644 --- a/create-database.sql +++ b/create-database.sql @@ -1,4 +1,4 @@ -CREATE DATABASE ShopDB; +CREATE DATABASE IF NOT EXISTS ShopDB; USE ShopDB; CREATE TABLE Products ( diff --git a/task.sql b/task.sql index 0c5b574..040cbed 100644 --- a/task.sql +++ b/task.sql @@ -1,2 +1,8 @@ # Write your SQL code for the database creation here. Good luck! -USE ShopDB; +USE ShopDB; + +CREATE INDEX product_name_idx ON Products (Name); + +CREATE INDEX customer_email_idx ON Customers (Email); + +CREATE INDEX order_customerid_idx ON Orders (CustomerID);