DAD 220 Module Three Major Activity Database Documentation Template (1)

docx

School

Southern New Hampshire University *

*We aren’t endorsed by this school

Course

220

Subject

Mechanical Engineering

Date

Feb 20, 2024

Type

docx

Pages

6

Uploaded by KidFlower13108

Report
DAD 220 Module Three Major Activity Database Documentation Template Overview Complete these steps as you work through the directions for this activity. Replace the bracketed text with your screenshots and brief explanations of the work they show. Each screenshot and its explanation should be sized to approximately one quarter of the page, with the description written below the screenshot. Follow these rules for each of the prompts and questions below. Review the example document for help. Create a Database 1. In your integrated development environment (IDE), create a database schema called QuantigrationRMA. List out the database name. Provide the SQL commands you ran to successfully complete this in your answer, then connect to it:
Explanation: Used the command use Robinson; to connect to the correct table I’ve been using. Then used the command show tables; to make sure I was connected to the correct database. Then used the CREATE DATABASE QuantigrationRMA; to create a new database schema and used show tables; again to make sure that it was added into the databases. 2. Using the entity relationship diagram (ERD) as a reference, create the following tables with the appropriate attributes and keys : a. A table named customers in the QuantigrationRMA database as defined on the project ERD. Provide the SQL commands you ran against MySQL to complete this successfully in your answer: Explanation: Used the commands: CREATE TABLE Customers ( -> CustomerID INT NOT NULL PRIMARY KEY, -> FirstName VARCHAR(25), -> LastName VARCHAR(25), -> Street VARCHAR(50), -> City VARCHAR(50), -> State VARCHAR(25), -> ZipCode VARCHAR(10), -> Telephone VARCHAR(15)); Then used the describe Customers; to see that the information I entered was correct. I first entered in the command show Customers; but forgot it should be describe and not show in order to view the new table since there isn’t anything in that table to show yet. b. A table named orders in the QuantigrationRMA database as defined on the project ERD. Provide the SQL commands you ran against MySQL to complete this successfully in your answer:
Explanation: Used CREATE TABLE Orders ( -> OrderID INT NOT NULL PRIMARY KEY, -> CustomerID INT, -> SKU VARCHAR(20), -> Description VARCHAR(50), -> FOREIGN KEY (CustomerID) REFERENCES Customers(CustomerID)); Used this command to create another table as shown on the RMA Diagram, made sure to attach the primary key for the orderID since it shows PK on the table next to it, and then made the CustomerID a foreign key by using FOREIGN KEY (CustomerID) REFERENCES Custumers(CustomerID) to set the foreign and primary keys in the table. Then used describe Orders; to make sure that I got everything correct in this table. c. A table named rma in the QuantigrationRMA database as defined on the project ERD. Provide the SQL commands you ran against MySQL to complete this successfully in your answer:
Your preview ends here
Eager to read complete document? Join bartleby learn and gain access to the full version
  • Access to all documents
  • Unlimited textbook solutions
  • 24/7 expert homework help
Explanation : Used the SQL Command: CREATE TABLE RMA( RMAID INT NOT NULL PRIMARY KEY, OrderID INT, Step VARCHAR(50), Status VARCHAR(15), Reason VARCHAR(15), FOREIGN KEY (OrderID) REFERENCES Orders(OrderID)); I made sure to include the foreign and primary keys just as in the other tables. 3. Manually add 10 records into the Customers table . The data can be made up for now, as you you’ll populate all three tables later from the provided CSV files.
Explanation: Added 10 new customers into the customers table using the following: INSERT INTO Customers VALUES(1000,'Terry','Johnson','123 Happy St','Helena','MT','59602','406-410- 3617'), (1001,'Daniel','Winstead','3083 Goodwin Ave','Pullman','WA','99163','509-334-8526'), (1002,'Michael','Scott','254 Dunder Mifflin St','Scratton','PA','18504','570-343-3400'), (1003,'Justin','Snead','433 Ashcraft Ct','California','CA','02110','619-342-5762'), (1004,'Gertrude','Claycomb','2593 Middleville Rd','Los Angeles','CA','90017','626-370-3930'), (1005,'Rasalyn','Hammond','870 Junior Ave','Atlanta','GA','30303','404-631-1676'), (1006,'Brandon','Fiala','1026 Elk City Rd','Alexandria','LA','71301','318-201-9466'), (1007,'Ryan','Murray','1659 Lakewood Dr','Union City','NJ','07087','201-902-3712'), (1008,'Mary','Gray','2292 Bloomfield Way','Portland','ME','04101','207-574-5555'), (1009,'Pamela','Krout','2377 Hartway St','Valley Springs','SD','57068','605-757-4504'); 4. Create a view from the existing Customers table by using the SQL command provided below to say "Collaborators." The view should show all instances of "Customer" renamed as "Collaborator." Explanation : Used the command provided on the guidelines and rubric:
CREATE VIEW Collaborator AS SELECT CustomerID AS CollaboratorID FirstName, LastName, Steet, City, State, Telephone FROM Customers; Used the command SELECT * FROM Collaborator LIMIT 5; 1. CREATE VIEW Collaborator AS SELECT CustomerID AS CollaboratorID, FirstName,LastName, Street,City,State,Telephone FROM Customers;
Your preview ends here
Eager to read complete document? Join bartleby learn and gain access to the full version
  • Access to all documents
  • Unlimited textbook solutions
  • 24/7 expert homework help