Git Product home page Git Product logo

rda_task_1_create_database's Introduction

Database for Online Shop

It's time to build a database for an online shop!

Prerequisites

  1. Install and configure a MySQL database server on a Virtual Machine, connect to it with the MySQL client.
  2. Fork this repository.

Requirements

Edit the task.sql file to create a SQL script for the online shop database. The script should complete the following actions on the database server:

  1. Create a database (schema) called ShopDB.
  2. In the "ShopDB" database, create the following tables:
    • Products, which has the following columns: ID, Name, Description, Price, and WarehouseAmount.
    • Customers, which has the following columns: ID, FirstName, LastName, Email, and Address.
    • Orders, which has the following columns: ID, CustomerID, and Date.
    • OrderItems, which has the following columns: ID, OrderID, and ProductID.

๐Ÿ’ก When creating the tables, take the following into account:

- Use the appropriate data type for each column: `INT`, `DATE`, `VARCHAR(50)`, or `VARCHAR(100)`.
- Use autoincrement for the primary keys.
- Use construction `FOREIGN KEY (<column-name>) REFERENCES <referenced-table-name>(<referenced-column-name>) ON DELETE SET NULL` to connect related tables. The following tables are related: `Orders` and `Customers`, `OrderItems` and `Orders`, `OrderItems` and `Products`.

How to Test Yourself

Just in case you want to test your script on your database before submitting a pull request, you can do it by performing the following actions:

  1. Run the script you wrote in the task.sql on your database server.
  2. Make sure all tables in the database are empty.
  3. Run the test.sql script on your database. If the script execution is finished without errors, you are ready to submit a pull request.

rda_task_1_create_database's People

Contributors

id27182 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.