Agent-Banks / assignments

Assignments for Suncoast Developers Guild
0 stars 0 forks source link

03 - 02 - Rhythm's gonna get you - ERD #10

Closed Agent-Banks closed 4 years ago

Agent-Banks commented 4 years ago

Rhythm's gonna get you - ERD

For this project, we will model and create a database. We are starting a record label company, and we a place to store our bands, albums, and eventually songs. You are creating a console app that stores our information in a database.

Objectives

Requirements

Create the ERD (Entity Relationship Diagram) and resulting tables that allows a user to store and manage the company's bands, albums, and (eventually) songs.

How to turn in this assignment.

  1. If you draw your ERD on paper, attach a photo. If you draw your ERD in a software tool, attach a screenshot of the image.
  2. Paste all the SQL you wrote to create tables, insert rows, and try out SELECT/JOIN statements as a comment to this assignment.

Explorer Mode

ALTERNATIVES

Agent-Banks commented 4 years ago

IMG_3663

--1.

CREATE TABLE "Bands" ( "Id" SERIAL PRIMARY KEY, "Name" TEXT NOT NULL, "CountryOfOrign" TEXT, "NumberOfMemebers" INT, "Website" TEXT, "Style" TEXT, "IsSigned" BOOLEAN, "ContactName" TEXT, "ContactPhoneNumber" TEXT );

CREATE TABLE "Albums" ( "Id" SERIAL PRIMARY KEY, "BandId" INTEGER REFERENCES "Bands" ("Id"), "Title" TEXT NOT NULL, "IsExplicit" BOOLEAN, "ReleaseDate" DATE );

--2.

INSERT INTO "Bands" ( "Name", "CountryOfOrign", "NumberOfMemebers", "Website", "Style", "IsSigned", "ContactName", "ContactPhoneNumber") VALUES ('Led Zeppelin', 'United Kingdom', '4', 'ledzeppelin.com', 'Rock', 'True', 'Bill', '727-765-0978');

--3.

SELECT * FROM "Bands";

--4.

INSERT INTO "Albums" ("BandId", "Title", "IsExplicit", "ReleaseDate") VALUES ('1', 'Houses of The Holy', 'False', '1973-03-28');

--5.

UPDATE "Bands" SET "IsSigned" = 'False' WHERE "Name" = 'Led Zeppelin';

--6.

UPDATE "Bands" SET "IsSigned" = 'True' WHERE "Name" = 'Led Zeppelin';

--7. --Select "Employees"."FullName", "Departments"."Id" --From "Employees" --Join "Departments" ON "Employees"."DepartmentId" = "Departments"."Id";

SELECT "Albums"."Title", "Bands"."Name" FROM "Albums" JOIN "Bands" ON "Albums"."BandId" = "Bands"."Id";

--8.

Select * FROM "Albums" ORDER BY "Albums"."ReleaseDate";

--9.

SELECT * FROM "Bands" WHERE "IsSigned" = 'True';

--10.

SELECT * FROM "Bands" WHERE "IsSigned" = 'False';

Agent-Banks commented 4 years ago

Your homework 03 - 02 - Rhythm's gonna get you - ERD was marked: Meets Expectations Well done!

“Well done!”