DAD 220 Module Four Lab Template

docx

School

Southern New Hampshire University *

*We aren’t endorsed by this school

Course

220

Subject

Business

Date

Apr 3, 2024

Type

docx

Pages

3

Uploaded by DeaconCaterpillar4154

Report
DAD 220 Module Four Lab Template Overview Begin by doing the following steps in the IDE (Codio): 1. Load the classicmodels data set. 2. Start a new terminal session and run this command: mysqlsampledatabase.sql 3. Write commands to use the classicmodels database and show its tables to verify that you are in the right place. Then perform the steps below to complete the lab. Manually enter any commands you are asked to write. At the end of each step, replace the bracketed text in this template with your screenshot, response, or both, as indicated. Submit your completed template for grading and feedback. Screenshots should be sized to about one-quarter of a page. Written responses should be in complete sentences. Rename this document by adding your last name to the file name before you submit it. Identify Cardinality and Table Relationships 1. Retrieve employee tuples and identify the number of employees in San Francisco and New York. a. Command for San Francisco: select firstName, lastName, jobTitle, offices.city from employees inner join offices on employees.officeCode = offices.officeCode where state = 'CA'. b. Write and run a command to return records from New York on your own. c. Validate the completion of this step with a screenshot of these two tables. [Insert a screenshot of both tables here. Both tables should fit in one screenshot.] 2. Retrieve order details for orderNumber 10330, 10338, and 10194 and identify what type of cardinality this represents in the entity relationship model. a. Retrieve the order details by running SELECT queries with WHERE clauses against the Orders table. [Insert a screenshot here.] b. Now, identify what type of cardinality this represents in the entity relationship model. i. Reference the Module Four Lab ERD diagram linked in the guidelines and rubric to help identify relationships. [Insert a screenshot and your response here.] 3. Delete records from the payments table where the customer number equals 103. a. Run a DESCRIBE statement to identify fields in the Payments table first. b. Select the records from the Payments table for customer number 103 before deleting them.
[Insert a screenshot of this data before you delete it here.] c. Delete the records from the Payments table for customer number 103. d. Run a SELECT statement against the table to show that customer number 103 is no longer there. [Insert a screenshot showing that you have successfully deleted these records here.] 4. Retrieve customer records for sales representative Barry Jones and identify if the relationships are one-to-one or one-to-many . a. Remember: SELECT, FROM, INNER JOIN, and WHERE. b. Use Barry’s employeeNumber, 1504, and perform a join between the customer salesRepEmployeeNumber to retrieve these records. i. Identify whether these entities demonstrate one-to-one or many-to-many relationships. [Insert a screenshot and your response here.] 5. Retrieve records for customers who reside in Massachusetts and identify their sales rep and the relationship of entities . Identify if these entities demonstrate one-to-one or many-to-many relationships. a. Remember: SELECT, FROM, INNER JOIN, and WHERE. b. Use employee.firstName and employee.lastName in your command. c. Identify whether these entities demonstrate one-to-one or many-to-many relationships. [Insert a screenshot and your response here.] 6. Add one customer record with your last name using an INSERT statement. You may use the name of a celebrity or fictional character if you don’t use your own name. a. You may use the name of a celebrity or fictional character if you don’t use your own name. Think of this as your signature. b. Complete these actions to get to the right place to enter this information: (1) Show databases, (2) use classicmodels, (3) show tables, (4) describe customers; i. You should now see all of the fields that you’ll need to fill in to complete this step. ii. Reference your Module Two lab or resources on how to populate these fields if you need to. iii. Populate the following fields: customerNumber customerName contactLastName contactFirstName phone addressLine1 addressLine2
city state postalCode country salesRepEmployeeNumber creditLimit iv. Run a SELECT statement on the Customers table and capture it in a screenshot. [Insert a screenshot of your unique customer record here.] 7. Reflection: Use the lab environment or the screenshots you’ve worked with for this step. Address the prompts below in your reflection. Write a paragraph in response to each prompt: a. Define how cardinality is applied to the databases you’ve been working with. Explain why different numbers of records were returned from the different offices. [Insert your response here.] b. Compare and contrast the different queries you ran and how cardinality applies to them. [Insert your response here.] c. Describe two of the crucial benefits of cardinality in this type of database. [Insert your response here.]
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