college/Spring-2024/CS-1011/Relational-DB-Assignment
2024-05-12 01:18:21 -05:00
..
.gitignore Rename Spring-2023 -> Spring-2024 2024-05-12 01:18:21 -05:00
cmds.sql Rename Spring-2023 -> Spring-2024 2024-05-12 01:18:21 -05:00
README.org Rename Spring-2023 -> Spring-2024 2024-05-12 01:18:21 -05:00
solve.bash Rename Spring-2023 -> Spring-2024 2024-05-12 01:18:21 -05:00

Databases: Relational - In-Class Assignment

You can run the queries in /Price/college/src/branch/Development/Spring-2024/CS-1011/Relational-DB-Assignment/solve.sql against a sqlite3 database to solve this assignment or install Nix and run /Price/college/src/branch/Development/Spring-2024/CS-1011/Relational-DB-Assignment/solve.bash.

Answer the Following Questions With Info From /Price/college/src/branch/Development/Spring-2024/CS-1011/Relational-DB-Assignment/*Tables

  1. What was the total profit across all stores?

    • $34.5
  2. What is the name of the most popular product sold?

    • Toy Story
  3. How much profit did the "East" region make?

    • $13.96
  4. Which city had the highest cost?

    • The city with the highest aggregate cost would be San Francisco.
    • However, the city with the highest single cost would be New York.
  5. What was the least popular product brand?

    • Big Studios, because they had no sales.
  6. Which city (or cities) sold "Sense and Sensibility"?

    • San Francisco

Tables

STORE

Store_key City Region
1 New York East
2 Chicago Central
3 Atlanta East
4 Los Angeles West
5 San Francisco West
6 Philadelphia East

PRODUCT

Product_key Description Brand
1 Beautiful Girls MKF Studios
2 Toy Story Wolf
3 Sense and Sensibility Parabuster Inc.
4 Holday of the Year Wolf
5 Pulp Fiction MKF Studios
6 The Juror MKF Studios
7 From Dusk Till Dawn Parabuster Inc.
8 Hellraiser: Bloodline Big Studios

SALES_FACT

Store_key Product_key Sales Cost Profit
1 6 2.39 1.15 1.24
1 2 16.7 6.91 9.79
2 7 7.16 2.75 4.40
3 2 4.77 1.84 2.93
5 3 11.93 4.59 7.34
5 1 14.31 5.51 8.80