Skip to content

Folders and files

NameName
Last commit message
Last commit date

Latest commit

ย 

History

4 Commits
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 

Repository files navigation

๐Ÿ‘จโ€๐Ÿ’ปAuthor: Keabetswe Masole

Software Used: SQL Server Management Studio 20


๐Ÿ“Œ Overview

This project creates a relational database for an art gallery. It stores information about artists, their artworks, associated genres, and exhibitions, allowing efficient data management and retrieval.


๐Ÿง  Database Structure

๐Ÿ“ Tables

-> Artist

  • ArtistID (Primary Key)
  • Artist_Name
  • Artist_Surname

-> Genre

  • GenreID (Primary Key)
  • Genre_Description

-> Artwork

  • ArtworkID (Primary Key)
  • GenreID (Foreign Key)
  • ArtistID (Foreign Key)
  • Title

-> Exhibition

  • ExhibitionID (Primary Key)
  • Exhibition_Description

-> Entry

  • EntryID (Primary Key)
  • ArtworkID (Foreign Key)
  • ExhibitionID (Foreign Key)
  • Supports cascading delete for artworks

โš™๏ธ Features

  • Relational database with multiple linked tables
  • Data insertion, updating, and deletion
  • Use of primary keys and foreign keys
  • Cascading delete functionality
  • Data retrieval using joins, grouping, and filtering

โ–ถ๏ธ How to Run

  1. Open your MySQL
  2. Copy and paste the SQL script
  3. Execute the script
  4. Run the queries to view and analyze the data

๐Ÿ” Sample Queries

๐Ÿ“Œ Display artwork details with artist and genre:

SELECT Artwork.Title, Artist.Artist_Name, Genre.Genre_Description FROM Artwork JOIN Artist ON Artwork.ArtistID = Artist.ArtistID JOIN Genre ON Artwork.GenreID = Genre.GenreID ORDER BY Artwork.Title ASC; --In ascending order

๐Ÿ“Œ Count artworks per exhibition:

SELECT Exhibition_Description, COUNT(*) AS Artwork_Count FROM Entry JOIN Exhibition ON Entry.ExhibitionID = Exhibition.ExhibitionID GROUP BY Exhibition.Exhibition_Description;

๐Ÿ“Œ Artists with 5 or more artworks:

SELECT ArtistID, COUNT() AS Artwork_Count FROM Artwork GROUP BY ArtistID HAVING COUNT() >= 5;


๐Ÿš€ Future Improvements

  • Add customer/visitor table
  • Track artwork sales and pricing
  • Add dates for exhibitions

About

AGD is a SQL project that manages artists, artworks, genres, and exhibitions. It demonstrates relational database design, data manipulation, and query techniques to organize and analyze artwork information within a gallery system.

Topics

Resources

Stars

Watchers

Forks

Releases

Packages

Contributors