Question: Write SQL query statements to query the following Freelancer database Tables. Customers hire programmers (also called freelancers) to do some programming projects. cid is Customer


Write SQL query statements to query the following Freelancer database Tables. Customers hire programmers (also called freelancers) to do some programming projects. "cid" is Customer ID. "fid is the ID of a freelancer. pid" is the ID of the project, "sid is the id of a certain kind of skill the freelancer possesses. payAmount" means how much a project gets paid; rating is the customer's average satisfaction rate with a freelancer. Rating is a numerical value from 1 to 10 with 10 representing most satisfactory. Customers cid fname Iname dob phone zipcode Freelancers fid fname Iname rating sid Skills sid SkillName Projects pid cid fid Ending payAmount projectName Starting date date 1. Show project names whose pay amount is more than $1000 2. Show freelancer names who started projects before 2020 3. Show freelancer names who received total payment more than $5000 4. Show the average rating received by each freelancer in descending order of the average rating 5. Using subquery, show all the employee's names who have a SkillName "Database Administration" 6. Find the total number of all the freelancers (without duplicate entry) in each skill category. 7. Using SQL, add a foreign key constraint to Projects. If a freelancer's id is changed in the Freelancer's table, the Freelancer's id is set to null in the Projects table. Add another foreign key constraint to Projects. If a Customer's id is deleted in the Customer's table, the Customer's id is also deleted in the Projects table. 8. Find all the customers whose project was done by a freelancer whose average rating is 4
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
