Beruflich Dokumente
Kultur Dokumente
Student ID : 000908127
.
D1 Conceptual data model
D2 Logical Data Model
Member (memberID)
Invoice (invoiceNO)
Catalogue(cataID)
Artist(artistID)
Member(memberID,Mname,DOB,ContactNum,address,joinDate,endDate,gender)
Order(orderID,memberID,albumID,price,,invoiceNO)
Invoice(invoiceID,datePurchased,purchasedMethod,totalPrice,)
Album(albumID,artistName,type,albumName,totalprice,CDcount,year)
Song(songID,albumID,artistName,songName,songDuration)
Artist(artistName)
D5 : SQL code for creation and insertion
create table MEMBER
(memberID Number (2),
Mname VARCHAR2(40),
gender char(1),
address VARCHAR2(100),
DOB DATE,
contactNum NUMBER(11),
joinDate DATE,
endDate DATE)
--adding pk and fk
INSERT INTO Album VALUES (3011,'One Direction','Pop Rock', 'Made in the A.M',
'10.99', '12-JULY-2015', '12')
INSERT INTO Album VALUES (3014,'STR','R & B', 'Love Anthem', '10.99', '5-FEB-
2012', '10')
--insert order
INSERT INTO Orders VALUES (00001,04,3014,'10.99','CARD','2-FEB-2017')
Member table
Orders Table
Artist table
Album Table
Catalogue table
Song Table
Invoice table
Order Album
SQL QUERIES and Output of A1,A2,A3,A4 and A5
A1
SELECT type, SUM(CDcount)
FROM ALBUM GROUP BY type;
Output :
A2
SELECT MEMBER.address, Orders.payMethod,(OrderAlbum.orderQua)as "Total
CD" ,Orders.totalprice
FROM MEMBER
INNER JOIN Orders
on MEMBER.memberID = Orders.memberID
INNER JOIN OrderAlbum
on Orders.orderID = OrderAlbum.orderID
Where Orders.memberID=&a AND (Orders.dateOrder='2-FEB-2017')
Output :
A3
SELECT Mname as "FULL NAME",address,endDate
FROM MEMBER
WHERE current_date >=endDATE;
Output :
A4
SELECT SUM(totalprice ) "AMOUNT_SPENT"
FROM Orders, MEMBER
WHERE Orders.memberID= MEMBER.memberID AND MEMBER.memberID =&a
Output :
Output :
D6:
REFLECTION
My name is Cecillia Jane Johnson student of BSC Computing. In this semester, I was assigned to
analysis, design and build of a database structure and applications for Greenwich Music club. This is
an individual assignment .In this case, from the help from my lecturer Puan.Rosmah so I believe that
I have managed to finish my coursework with all the requirements asked from A1 to A5.My lecturer
helped me a lot in this coursework. She have given proper guidance and provide consultations from
time to time, which makes me, clear to continue my work. She also introduce and taught us how to
use MyOra application to complete this coursework. I also joined with my friends and did group
discussion. They also helped me in some parts.Although at first I find difficult to use MyOra and also
some code was showing errors and couldnt insert rows because it keep showing erroe for data type.
Then,I use internet to surf some of the part which I dont understand for example if the executed
statement shows any error I quickly check the solution online and fix the errors. Overall, I have done
this coursework in given time by completing all the requirements