Question

In: Computer Science

I have these following tables: �Company(compid, compname, comptype) �Job(jobid, jobtitle, salarylow, salaryhigh, location, compid*) �Skills(skillid, skillname)...

I have these following tables:

�Company(compid, compname, comptype)

�Job(jobid, jobtitle, salarylow, salaryhigh, location, compid*)

�Skills(skillid, skillname) �Jobskills(jobid*, skillid*, expertiseneeded)

�Applicant(appid, name, age, highdegree, expected_salary)

�AppSkills(appid*, skillid*, expertise)

�Applies(jobid*, appid*, appdate, decisiondate, outcome)

The queries are:

1. Find the outcome of all job applications of Monica (once again, note that there may be multiple Monica's in the database).

2. Find the applicants who have applied to more than 2 different companies.

3. Find the jobs that require no skills (well, as far as the data is concerned), i.e., jobs for which there is no corresponding skill listed in the database. Do this query without using a subquery.

4. Find the jobs located in Dayton that require both database and analysis skills.

5. Find the company offering the maximum salary in Chicago.

Solutions

Expert Solution

Short Summary:

  • Within the alloted time, was able to create the tables and shown you queries
  • Could not get time to insert records and shown you the sample outupt.

**************Please upvote the answer and appreciate our time.************

CREATE DATABASE JobSearch
GO

USE JobSearch
GO

CREATE TABLE Company(
   compid INT PRIMARY KEY IDENTITY(1,1)
   , compname VARCHAR(50)
   , comptype VARCHAR(50))

CREATE TABLE Job(
   jobid INT PRIMARY KEY IDENTITY(1,1)
   , jobtitle VARCHAR(50)
   , salarylow DECIMAL(18, 2)
   , salaryhigh DECIMAL(18, 2)
   , [location] VARCHAR(50)
   , compid INT
   , FOREIGN KEY(compid) REFERENCES Company(compid))

CREATE TABLE Skills(
   skillid INT PRIMARY KEY IDENTITY(1,1)
   , skillname VARCHAR(50))

CREATE TABLE Jobskills(
   jobid INT
   , skillid INT
   , expertiseneeded INT
   , PRIMARY KEY(jobid, skillid)
   , FOREIGN KEY(jobid) REFERENCES Job(jobid)
   , FOREIGN KEY(skillid) REFERENCES Skills(skillid))

CREATE TABLE Applicant(
   appid INT PRIMARY KEY IDENTITY(1,1)
   , [name] VARCHAR(50)
   , age INT
   , highdegree VARCHAR(50)
   , expected_salary DECIMAL(18, 2))

CREATE TABLE AppSkills(
   appid INT
   , skillid INT
   , expertise INT
   , PRIMARY KEY(appid, skillid)
   , FOREIGN KEY(appid) REFERENCES Applicant(appid)
   , FOREIGN KEY(skillid) REFERENCES Skills(skillid))


CREATE TABLE Applies(
   jobid INT
   , appid INT
   , appdate DATETIME
   , decisiondate DATETIME
   , outcome VARCHAR(50)
   , PRIMARY KEY(jobId, appid)
   , FOREIGN KEY(appid) REFERENCES Applicant(appid)
   , FOREIGN KEY(jobid) REFERENCES Job(jobid))


--1. Find the outcome of all job applications of Monica (once again, note that there may be multiple Monica's in the database).
SELECT jobid, outcome
FROM Applies
INNER JOIN Applicant ON Applicant.appid = Applies.appid
WHERE Applicant.[name] = 'Monica'

--2. Find the applicants who have applied to more than 2 different companies.
SELECT [name]
FROM Applicant
INNER JOIN Applies ON Applicant.appid = Applies.appid
INNER JOIN Job ON Job.jobid = Applies.jobid
GROUP BY Applicant.appid, Applicant.name
HAVING COUNT(DISTINCT Job.compid) >= 2


--3. Find the jobs that require no skills (well, as far as the data is concerned),
--i.e., jobs for which there is no corresponding skill listed in the database. Do this query without using a subquery.

SELECT jobid
FROM Job
EXCEPT
SELECT DISTINCT jobid
FROM Jobskills

--4. Find the jobs located in Dayton that require both database and analysis skills.
SELECT *
FROM Job
INNER JOIN Jobskills ON Jobskills.jobid = Job.jobid
INNER JOIN Skills ON Skills.skillid = Jobskills.skillid
WHERE Job.[location] = 'Dayton' AND Skills.skillname = 'database' AND Skills.skillname = 'analysis'


--5. Find the company offering the maximum salary in Chicago.
SELECT *
FROM Company
INNER JOIN Job On Job.compid = Company.compid
WHERE Job.[location] = 'Chicago' AND Job.salaryhigh = (SELECT MAX(Job.salaryhigh) FROM Job WHERE Job.[location] = 'Chicago')

**************************************************************************************

Feel free to rate the answer and comment your questions, if you have any.

Please upvote the answer and appreciate our time.

Happy Studying!!!

**************************************************************************************


Related Solutions

Tik Tok Company manufactures customized coffee tables. The following relates to Job No. X10, an order...
Tik Tok Company manufactures customized coffee tables. The following relates to Job No. X10, an order for 150 coffee tables: Direct materials used $22 800 Direct labour hours worked 600 Direct labour rate per hour $16.00 Machine hours used 400 Applied factory overhead rate per machine hour $30.00 a) What is the total manufacturing cost for Job No. X10? b) Calculate the cost per coffee table for Job No. X10? c) List two uses of this unit cost information to...
Suppose a rehabilitation psychologist has developed a new job skills training program for people who have...
Suppose a rehabilitation psychologist has developed a new job skills training program for people who have not been able to hold a job. Of the 14 people who agree to be in the study, the researcher randomly picks seven of these volunteers to be in a experimental group who will go through the special training program. The other seven volunteers are put in a control group who will go through an ordinary job skills training program. After finishing the training...
Suppose a rehabilitation psychologist has developed a new job skills training program for people who have...
Suppose a rehabilitation psychologist has developed a new job skills training program for people who have not been able to hold a job. Of the 14 people who agree to be in the study, the researcher randomly picks seven of these volunteers to be in a experimental group who will go through the special training program. The other seven volunteers are put in a control group who will go through an ordinary job skills training program. After finishing the training...
I have tables student, professor, and person. The relationship between student and person, and professor and...
I have tables student, professor, and person. The relationship between student and person, and professor and person is Is A inheritance. A person may be a student but not a professor, a professor but not a student, or neither a professor or a student. How do I write a trigger in SQL that forces the constraint that a person cannot be a student and a professor. Some extra info: I have defined ID to be PK of person. ID is...
Link the following two tables: HumanResources.Employee and Sales.SalesPerson then display Employee PK, job title, Date of...
Link the following two tables: HumanResources.Employee and Sales.SalesPerson then display Employee PK, job title, Date of birth, Gender, Sales quotas, Commission percent and bonus. Use an outer join to display all the employee whether they are in sales or not. Make sure to sort by bonus desc. Explain why some of the field from the Sales.SalesPerson table are null.
please provide me below just i want z tables , t tables , chi square tables...
please provide me below just i want z tables , t tables , chi square tables both right tailed ,left tailed .,two tailed high quality of images only,other wise it wont help me, it leads thumbdown. thankyou chegg
How can i assess my skills and develop a plan to improve the skills to be...
How can i assess my skills and develop a plan to improve the skills to be successful in the financial services industry?
I have to do an interview with a person who currently has the job I want....
I have to do an interview with a person who currently has the job I want. It's not super in-depth and doesn't have to be long. I'm looking for any biologist (preferably wildlife research/conservation) but I'm not picky. The questions are as follows: Job Title: Roles and responsibilities: Best/worst aspects of your job: 3 pieces of advice for those wanting to be in your field: Like I said, it doesn't have to be substantial. Just enough to get the point...
Job postings often state that the successful applicant must have superior critical thinking and problem-solving skills....
Job postings often state that the successful applicant must have superior critical thinking and problem-solving skills. Yet employers tell college administrators that graduates, both from undergraduate and graduate programs, often lack these skills. Having read this week's assigned materials, how would you define critical thinking? Why are employers making these comments? Are they justified? Your response should be at least 250 words.
Management Skills Assignment is an interview and you are being interviewed for a job and these...
Management Skills Assignment is an interview and you are being interviewed for a job and these questions need to be answered as if it was a job interview with relevant material will post the topic of the question that needs to be discussed with each question. company: Tesla 1. could you talk about your management core competencies that you think will add value to this company? ( Topics Needed for this question: Deep listening, Conversing, Co-initiating, and any extra) 2....
ADVERTISEMENT
ADVERTISEMENT
ADVERTISEMENT