Academic Integrity: tutoring, explanations, and feedback — we don’t complete graded work or submit on a student’s behalf.

Homework 5 DDL 1) 2) ALBUMS Using the description below write the DDL to create

ID: 3600725 • Letter: H

Question

Homework 5 DDL 1) 2) ALBUMS Using the description below write the DDL to create the definitions necessary Modify the above DDL to be able to easily access which off the albums have a specific song on it. Music Cat# EK-38308 LPM-2256 LSP-246 M16014 7499-2256 945024-2 Title Greatest Hits GI Blues Blue Hawaii Surfin Safari Between the Buttons Unplugged Record Label Full Moorn Epic Epic RCA Capitol Reprise Artist# Category 25 Rock 10 Roclk 10 Rock 20 Rock 15 Rock 30 Rock ARTISTS Artist# Artist Name 10 Elvis Presley 15 Rolling Stones 20 Beach Boys 25 Dan Fogelberg 30 Eric Clapton Yr. Born Yr. Died 1935 1943 1942 1951 1945 1977 TRACKS Ca EK-38308 EK-38308 EK-38308 LPM-2256 LPM-2256 LPM-2256 7499-2256 7499-2256 945024-2 945024-2 945024-2 Track# TrackTitle 1 Part of the Plan 2 Heart Hotel 3 Hard to Say 1 Blue Suede Shoes 2 Franfort Special 3 Wooden Heart 1 RubyTuesday 2 Power of Gold 1 hey hey 2 layla 5 alberta TrackLength TrackSample 3:30 partplan.mp3 6:00 hearthotel.mp3 5:33 hardtosay.mp3 1:04 bluesuede.mp3 4:33 franfspec.mp3 3:45 woodheart.mp3 4:33 rubytues.mp3 3:44 powergold.mp3 5:33 heyhey.mp3 6:30 layla.mp3 3:33 alberta.mp3

Explanation / Answer

Answer is as follows:

Q1) DDL statments are used to provide the definitions of data. DDL commands for given Data are as follows:

1. DDL FOR ALBUMS TABLE:

CREATE TABLE ALBUMS(CAT TEXT PRIMARY KEY, TITLE text,ARTIST integer, MUSIC_CATEGORY TEXT, RECORD_LABEL TEXT);

2. DDL FOR ARTISTS TABLE:

CREATE TABLE ARTISTS(ARTIST INTEGER PRIMARY KEY,ARTIST_NAME TEXT,YEAR_BORN INTEGER, YEAR_DIED INTEGER);

3. DDL FOR TRACKS TABLE:

CREATE TABLE TRACK(CAT INTEGER, TRACK INTEGER PRIMARY KEY, TRACK_TITLE TEXT, TRACK_LENGTH text,TRACK_SAMPLE text);

Example Data:

Artist Table:

INSERT INTO ARTISTS VALUES ('10','ELVIS',1935,1977);

Album Table:

insert into ALBUMS VALUES('EK-38308','Gretest Hits',25,'Rock','Full Moon');

Track Table:

insert into TRACK VALUES('EK-38308',1,'Part of the Plan','3:30','partplan.mp3');

Q2) MODIFIED DDL FOR ALBUMS AND ARTISTS:

CREATE TABLE ALLTRACK(ALBUM TEXT,TRACK TEXT);

Example data:

INSERT INTO ALLTRACK VALUES('GREATEST HITS','Part of the Plan');

OR YOU CAN ALSO USE SLECT STATEMENT FOR THAT

SELECT TITLE,TRACKTITLE FORM ALBUMS JOIN TRACK ON ALBUMS.CAT = TRACK.CAT;

IF THERE IS ANY QUERY PLEASE ASK IN COMMENTS...