Week 8 Assignment


Instructions (Read and follow instructions)

  1. Download 8Week.sql file/database from this repo.
  2. Open MySQL WorkBench or any SQL Management Tool and Import the file/database
  3. Write SQL scripts to answer all questions below.
  4. Save, Export and rename the file to solution.sql Click to play : (https://www.youtube.com/watch?v=fX4-YiXxTn0 )
  5. Add file solution.sql to the same repo

Question 1

Imagine you have a table named "Customers" with columns for "customer_id" (number), "name" (text), and "city" (text). See the pre-populated Table found in the database above-named 8Week.sql. Write an SQL statement to add a new customer named "Alice Smith" living in "New York City" to the table.

Question 2

There's a mistake in the "Customers" table. John Doe's city is listed as "New Yory City" instead of "New York City". How can you fix this mistake using an SQL statement?

Question 3

Search for Customers: Write an SQL statement to find all customers who live in "Chicago".

Question 4

Delete a Customer: While deleting data should be done with caution, let's practice removing a customer. Write an SQL statement to remove the customer with customer ID 1 (Bob Jones) from the table. Remember, deleting data is permanent.