DAD 220 Module 3 Major Activity Database Documentation

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 GeneralIceRook13

Report
DAD 220 – INTRODUCTION TO STRUCTURAL DATABASE Professor Chaunda Wilson Ken 17th September 2023 DAD 220 Module Three Major Activity Database Documentation 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:
Answer: mysql ENTER. > CREATE DATABASE QuantigrationRMA; > use QuantigrationRMA; > show databases; > use QuantigrationRMA; 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 Answer: CREATE TABLE Customers ( -> CustomerID INT NOT NULL PRIMARY KEY, -> FirstName VARCHAR(30), -> LastName VARCHAR(30), -> Street VARCHAR(60), -> City VARCHAR(25), -> State VARCHAR(25), -> ZipCode INT,
-> Telephone VARCHAR(15)); > describe Customers; 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: > CREATE TABLE Orders ( -> OrderID INT NOT NULL PRIMARY KEY, -> CustomerID INT, -> SKU VARCHAR(25), -> Description VARCHAR(80), -> FOREIGN KEY (CustomerID) REFERENCES Customers(CustomerID)); > describe Orders; Note: SKU (stock keeping unit)
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
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: > CREATE TABLE RMA ( -> RMA ID INT NOT NULL PRIMARY KEY, -> OrderID INT, -> Step VARCHAR(50), -> Status VARCHAR(15), -> Reason VARCHAR(30), -> FOREIGN KEY (OrderID) REFERENCES Orders(OrderID)); > describe RMA;
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. Answer: > INSERT INTO Customers VALUES (100,'Betty','Gibbon','123 Park Street','Orange','NJ',07050,'973-234- 8824'); > INSERT INTO Customers VALUES (101,'Angel','Buffon','123 Park Avenue','Montclair','NY',17113,'957- 234-8124'), -> (102,'Benard','Cantu','10 Elizabeth dr.','Bloomfield','NC',09113,'947-224-8124'); > INSERT INTO Customers VALUES (103,'Prince','Eze','239 Vermon Street','Caldwell','FL',57110,'397-234- 8124'), -> (104,'Levi','Ezekiel','39 Norwood Street','Piscataway','OK',80110,'307-234-8125'), -> (105,'Lori','Harvey','631 Wood Rd.','Princeton','CT',05030,'877-234-9025'), -> (106,'Chuks','Ejima','466 Palmer Tr.','Bordentown','LA',27011,'624-234-8125'), -> (107,'Levite','Eze','300 Clinton Street','Irvington','PA',54900,'862-234-6005'), -> (108,'Grace','Sunday','839 Old Bridge Rd.','Linden','MS',06102,'908-234-8445'),
-> (109,'Kamsi','Godwin','369 Evergreen Pl. APT F7','Ridgewood','NV',18070,'555-104-8000'); > Select * from Customers; 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." Execute the following statements and provide one or more supporting screenshots showing the database view: Answer: > CREATE VIEW Collaborator AS -> SELECT CustomerID AS CollaboratorID, FirstName, LastName, Street, City, State, ZipCode, Telephone -> FROM Customers; > describe Collaborator; > select * from Collaborator LIMIT 5;
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