0% found this document useful (0 votes)
255 views14 pages

DBMS Project 2020

This document describes the data requirements for an ArtBase company that builds a product for art galleries. It outlines the key entity types (galleries, artists, artwork pieces, customers), their attributes and relationships. Galleries store information about artists, artworks and customer purchases. Artworks can belong to multiple groups. The document also provides sample SQL queries to retrieve information from the database tables modeled after this data.

Uploaded by

Aman Agarwal
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
255 views14 pages

DBMS Project 2020

This document describes the data requirements for an ArtBase company that builds a product for art galleries. It outlines the key entity types (galleries, artists, artwork pieces, customers), their attributes and relationships. Galleries store information about artists, artworks and customer purchases. Artworks can belong to multiple groups. The document also provides sample SQL queries to retrieve information from the database tables modeled after this data.

Uploaded by

Aman Agarwal
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 14

Database Management System

Submitted to: Submitted By:


Prof. Rinku Dixit
Aman Agarwal (19309)
Arpit Kakkar (19313)
Dipanshu Khandelwal (19320)
Shipra Sinha (19349)
Shreyans Jain (19350)

1|Page
New Delhi Institute of Management
Database Management Systems
Group Project
Project-B: ArtBase Company
Max Marks: 20
Following is a case study describing the data requirements for an ArtBase company, that builds a
product for art galleries and the information that galleries need to maintain.
• Galleries keep information about artists, their names (which are unique), birthplaces, age
and style of art.
• For each piece of artwork, the artist, the year it was made, its unique title, its type of art
(e.g., painting, lithograph, sculpture, photograph), and its price must be stored.
• Pieces of artwork are also classified into groups of various kinds, for example, portraits,
still lifes, works by Picasso, or works of the 19th century; a given piece may belong to
more than one group. Each group is identified by a name (like those just given) that
describes the group.
• Finally, galleries keep information about customers. For each customer, galleries keep
that person’s unique name, address, total amount of dollars spent in the gallery (very
important!), and the artists and groups of art that the customer tends to like.
Attempt the following Questions.

a) Identify the main entity types of the video rental company.


Gallery
Artist
Artwork_Piece
Customers

b) Choose the primary keys for each (strong) entity type.


Gallery – Gallery_Id
Artist – Artist_Name
Artwork_Piece - Title
Customers – Cust_Name

2|Page
c) Draw an ER diagram for this description.

3|Page
d) Create the tables as identified from the ERD and insert dummy data into it (at least 10
records in each table).

Figure 1Table 1Artist

4|Page
Figure 2Table 2 Artwork_Group

Figure 3Table 3 Artwork_Piece

5|Page
Figure 4Table 4Customers

Figure 5Table 5 Gallery

Figure 6Table 6 Orders

6|Page
e) Execute the following SQL queries on the database created above in SQLite:
1. Display details of all the galleries managed by Artbase company.
SELECT * from Gallery;

2. Display the details of all artists.


select * from Artist;

7|Page
3. Display the details of all artworks whose information is available with the company.
select * from Artwork_Piece;

4. Display the details of the number of artworks according to their types.


select Art_Type, count(Title)as Artworks from Artwork_Piece
group by Art_Type;

8|Page
5. Display the number of paintings available group wise
Select Art_Group , Art_Type,No_of_Paintings from Artwork_Group, Artwork_Piece
WHERE Artwork_Group.Title = Artwork_Piece.Title
And Art_Type = "Painting"

6. Display the list of customers of the company.


select Cust_Name from Customers

9|Page
7. Display the list of details of customers and the painting purchased by them.
SELECT Cust_Name,Title from Orders

8. Display the total money spent customer wise.


SELECT Cust_Name, Amt_Spent_in_mn_Dollar from Orders Order by Cust_Name

10 | P a g e
9. Display the details of customers who have purchased artwork any apart from their
known interest area.
SELECT Customers.Cust_Name, Orders.Title, Customers.Liked_Group, Art_Group
from
Orders,Artwork_Group,Customers where Customers.Liked_Group !=
Artwork_Group.Art_Group
and Customers.Cust_Name = Orders.Cust_Name
AND
Artwork_Group.Title = Orders.Title

10. Display the number of paintings in the gallery for each artist.
select Artist_Name, No_of_Paintings from Artwork_Piece

11 | P a g e
11. Display the artists whose maximum paintings have been sold and the one whose
minimum paintings have been sold.
SELECT Artist_Name, Orders.Title, max(Artwork_Purchased), 'max'
FROM Orders JOIN Artwork_Piece
WHERE Orders.Title = Artwork_Piece.Title
UNION
SELECT Artist_Name, Orders.Title, min(Artwork_Purchased), 'min'
FROM Orders JOIN Artwork_Piece
WHERE Orders.Title = Artwork_Piece.Title

12. Arrange the data of the customers with most profitable customer on top.
SELECT Cust_Name, Amt_Spent_in_mn_Dollar
FROM Orders
ORDER by Amt_Spent_in_mn_Dollar DESC

12 | P a g e
13. Show the number of customers purchasing the painting of the artist who belongs to the
same city/area.
SELECT count(Orders.Cust_Name)
FROM Orders JOIN Customers JOIN Artist JOIN Artwork_Piece
WHERE Customers.Address = Artist.Birthplace AND Orders.Title =
Artwork_Piece.Title
AND Orders.Cust_Name = Customers.Cust_Name

14. Pieces of artwork are also classified into groups of various kinds, for example, portraits,
still lifes, works by Picasso, or works of the 19th century; a given piece may belong to
more than one group, give a list of all such artwork.
select Art_Group from Artwork_Group

15. Display the most popular artwork.


SELECT Title, max(Artwork_Purchased) from Orders

13 | P a g e
16. Display the most popular category of artwork.
SELECT Orders.Title, max(Artwork_Purchased),Art_Type
from Orders JOIN Artwork_Piece
WHERE Orders.Title = Artwork_Piece.Title

17. Display the details of the customer who visits the gallery most often.
SELECT Cust_Name, max(Artwork_Purchased)
FROM Orders

Note: We considered customer visiting most often who buys max number of artworks.

18. Display the details of artwork belonging to the 19th Century.


SELECT*
FROM Artwork_Piece JOIN Artwork_Group
WHERE Art_Group like ("%Works of the 19th Century%")
AND Artwork_Piece.Title = Artwork_Group.Title

14 | P a g e

You might also like