Uploaded by THE ELITE

00187502 Htet Aung Khant Kyaw DBAS

advertisement
1
[Databases]
Assignment Title:
[Thukhuma Art Galleria]
Submitted To:
[Daw Sandi Su Hlaing]
Submitted By:
[Htet Aung Khant Kyaw]
[Student ID - 00187502]
NCC L4DBIT: STRATEGY FIRST UNIVERSITY
2
NCC Education
Level 4 Diploma in Business Information Technology
Databases
Centre Name
: Strategy First University
Assignment Title
: Thukhuma Art Galleria
Exam Cycle
: Autumn 2020
Candidate Name
: Htet Aung Khant Kyaw
NCC Education ID No.
: 00187502
Submission Date
: 13/08/2020
Marker’s Comment
:
Moderator’s Comment
:
Mark:
Moderated Mark :
Statement and Confirmation o
f Own Work
Final Mark :
3
STRATEGY FIRST UNIVERSITY
A signed copy of this form must be submitted with every assignment.
If the statement is missing your work may not be marked.
Student Declaration
I confirm the following details:
Htet Aung Khant Kyaw
Candidate Name:
00187502
Candidate ID Number:
Databases
Unit:
Centre:
Strategy First University
Qualification:
Level 4 Diploma in Business Information Technology
I have read and understood NCC Education’s Academic Misconduct Policy.
I confirm that this is my own work and that I have not colluded or plagiarized any part of
it.
Kyaw
Candidate Signature:
13/08/2020
Date:
4
Table of Contents
Task 1 ........................................................................................................................................ 5
Organization Overview: Thukhuma Art Galleria ...................................................................... 5
Data Sample........................................................................................................................... 6
Normalization Tables .............................................................................................................. 9
Normalization for Art_Order table ........................................................................................ 9
Normalization for Artwork table ..........................................................................................10
Normalization for Art_Exhibition table ................................................................................11
Entities & Attributes ...............................................................................................................11
Entity-Relationship Diagram ..................................................................................................12
Data Dictionary for Thukhuma Art Galleria ............................................................................13
Task 2 .......................................................................................................................................17
Creating Tables in the database ............................................................................................17
Inserting Data into the database ............................................................................................21
Performing SQL Queries .......................................................................................................25
Task 3 .......................................................................................................................................27
Database Assessment & Evaluation ......................................................................................27
5
Task 1
Organization Overview: Thukhuma Art Galleria
Thukhuma Art Galleria is an art gallery and exhibition space situated in Yangon that is regarded
as a place where local art projects related to political, social and geographical awareness issues,
are created by artists all over Myanmar. The Galleria has been in operation for eighteen years,
since 2002. The success of the gallery is evident that art is celebrated in Myanmar even though
it is underappreciated by majority of the masses. The target audience of the gallery includes the
foreign expatriates working in Yangon, the art community and the urban hipsters of the city of
Yangon. The purpose of Thukhuma Art Galleria is to support the local artist community and
offering them a helping hand by increasing their exposure to the public and lead the way for future
generation’s budding artists.
The two main routine functions at the art gallery are; Artworks will be displayed at the art
exhibitions and Customers will come and purchase these artworks or rent them. At the Thukhuma
Art Galleria, artists will be creating one or more artworks. Each of the artworks will have one artist.
At one art exhibition, one or more artworks will be on display. Artworks can be ordered and rented
more than once. A customer can rent or order more than one artwork as well but they cannot
place duplicate orders for the artworks.
Currently, Thukhuma Art Galleria is using a paper-based database which is manually maintained.
Not only this consumes a lot of time and consume unnecessary human resources to maintain it,
the current paper-based database has many drawbacks such as data redundancy issues or
duplicate value errors and possibility of accidental data loss. It will be difficult to update, delete,
or insert information into the database because it has to be done manually.
The advantages of using a DBMS for Art Gallery includes reduced data redundancy inside the
database, easy to share data, accurate and consistent data, increased security of data due to
limiting access to certain users, and it will be easy to back up data digitally in order to avoid
unnecessary data loss.
As for future plans, Thukhuma Art Galleria have plans for expansion into other major cities in
Myanmar such as Mandalay, Naypyitaw, Taunggyi, Myitkyina and Bagan.
6
Data Sample
Artist_Info
Artist_ID
FirstName
LastName
Phone_Number Style
artist001
Soe
Aung
091236547
Modern
artist002
Thin
Zaw
091236548
Acrylic
artist003
Moe
Naing
091236549
Oil
Artist_Address
Zip
City
State
Country
456787
Yangon
Yangon
Myanmar
456788
Mandalay
Mandalay
Myanmar
456789
Taunggyi
Shan
Myanmar
Customer_Info
Customer_ID
FirstName
LastName
Phone_Number
customer001
Aung
Hein
095452312
customer002
Oakar
Ko
095452313
customer003
Moe
Moe
095452314
7
Customer_Address
Zip
City
State
Country
787456
Kawthoung
Thanintharyi
Myanmar
787457
Myitkyinar
Kachin
Myanmar
787458
Pathein
Ayeyarwaddy
Myanmar
Exhibition_Info
Exhibition_ID
Exhibition_Name
Exhibition_StartDate Exhibition_EndDate
exhibition001
Freedom_From_Fear 2/2/2020
2/3/2020
exhibition002
My_Country
2/4/2020
2/5/2020
exhibition003
Nature_Landscapes
2/6/2020
2/7/2020
Exhibition_Address
Zip
City
State
Country
456787
Yangon
Yangon
Myanmar
456787
Yangon
Yangon
Myanmar
456787
Yangon
Yangon
Myanmar
8
Artwork
Artwork_I
Year_Mad
D
e
artwork001
2004
artwork002
artwork003
Title
Price
The_Smile
2005
2006
Type
Artist_I
Rental_I
Order_I
D
D
D
artist001
rental001
order001
50000
Acryli
0
c
Starry_Yango
60000
Oil
artist002
rental002
order001
n
0
Human_Bein
70000
Oil
artist003
rental003
order001
g
0
Art_Order
Order_ID
Order_Price
OrderDate
order001
500000
5/2/2020
order002
600000
7/4/2020
order003
700000
11/6/2020
Rental
Rental_ID
Rental_StartDate Rental_EndDate Rental_Price
rental001
3/4/2020
3/5/2020
100000
rental002
4/5/2020
4/6/2020
200000
rental003
5/6/2020
5/7/2020
300000
9
Art_Exhibition
Artwork_ID
Exhibition_ID
artwork001
exhibition001
artwork002
exhibition002
artwork003
exhibition003
Normalization Tables
Normalization for Art_Order table
UNF
3NF
order_id
order_id
order_price
order_price
order_date
order_date
artwork_id
artwork_id*
customer_id
customer_id*
artwork_id
year_made
title
customer_id
firstname
lastname
10
Normalization for Artwork table
UNF
3NF
artwork_id
artwork_id
year_made
year_made
title
title
price
price
type
type
artist_id
artist_id*
rental_id
rental_id*
order_id
order_id*
artist_id
firstname
lastname
rental_id
rental_startdate
rental_enddate
order_id
order_price
order_date
11
Normalization for Art_Exhibition table
UNF
1NF
2NF
artwork_id
artwork_id
artwork_id
exhibition_id
exhibition_id*
artwork_id*
artwork_id*
exhibition_id
exhibition_id
Entities & Attributes
Artist_Info
Artist_Address
Customer_Info
artist_id (PK)
zip
customer_id
firstname
city
firstname
lastname
state
lastname
phone_number
country
phone_number
Exhibition_Info
Exhibition_Address
Customer_Address
exhibition_id
zip
zip
exhibition_name
city
city
exhibition_startdate
state
state
exhibition_enddate
country
country
style
12
Artwork
Art_Order
Rental
artwork_id (PK)
order_id
rental_id
year_made
order_price
rental_startdate
title
order_date
rental_enddate
price
artwork_id
rental_price
type
customer_id
artist_id
rental_id
order_id
Entity-Relationship Diagram
Fig1.1: ER Diagram for Thukhuma Art Galleria’s database
13
Data Dictionary for Thukhuma Art Galleria
Artist_Info
Attributes
Data Type
Field Length
Constraint
artist_id
varchar
10
Primary Key
firstname
varchar
20
Not Null
lastname
varchar
20
Not Null
phone_number
int
10
Not Null
style
varchar
20
Not Null
Attributes
Data Type
Field Length
Constraint
zip
int
10
Primary Key
city
varchar
15
Not Null
state
varchar
15
Not Null
country
varchar
15
Not Null
Attributes
Data Type
Field Length
Constraint
customer_id
varchar
10
Primary Key
firstname
varchar
20
Not Null
lastname
varchar
20
Not Null
phone_number
int
10
Not Null
Artist_Address
Customer_Info
14
Customer_Address
Attributes
Data Type
Field Length
Constraint
zip
int
10
Primary Key
city
varchar
15
Not Null
state
varchar
15
Not Null
country
varchar
15
Not Null
Attributes
Data Type
Field Length
Constraint
exhibition_id
varchar
10
Primary Key
exhibition_name
varchar
20
Not Null
exhibition_startdate
varchar
10
Not Null
exhibition_enddate
varchar
10
Not Null
Attributes
Data Type
Field Length
Constraint
zip
int
10
Primary Key
city
varchar
15
Not Null
state
varchar
15
Not Null
country
varchar
15
Not Null
Exhibition_Info
Exhibition_Address
15
Art_Order
Attributes
Data Type
Field Length
Constraint
order_id
varchar
20
Primary Key
order_price
varchar
10
Not Null
order_date
varchar
10
Not Null
artwork_id
varchar
20
Foreign Key
customer_id
varchar
20
Foreign Key
Attributes
Data Type
Field Length
Constraint
artwork_id
varchar
10
Primary Key
year_made
int
4
Not Null
title
varchar
30
Not Null
price
varchar
20
Not Null
type
varchar
20
Not Null
artist_id
varchar
10
Foreign Key
rental_id
varchar
10
Foreign Key
order_id
varchar
10
Foreign Key
Artwork
16
Rental
Attributes
Data Type
Field Length
Constraint
rental_id
varchar
10
Primary Key
rental_startdate
date
15
Not Null
rental_enddate
date
15
Not Null
rental_price
varchar
30
Not Null
Attributes
Data Type
Field Length
Constraint
artwork_id
varchar
10
Primary Key, Foreign
Art_Exhibition
Key
exhibition_id
varchar
10
Primary Key, Foreign
Key
17
Task 2
Creating Tables in the database
SQL Script for creating a database for Thukhuma Art Galleria
SQL Script for creating Artist_Info table in “thukhuma_art” database
18
SQL Script for creating Artist_Address table in “thukhuma_art” database
SQL Script for creating Customer_Info table in “thukhuma_art” database
19
SQL Script for creating Customer_Address table in “thukhuma_art” database
SQL Script for creating Exhibition_Info table in “thukhuma_art” database
SQL Script for creating Exhibition_Address table in “thukhuma_art” database
20
SQL Script for creating Rental table in “thukhuma_art” database
SQL Script for creating Art_Order table in “thukhuma_art” database
SQL Script for creating Artwork table in “thukhuma_art” database
21
SQL Script for creating Art_Exhibition table in “thukhuma_art” database
Completed tables in “thukhuma_art” database
Inserting Data into the database
SQL code for inserting data into Artist_Info
Retrieve data for Artist_Info table
22
SQL code for inserting data into Artist_Address table
Retrieve data for Artist_Address table
SQL code for inserting data into Customer_Info table,
Retrieve data for Customer_Info table
SQL code for inserting data into Customer _Address
23
Retrieve data for Customer_Address table
SQL code for inserting data into Exhibition_Info
Retrieve data for Exhibition_Info table
SQL code for inserting data into Exhibition_Address
Retrieve data for Exhibition_Address table
24
SQL code inserting data into Rental
Retrieve data for Rental table
SQL code for inserting data into Art_Order
Retrieve data for Art_Order table
SQL code for inserting data into Artwork
25
Retrieve data for Artwork table
SQL code for inserting data into Art_Exhibition table
Retrieve data for Art_Exhibition table
Performing SQL Queries
Query 1 (Select):
26
Query 2 (Update)
Query 3 (Count)
Query 4 (Select Ascending)
27
Task 3
Database Assessment & Evaluation
There are 10 entities that have been identified for the Thukhuma Art Galleria Database. They are
Artist Information, Artist Address, Customer Information, Customer Address, Exhibition
Information, Exhibition Address, Rental, Art Order, Artwork and Art Exhibition. Artist Information
will include attributes such as ID of the artist, first name of the artist, last name of the artist, phone
number of the artist and art style of the artist because this entity is about information of an artist.
Artist Address will include attributes such as zip code of the artist, city of the artist, state of the
artist and country of the artist because this entity is about the address of an artist. Customer
Information will include attributes such as ID of the customer, first name of the customer, last
name of the customer, and phone number of the customer because this entity is about information
of a customer. Customer Address will include attributes such as zip code of the customer, city of
the customer, state of the customer and country of the customer because this entity is about the
address of a customer. Exhibition Information will include attributes such as ID of the exhibition,
name of the exhibition, starting date of the exhibition and ending date of the exhibition because
this entity is about information of an exhibition. Exhibition Address will include attributes such as
zip code of the exhibition, city of the exhibition, state of the exhibition and country of the exhibition
because this entity is about the address of an exhibition. Rental will have attributes such as ID of
the rental, rental starting date, rental ending date and rental price. The Art Order entity will have
attributes such as ID of the order, price of the order, date of the order. The Foreign Keys that will
be linked to this entity are ID of the artwork and ID of the customer. Artwork will have attributes
such as ID of the artwork, the year it was created, the title of the artwork, price of the artwork.
Foreign Keys linked to this entity will be ID of the artist, ID of the rental and ID of the order. The
Art Exhibition entity will have attributes such as ID of the artwork and ID of the exhibition, both of
which are linked foreign keys from other entities.
In the art gallery, the artworks created by the artists will be displayed at art exhibitions and these
artworks either be purchased or rented by the customers.
Download