Skip to content

In this project, a store base was designed with preferred entries as store items, while employing the use of select statements to order the items by price, showing at least one statistic about the items.

Notifications You must be signed in to change notification settings

alairdata/Designing-a-Store-Base

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

4 Commits
 
 
 
 

Repository files navigation

Mall Database

This code contains SQL commands to create and populate a database called "mall". The database contains a table called "tospin" that stores information about items sold in a mall.

Prerequisites

In order to run this code, you will need to have an SQL database management system installed, such as MySQL or PostgreSQL.

Installation

  • Download and install an SQL database management system.
  • Copy the code into an SQL script file.
  • Run the script file in the SQL management system to create and populate the "mall" database.

Usage

Once the "mall" database has been created and populated with data, you can use SQL commands to retrieve and manipulate the data as needed. The following SQL commands are included in this code:

  • CREATE DATABASE mall; - creates a new database called "mall"
  • USE mall; - selects the "mall" database to work with
  • CREATE TABLE tospin (id INTEGER PRIMARY KEY, name TEXT, price FLOAT, quantity INTEGER, sales INTEGER); - creates a new table called "tospin" in the "mall" database to store information about items sold in the mall
  • INSERT INTO tospin VALUES (...) - populates the "tospin" table with data about items sold in the mall
  • SELECT max(price) FROM tospin; - retrieves the maximum value of the "price" column from the "tospin" table
  • SELECT min(price) FROM tospin; - retrieves the minimum value of the "price" column from the "tospin" table
  • SELECT avg(price) FROM tospin; - retrieves the average value of the "price" column from the "tospin" table
  • SELECT sum(quantity) FROM tospin; - retrieves the total sum of values of the "quantity" column from the "tospin" table
  • SELECT count(*) FROM tospin WHERE name IS NOT NULL; - retrieves the number of rows in the "tospin" table where the "name" column is not null.

Contributing

If you would like to contribute to this code, please fork the repository and submit a pull request with your changes.

License

This code is licensed under the MIT License.

About

In this project, a store base was designed with preferred entries as store items, while employing the use of select statements to order the items by price, showing at least one statistic about the items.

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published