DAD 220 Module Three 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

5

Uploaded by BaronKuduPerson693

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: I created a new database schema called QuantigrationRMA using the command CREATE DATABASE QuantigrationRMA; I verified the creation of the database using the command SHOW databases; I connected to the database via the command 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 your answer:
To create the new table Customers, I used the command CREATE TABLE Customers and then typed out each attribute as shown below: CREATE TABLE Customers( CustomerID INT, FirstName VARCHAR(25), LastName VARCHAR(25), StreetAddress VARCHAR(50), City VARCHAR(50), State VARCHAR(25), ZipCode INT, Telephone VARCHAR(15), PRIMARY KEY (CustomerID) ); I verified that the table was created and primary key was assigned to CustomerID using the command 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: To create the new table Orders, I used the command CREATE TABLE Orders and then typed out each attribute as shown below: CREATE TABLE Orders( OrderID INT, CustomerID INT, SKU VARCHAR(20), Description VARCHAR(50), PRIMARY KEY (OrderID),
FOREIGN KEY (CustomerID) REFERENCES Customers(CustomerID) ); I verified that the table was created and primary key was assigned to OrderID with the foreign key CustomerID referencing the CustomerID on the Customers table using the command describe Orders; 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: To create the new table RMA, I used the command CREATE TABLE RMA and then typed out each attribute as shown below: CREATE TABLE RMA( RMAID INT, OrderID INT, Step VARCHAR(50), Status VARCHAR(15), Reason VARCHAR(15), PRIMARY KEY (RMAID), FOREIGN KEY (OrderID) REFERENCES Orders(OrderID) ); I verified that the table was created and primary key was assigned to RMAID with the foreign key OrderID referencing the OrderID on the Orders table using the command 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.
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
I used the INSERT INTO Customer Values command to insert the data above. I then used the SELECT * FROM Customers command to verify all 10 customers were added as show below: 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."
I updated the existing table using the view command based on the information provided in the guide. I noticed during that time that telephone is misspelled. I used the command DESCRIBE Collaborator; to verify that CustomerID was updated to CollaboratorID then verified using the SELECT * FROM Collaborator LIMIT 5; command to display 5 results.