Question: SQL Problem 1 You are to create a DB for a construction company to show which job is for which customer. Create the following tables

SQL

Problem 1

You are to create a DB for a construction company to show which job is for which customer.

  1. Create the following tables

TCustomers

Name

Phone

Email

TJobs

Job description (250 characters)

Start Date

End Date (allow NULLs)

TCustomerJobs

Join the Customer and Job tables together

  1. Create FK table showing child, parent and column used to create relationship
  2. Create FKs based on step #2.
  3. Add at least 3 customers
  4. Add at least 3 jobs at least one with a NULL End Date
  5. Give 2 customers jobs leaving 1 with no job.
  6. Give 1 customer 2 different jobs.
  7. Try to give a customer the same job twice. This should fail. (Comment this code out prior to submitting)
  8. Write query to show all customers and jobs
  9. Write query to show any job not completed
  10. Write query to update an End Date from NULL to a date after the Start Date for that job.

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!