Art Gallery Dbms Project

Download as docx, pdf, or txt
Download as docx, pdf, or txt
You are on page 1of 5

ART Gallery Database Management System

~ DHRUV
SAHGAL
210283
CSE-2 BATCH 2021

This art gallery management system project helps the owner of the art gallery to maintain the details of
the artists, paintings, clients, orders, stock etc.

Entity Description-
Artist- This has the details of the artists.
Attributes- name, birthplace, style, age artist_id, style

Employee-this entity represents the details about the employees manages painting.
Attributes-Confirmation,Phone,Date,Price,Customer_id,Painting_id,order_id

Customer-this entity has details about customers who manages.


Attributes-amount Spent,Address,Contact,Customer_id,Name

Painting-this entity has painting details of artist who made it.


Attributes-Price,Painting id, Type,Unique title,Date

Stock- This entity has details of stock of paintings.


Attributes-stock_id,Quantity

Order-This entity has details of painting and customer who orders paintings.
Attributes- Order_id,Painting_id,Customer_id,Price,Date,Phone,Confirmation

Entity-Relationship details:
-Paintings have employees to manage them.
-Paintings have their respective stocks.
-Artists paint the painting.
-Employees manage stock of Art gallery.
-Customer places order from Art gallery.
-Customers can view the paintings.
-Paintings in stock
ER Model

SCHEMA
NORMALISATION
CUSTOMER-
FUNCTIONAL DEPENDENCY
Customer(Amount Spent,Address,Contact,Customer_id,Name)
Cust_id Liking,Total amount,Spent on gallery,Address,Contact,Cust_id,Name
Customer data is in 3NF.
ARTIST-
FUNCTIONAL DdEPENDENCY
Artist(Artist name, Artist_id, Type, Contact No. ,Email_id, style of Art)
Artist _id ,Artist name,Type, Contact No. ,Email_id, style of Art
Artist data is in 3NF.

PAINTING-
FUNCTIONAL DEPENDENCY
Painting(Price,Painting_id,Type,title,Date)
Painting_id (Painting_id,Type,Unique title,Date)
Painting data is in 3NF.

STOCK-
FUNCTIONAL DEPENDENCY
stock(stock_id,Quantity)
(Stock_id Quantity)
Stock data in 3NF.
ORDER-
FUNCTIONAL DEPENDENCY
Order (Order_id,Painting_id,Customer_id,Price,Date,Phone)
Order_id ( Order_id,Painting_id,Customer_id,Price,Date,Phone)
Order data is in 3NF.

MANAGES-
FUNCTIONAL DEPENDENCY
Manages(Painting-id,Employee_id)
(Painting-id,Employee_id)
Manages data is in 3NF.

SQL QUERIES
What are the various entities and their attributes?
Create table ARTIST(
Artist_id varchar(100) NOT NULL,
Name varchar(100),
Birthplace varchar(100),
Age varchar (100),Style varchar(100),
PRIMARY KEY (Artist_id));

CREATE TABLE Employee(


E_id varchar(100) NOT NULL,
Name varchar(100),
Age integer,
Address varchar(100),
Salary varchar(100),
Contact_no varchar(100),
PRIMARY KEY(E_id));

CREATE TABLE PAINTING(


Paint_id varchar(100) NOT NULL,
Price varchar(100), Title varchar(100),
Type varchar(100), Year varchar(100),
PRIMARY KEY(Paint_id));

CREATE TABLE Customer(


Cust_id varchar(100) NOT NULL,
name varchar(100),
Address varchar(100),
SpentonGalllery float(5),
Contact varchar(100),
PRIMARY KEY(Cust_id));

CREATE TABLE Stock(


Stock_id varchar(100) NOT NULL,
E_id varchar(5),
Quantity varchar(20),
Paint_id varchar(100),
PRIMARY KEY(Stock_id),
FOREIGN KEY(Paint_id) REFERENCES PAINTING(Paint_id),
FOREIGN KEY(E_id) REFERENCES EMPLOYEE(E_id));

CREATE TABLE manages(


Paint_id varchar(100) NOT NULL,
E_id varchar(100),
PRIMARY KEY(Paint_id,E_id),
FOREIGN KEY(Paint_id) REFERENCES PAINTING(Paint_id),
FOREIGN KEY(E_id) REFERENCES EMPLOYEE(E_id));

CREATE TABLE Orderr (


Order_id varchar(100) NOT NULL,
Painting_id varchar(100),
Customer_id varchar(100),
Price float(2),
Datee varchar(100),
Phone varchar(100),
Stock_id varchar(100),
PRIMARY KEY(Stock_id),
FOREIGN KEY(Customer_id) REFERENCES Customer(Cust_id));

You might also like