Vous êtes sur la page 1sur 31

G&C Music Internal Database Design

Syracuse University
Xiaoli Chen
Yuting Guo

Project Summary
G&C is a China-based music label with offices in Shanghai and Beijing. Since 2006, the
company had been working with some of the most talented and inspiring artists from all around
the world. G&C nurtures young music talents by recruiting young artists, help them produce
professional music products, and organize concerts and music festivals.
In the past 8 years, G&C has accumulated a sizable musical asset, at the moment the company
have 60 contacted artists/ bands, who had released collectively 112 full-length records. It also
organizes 2 annual music festivals, 2 large promotional events, hundreds of smaller scale
concerts.
G&C has been using spreadsheets to organize its internal data storage and use, separate
spreadsheets for distinct company assets such as artist, records, concerts and frequent
collaborating venues. Now that the company is scaled up due to the number of asset and product
its managing, G&C decide to start using relational database to improve its daily practice and
make better use of historical data. Additionally, the company want to start tracking the ticket sell
of each concert, to gain valuable insights in order to assist future promotional activities.
The idea for the relational database is to identify and arrange relevant data in a better
way. The solution will need to capture details regarding the artists who are managed by G&C
(name, country of origin, genre, status, salary range), albums released (title, type, release date,
format, number of records sold, etc.), live shows including concerts and music festivals
organized in the past (title, date, type, basic financial facts), ticket sell situation (ticket purchase
date, category, price, seat), and other information pertain to these basic company asset building
blocks.
The database is designed to be used by internal management purposes, the major user
groups include:
Company executives
Company executives need to overlook the general performance of each part of the
company in order to make strategic decisions, especially the financial facts such
as sponsor relations, recurring costs and revenues.
Company managerial staff
Managers of the company need to work with detailed information within their
scope of responsibility, and the relationship among different areas.
Company employees
Employees who are directly involved with on-site organization will be responsible
for entering data to the database, to keep track of company practices.
The project will begin with an overall evaluation of current practice of G&C, follow with the
identification of the company assets in detail, business rules and management style. The project
will also take into consideration the requirements from newly proposed service and functionality.
With these information the database design team will provide a solution that best fit the
companys needs.

Project ERD
venue
PK

venueID
venueName
country
state
city
capacity

tickets

concert
PK
hold
FK1

has

concertID
concertTitle
date
venueID
type
sells
productionCost
profit

PK

ticketID

FK1

purchaseDate
category
price
seat
concertID

sells

currentSponsor

performance
PK,FK2
PK,FK1

artistID
concertID

includes

has

PK,FK2
PK,FK1

sponsorhipDuration

length

is in

concertSong

performs

PK,FK2
PK,FK1

concertID
songID

sponor

artist
PK

order

artistID
artistName
Country
Genre
Status
YearsActive
salaryRange
contact

has

is performed

song
PK

songID

FK1

albumCatalogueID
songTitle
trackNumber
length
lyrics

album
PK

albumCatalogID

FK1

artistID
albumTitle
releaseDate
type
format
price
sells
totalRevenue

sponsorID
concertID

has

PK

sponorID
sponserName
logo
contactPerson
investment
requirement

Entities and
attributes

Descriptions

artist

Each record/row in the artist entity is an artist identified by a unique ID. The
artists name, country, genre, status, yearsActive, salaryRange, phone and
email are also stored in this table.
yearActive is the time period they are working in the agency.
Status consists of five values, namely active, split-up, on hold, change name
and unknown.

album

Each record/row in the album entity is an album identified by a unique ID,


i.e. albumCatalogueID. The albumTitle, type, releaseDate, format, sleeeArt,
sell and total revenue are also stored in this table.
type refers to the length of the recording and it mainly has the following
three types: EP( extended play), LP(long play) and single.
sleeveArt is the cover of the album. An album may or may not have a
picture as its cover, so it is optional.
sells is the total number of albums which have been sold out.
format refers to whether the album is physical or digital. Since the price of
the physical and digital albums are different, two subtype tables are created
in order to calculate the total revenue. An album can be made into both
physical and digital format, so the relationship between the two subtype
tables is overlap. The format of an album is either physical or digital, so it is
a complete relationship.
An artist can have zero or many albums, and album must be released by one
artist. Therefore it is a one-to-many relationship between artist and album..
ArtistID stored in the album table as foreign key, which associates each
album with its artist.

concert

Each row/record in the concert entity represents a concert which identified by


a unique ID, i.e. concertID. The concertTitle,date, venue, type, length, sells,
productionCost and profit of each concert are also stored in this table.
Type refers to whether the concert is a solo, regular concert or music
festival. So there are three values for type.

performance

Each record/row in the performance entity is a record of an artist who


performs in one concert. It is uniquely defined by artistID and concertID.
The length of each artists performance is also stored in this table.

An artist can perform in zero or many concerts and one concert can have
one or many artists who give performance. Therefore, it is a many-to-many
(M:N) relationship between artist and concert. We then build an
associative entity performance to convert the M:N relationship to two 1:M
relationship.
artistID is stored in the performance table as foreign key, which associates
each performance with its artist.
concertID is stored in the performance table as foreign key, which
associates each performance with the concert.
song

Each record/row in the song entity is a song identified by a unique ID, i.e.
songID. The songTitle, trackNumber, length and lyrics are also stored in this
table.
trackNumber refers to the order of the song in the album.
An album can have one or many songs and a song must be in one album.
Therefore it is a one-to-many relationship.
albumCatalogueID is stored in this table as foreign key, which associates
each song with the album.

concertSong

This entity/table stores information about each performance that involves one
song and a concert. It records the songs performed in a concert. It is uniquely
defined by songID and concertID.
The order of the songs performed in a concert is also stored in this table.
A song can be performed in zero or many concerts and a concert can
include one to many songs. Therefore, it is a many-to-many (M:N)
relationship between song and concert. We then build an associative
entity concertSong to convert the M:N relationship to two 1:M
relationship.
songID is stored in the concertSong table as foreign key, which associates
each song in the song table.
concertID is stored in the concertSong table as foreign key, which
associates each song performed in the concert with the concert in concert
table .

venue

Each record/row in the venue entity is a venue location uniquely identified by the
venueID. Descriptive information about the venue, such as venueName, country,
state, city, street, zip code and capacity of the venue are also stored in this table.

A venue can hold zero or many concerts and a concert must be held in one

venue. Therefore it is a one-to-many relationship.


venueID is stored in the concert table as foreign key, which associates each
concert with its venue.
tickets

Each record/row in the tickets entity is a record of a ticket which is uniquely


identified by the ticketID. The purhaseDate, category, price and seat assigned by
this ticket are also stored in this table.

category refers to the area of the seat designated by the ticket. In some
concert, the seats may not assigned, namely the audience can sit wherever
they want, so seat is optional.
A concert can sell zero or many tickets and a ticket is just for one concert.
Therefore, it is a one-to-many relationship.
concertID is stored in this table as foreign key, which relates the ticket to its
concert. It refers the concertID in the concert table.
sponsor

Each record/row in the sponsor entity represents a sponsor who invested certain
company activity, each uniquely identified by a sponsorID. Name, contact, amount
of investment, requirement, and company logo of the sponsor are stored in the table.

Investment can be financial support or media coverage, the value of


investment in the table refers to the amount of money derived from the
sponsorship.
Requirement refers to the additional requirement of the sponsor, such as the
place of displaying their name and logo, etc.
currrentSponsor

Each record/row in the currentSponsor entity is a record of a sponsor of the current


concert, which is uniquely identified by the sponsorID and the concertID. The
sponsorDuration is also stored in this table.

the sponsorDuration refers to the time period that the agency is obligated to do
advertisement for the sponsor.

An organization can sponsor zero or many concerts and a concert can be


sponsored by zero or many sponsors. Therefore, it is a many-to-many (M:N)
relationship between sponsor and concert. We then build an associative
entity currrentSponsor to convert the M:N relationship to two 1:M
relationship.
concertID is stored in the currrentSponsor table as foreign key, which refers
the concert in concert table .
sponsorID is stored in the currrentSponsor table as foreign key, which refers
the sponsor in sponsor table .

Database System Infrastructure


The database engine used for designing and implementing this database are:
1. Microsoft Visio for database design
2. SQL Server for creating tables and populating contents
3. Microsoft Access for data submission interface and data query report design

SQL Script for Creating Tables and Data Insertion


--Step one Creating Tables-/* create table artist */
create table artist
(
artistID INTEGER
,artistName VARCHAR (100) NOT NULL
,country VARCHAR (20) NOT NULL
,genre VARCHAR (50) NOT NULL
,artistStatus VARCHAR (10) NOT NULL
check ( artistStatus in ('active', 'split up', 'inactive'))
,yearsActive VARCHAR(100) NOT NULL
,salaryRange DECIMAL (8,2) NOT NULL
,contact VARCHAR (40)
constraint artist_PK PRIMARY KEY (artistID),
);
DROP TABLE artist;
/* create table venue */
create table venue
(
venueID INTEGER PRIMARY KEY
,venueName VARCHAR (100) NOT NULL
,country VARCHAR (20) NOT NULL
,venueState VARCHAR (20)
,city VARCHAR (20) NOT NULL
,capacity DECIMAL (5,2) NOT NULL
);
DROP TABLE venue;
/* create table sponsor */
create table sponsor
(
sponsorID INTEGER PRIMARY KEY
,sponsorName VARCHAR(100) NOT NULL
,logoSubmission VARCHAR(20) NOT NULL

check (logoSubmission in ('submitted', 'not submitted'))


,contactPerson VARCHAR(100) NOT NULL
,investment DECIMAL(10,2) NOT NULL
,requirment VARCHAR(100)
);
DROP TABLE sponsor;
/* create table album */
create table album
(
albumCatalogID CHAR(20) PRIMARY KEY
,artistID INTEGER
,albumTitle VARCHAR (200) NOT NULL
,releaseDate DATETIME NOT NULL
,albumType VARCHAR (30)
check (albumType in ('demo', 'full-length', 'compilation', 'single',
'EP', 'split'))
,albumFormat VARCHAR (10)
check (albumFormat in ('digital', 'physical'))
,albumPrice DECIMAL (10,2) NOT NULL
,sells DECIMAL (10,2) NOT NULL
,totalRevenue DECIMAL (10,2) NOT NULL
,constraint album_FK FOREIGN KEY (artistID) REFERENCES artist(artistID),
);
DROP TABLE album;
/* create table song */
create table song
(
songID INTEGER PRIMARY KEY
,albumCatalogID CHAR(20)
,songTitle VARCHAR (200) NOT NULL
,trackNumber CHAR (5) NOT NULL
,trackLength DECIMAL (10,2) NOT NULL
,lyrics VARCHAR (10)
check (lyrics in ('available', 'unavailable'))
,constraint song_FK FOREIGN KEY (albumCatalogID) REFERENCES
album(albumCatalogID),
);
DROP TABLE song;
/* create table concert */
create table concert
(
concertID INTEGER PRIMARY KEY
,concertTitle VARCHAR (100) NOT NULL

,concertDate DATETIME NOT NULL


,venueID INTEGER NOT NULL
,concertType VARCHAR (100)
check (concertType in ('solo', 'festival', 'ceremonial'))
,sells DECIMAL (10,2) NOT NULL
,productionCost DECIMAL (10,2) NOT NULL
,profit DECIMAL (10,2) NOT NULL
,constraint concert_FK FOREIGN KEY (venueID) REFERENCES venue(venueID)
);
DROP TABLE concert;
/* create table ticket */
create table ticket
(
ticketID INTEGER PRIMARY KEY
,purchaseDate DATETIME NOT NULL
,category CHAR(10)
check (category in ('A', 'B', 'C', 'D', 'E', 'F', 'G', 'all access'))
,ticketPrice DECIMAL(10,2) NOT NULL
,seatNumber VARCHAR (10) NOT NULL
,concertID INTEGER
,constraint ticket_FK FOREIGN KEY (concertID) REFERENCES concert(concertID)
);
DROP TABLE ticket;
/* create table currentSponsor */
create table currentSponsor
(
sponsorID INTEGER
,concertID INTEGER NOT NULL
,partnershipDuration DECIMAL (10,2)
,constraint currentSponsor_PK PRIMARY KEY (sponsorId, concertID)
,constraint currentSponsor_FK1 FOREIGN KEY (sponsorID) REFERENCES
sponsor(sponsorID)
,constraint currentSponsor_FK2 FOREIGN KEY (concertID) REFERENCES
concert(concertID)
);
DROP TABLE currentSponsor;
/* create table concertSong */
create table concertSong
(
concertID INTEGER
,songID INTEGER

,concertSongOrder CHAR(5)
,constraint concertSong_PK PRIMARY KEY (concertID, songID)
,constraint concertSong_FK1 FOREIGN KEY (concertID) REFERENCES
concert(concertID)
,constraint concertSong_FK2 FOREIGN KEY (songID) REFERENCES song(songID)
);
DROP TABLE concertSong;
/* create table performance */
create table performance
(
artistID INTEGER
,concertID INTEGER
,performanceLength DECIMAL (10,2) NOT NULL
,constraint performance_PK PRIMARY KEY (artistID, concertID)
,constraint performance_FK1 FOREIGN KEY (artistID) REFERENCES
artist(artistID)
,constraint performance_FK2 FOREIGN KEY (concertID) REFERENCES
concert(concertID)
);
DROP TABLE performance;

--Step two Populating the Tables-/* populate table artist */


insert into artist values('1001', 'Amon Amarth', 'Sweden', 'Viking Metal',
'active', '1988-1992 (as Scum), 1992-present', '20.00', 'Ted Lundstroem');
insert into artist values('1002', 'Rhapsody of Fire', 'Italy', 'Symphonic
Power Metal', 'active', '1993-1995(as Thundercross), 1995-2006(as Rhapsody),
2006-present', '10.00', 'Alex Staropoli');
insert into artist values('1003', 'Kamelot', 'United States', 'Progressive
Power Metal', 'active', '1991-present', '15.00', 'Tommy Karevik');
insert into artist values('1004', 'Turisas', 'Finnland', 'Battle Metal',
'active', '1997-1998(as koylio), 1999-present', '20.00', 'Mathias Nygard');
insert into artist values('1005', 'Alestorm', 'United Kingdom', 'Folk Metal',
'active', '2004-2007(as Battleheart), 2007-present', '16.50', 'Christopher
Bowes');
/* populate table venue */
insert into
'500.00');
insert into
'700.00');
insert into
insert into
'900.00');

venue values('1001', 'Rockfabrik', 'Germany', '', 'Ludwigsburg',


venue values('1002', '013', 'Netherlands', '', 'Tilburg',
venue values('1003', 'Arena', 'Austria', '', 'Wien', '950.00');
venue values('1004', 'Hyde Park', 'United Kingdom', '', 'London',

insert into venue values('1005', 'Soundstage', 'United States', 'MD',


'Baltimore', '120.00');
/* populate table sponsor */
insert into sponsor values('1001', 'TimeOut', 'submitted', 'Kenneth Tan',
'1000.00', 'logo appearance');
insert into sponsor values('1002', 'Converse', 'submitted', 'Nathaniel
Davis', '20000.00', 'general promo');
insert into sponsor values('1003', 'Vans', 'submitted', 'Peter Johnson',
'20000.00', 'general promo');
insert into sponsor values('1004', 'Jaegermeister', 'submitted', 'Wilhelm
Meister', '15000.00', 'on-site sells');
insert into sponsor values('1005', 'Absolut', 'not submitted', 'Pernod
Richard', '30000.00', 'on-site sells');
/* populate table album */
insert into album values('ASH001MCD', '1001', 'Sorrow Throughout the Nine
Worlds', '1996-04-05', 'EP', 'physical', '12.99', '2000.00', '12990.00');
insert into album values('3984144102', '1001', 'Versus the World', '2002-1118', 'full-length', 'physical', '14.49', '13000.00', '94185.00');
insert into album values('LMP0010023CD', '1002', 'Dawn of Victory', '2000-1030', 'full-length', 'physical', '11.99', '20000.00', '119900.00');
insert into album values('SPV260452CD', '1003', 'Silverthorn', '2012-10-26',
'full-length', 'digital', '11.88', '50000.00', '297000.00');
insert into album values('9979822', '1004', 'Stand Up and Fight', '2010-1217', 'single', 'digital', '0.99', '840000.00', '415800.00');
insert into album values('N/A', '1005', 'Black Sails Over Europe', '2009-0327', 'split', 'physical', '9.99', '12000.00', '599940.00');
/* populate table song */
insert into song values('1001', 'ASH001MCD', 'Sorrow Throughout the Nine
Worlds', '1/5', '3.50', 'available');
insert into song values('1002', 'ASH001MCD', 'The Arrival of the Fimbul
Winter', '2/5', '4.26', 'available');
insert into song values('1003', '3984144102', 'Where Silent Gods Stand
Guard', '3/9', '5.47', 'available');
insert into song values('1004', '3984144102', 'Across the Rainbow Bridge',
'5/9', '4.49', 'unavailable');
insert into song values('1005', 'LMP0010023CD', 'Dawn of Victory', '2/10',
'4.47', 'available');
insert into song values('1006', 'LMP0010023CD', 'The Bloody Rage of the
Titans', '6/10', '6.24', 'available');
insert into song values('1007', 'SPV260452CD', 'My Confession', '7/12',
'4.33', 'available');
insert into song values('1009', '9979822', 'Stand Up and Fight', '1/1',
'4.38', 'available');
insert into song values('1010', 'N/A', 'Wolves of the Sea (Pirates of the Sea
cover)', '6/10', '3.33', 'available');
alter table song alter COLUMN lyrics VARCHAR(15);
insert into song values('1004', '3984144102', 'Across the Rainbow Bridge',
'5/9', '4.49', 'unavailable');
/* populate table concert */

insert into concert values('1001', 'Deceiver of the Gods Tour', '2014-09-26',


'1001', 'solo', '1.50', '20.00', '10.00');
insert into concert values('1002', 'Stand Up and Fight Tour', '2013-03-10',
'1004', 'solo', '1.20', '15.00', '05.00');
insert into concert values('1003', 'Paganfest', '2010-11-12', '1002',
'festival', '3.50', '100.00', '150.00');
insert into concert values('1004', 'Wacken Open Air 2014', '2014-7-31',
'1003', 'festival', '800.00', '4000.00', '6500.00');
insert into concert values('1005', 'Dawn of Victory Tour', '2007-01-20',
'1005', 'solo', '1.10', '18.00', '15.00');
/* populate table ticket */
insert into ticket
'N/A', '1001');
insert into ticket
'N/A', '1002');
insert into ticket
'N/A', '1003');
insert into ticket
'1004');
insert into ticket
'1005');

values('9238745', '2014-08-10', 'all access', '24.99',


values('9238746', '2013-01-05', 'all access', '20.49',
values('9238747', '2010-08-28', 'all access', '15.99',
values('9238748', '2014-03-10', 'A', '45.99', 'R8S35',
values('9238749', '2006-12-11', 'C', '21.49', 'R9S12',

/* populate table currentSponsor */


insert
insert
insert
insert
insert
insert
insert
insert
insert
insert

into
into
into
into
into
into
into
into
into
into

currentSponsor
currentSponsor
currentSponsor
currentSponsor
currentSponsor
currentSponsor
currentSponsor
currentSponsor
currentSponsor
currentSponsor

values('1001',
values('1001',
values('1003',
values('1004',
values('1005',
values('1005',
values('1004',
values('1003',
values('1002',
values('1002',

'1001',
'1002',
'1002',
'1002',
'1004',
'1003',
'1003',
'1003',
'1003',
'1005',

'1');
'1');
'3');
'3');
'2');
'2');
'1');
'1');
'2');
'4');

/* populate table concertSong */


insert
insert
insert
insert
insert
insert
insert
insert
insert
insert

into
into
into
into
into
into
into
into
into
into

concertSong
concertSong
concertSong
concertSong
concertSong
concertSong
concertSong
concertSong
concertSong
concertSong

values('1001',
values('1001',
values('1001',
values('1001',
values('1001',
values('1002',
values('1002',
values('1002',
values('1003',
values('1003',

'1001',
'1002',
'1003',
'1004',
'1005',
'1001',
'1002',
'1003',
'1002',
'1004',

'1/16');
'3/16');
'10/16');
'11/16');
'2/21');
'5/21');
'6/21');
'9/21');
'3/10');
'4/10');

/* populate table performance */


insert into performance values('1001', '1001', '45.00');
insert into performance values('1002', '1001', '25.00');

insert into performance values('1003', '1002', '50.00');


insert into performance values('1004', '1003', '45.00');
insert into performance values('1005', '1003', '35.00');
--Step three Displaying the 10 Tables-select
select
select
select
select
select
select
select
select
select

*
*
*
*
*
*
*
*
*
*

from
from
from
from
from
from
from
from
from
from

album
artist
concert
song
concertSong
ticket
sponsor
currentSponsor
venue
performance

SQL Statements for Answering Main Data Question


--Step four Answering Possible Data Questions---Users: the users of our database are the managers or administrative staff
of this music agency.--- Possible data questions
--1. Artist-/* 1a. what are the salary of all the artists in this music agency? */
--The staff in human resources need to know the salary of each artist in
order to credit salary to their bank accounts on a regular basis.
--The HR staff also needs to pull out information if the company want to
increase their salary.
select artistID,artistName, salaryRange
from artist
order by artistName;
--Notes: It is maybe easier for the HR staff to locate a certain artist by
ordering the artists according to their name than their ID.

/* 1b. How many albums each artist has made in this music agency? */
--The amount of the albums the artist has made is an important factor of the
artist's contribution to this agency. And how prodcutive each artist is.
select ar.artistID,artistName,COUNT(al.artistID)'albumNumber'
from artist as ar,album as al
where ar. artistID = al.artistID
group by artistName,ar.artistID;

/* 1c. What are the albums each artist has made in this music agency? */
--The manager or administrative staff may want to know the detailed
information of the album each artist has made as a reference to how popular
the artist is.
select albumTitle, artistName, releaseDate,albumType,albumFormat, albumPrice,
totalRevenue
from artist as ar,album as al
where ar. artistID = al.artistID
order by artistName;

/* 1d. who is the most/least valable artist in terms of profit made by


releasing album? */
select artistName,((SUM(totalRevenue))-salaryRange)'individualProfit'
from artist as ar, album as al
where ar.artistID = al. artistID
group by artistName,salaryRange
order by individualProfit;

--2. Album-/* 2a. what is the total revenue of each album released by this music agency?
*/
--The manger and the administrative staff want to know the profit each album
has generated. It can provide information for them to know the popular album
among the customers and decide the investment of the new albulms.
select albumTitle, artistName, releaseDate,albumType,albumFormat, albumPrice,
totalRevenue
from artist as ar,album as al
where ar. artistID = al.artistID;

/* 2b. what is the most and least profitable album released by this music
agency? */
--It povides the information about the features of the most and least popular
album and the preference of the customers. Thus they can produce new albulm
according to the customers' preference in order to gain more profit.
select albumTitle, artistName, releaseDate,albumType,albumFormat, albumPrice,
totalRevenue
from artist as ar,album as al
where ar. artistID = al.artistID
and totalRevenue = (select max(totalRevenue) from album);
select albumTitle, artistName, releaseDate,albumType,albumFormat, albumPrice,
totalRevenue
from artist as ar,album as al
where ar. artistID = al.artistID
and totalRevenue = (select min(totalRevenue) from album);

--3. Concert-/* 3a. what is the cost and profit of each concert? */
--The data can provide inormation of the factors which may influnce the
profit of the concert. Futher it can offer information as to the plan of
future concerts.
select concertTitle, concertType, productionCost, profit
from concert
order by profit;

--note:It would be beneficail for the manger to see which kind of concerts
are more profitable; the the cost/profit rang of diferent concerts.

select concertTitle, concertType, venueName, country, city, productionCost,


profit
from concert as co, venue as ve
where co.venueID = ve.venueID
order by profit;
--note:It would be useful to see the effect of venue on the profit when the
concert type is the same.

/* 3b. who are/were the artists performing in each concert? */


--The agency needs the lists of the artists who would perform at the concerts
when they advertise the concerts. The agency also needs this when they pay
the artists for their performance.
select concertID, pe.artistID, artistName
from performance as pe, artist as ar
where pe.artistID = ar.artistID
order by concertID;

/* 3c. what are the perormance list of each concert? */


--The working staff of each concerts needs the prformance list to prpare for
the light, stage, music, etc.
select concertID, songTitle,concertSongOrder
from concertSong as cons, song as so
where cons.songID = so.songID
order by cons.concertID;

/* 3d. What are the top three popular concert songs? */


SELECT TOP 3 WITH TIES count(cons.songID)'PerformedTime',cons.songID,
songTitle
FROM concertSong as cons, song as so
where cons.songID = so.songID
group by cons.songID, songTitle
ORDER BY cons.songID;

--4. Create Views-/* 4a. what is the detailed information of all the concerts? */
CREATE view concert_performance_v AS

SELECT co.*, ve.venueName, ve.country, ve.city, ve.capacity, pe. artistID,


ar.artistName, cons.songID, so.songTitle
FROM concert as co, venue as ve, performance as pe, artist as ar, concertSong
as cons, song as so
WHERE co. venueID = ve.venueID
AND co.concertID = pe.concertID
AND pe.artistID = ar.artistID
AND co.concertID = cons.concertID
AND cons.songID = so.songID;
select * from concert_performance_v;

/* 4b. what is the detailed information of all the albums? */


create view album_info_v as
select al.*,artistName, country, genre, so.songID, songTitle,
trackNumber,lyrics
from album as al, artist as ar, song as so
where al.artistID = ar.artistID
and al.albumCatalogID = so.albumCatalogID;
select * from album_info_v;

--5. Transactions--

/* 5a. How to add new record to the performance list of a concert? */


set implicit_transactions on;
begin transaction;
insert into concertSong values ('1003', '1003', '5/10')
insert into performance values('1003', '1003', '35.00');
commit transaction;
select * from concertSong;
select * from performance;

rollback;
select * from concertSong;
select * from performance;

set implicit_transactions off;

Interfaces
Input forms:

1. artist Form

2. album Form

3. song Form

4. concert Form

5. Venue Form

6. ticket Form

7. sponsor Form

8. concertSong Form

9. concertPerformance Form

10. currentSponsor Form

11. artistAlbum Form

12. Concert Performance view Form

13. Album information view Form

Output reports:

1.

2.

3.

4.

5.

6.

7.

8.

9.

10.

11.

12.

Vous aimerez peut-être aussi