Question

In: Computer Science

A. Consider the following relations and relationship: JobOpening (jobNo, positon, salary, requirement, contactPerson) NewsPaper(newsPaperNo, name, street,...

A. Consider the following relations and relationship:

JobOpening (jobNo, positon, salary, requirement, contactPerson)

NewsPaper(newsPaperNo, name, street, city, zipCode, phoneNo)

       Posting(jobNo, newsPaperNo, date, cost)

1. List all the positions that are posted on January 01, 2016

2. List all the positions that have never been posted

3. List the names of all the newspapers where the positions “database administrator has been posted

Solutions

Expert Solution

1. Select position from JobOpening J, Posting P where J.jobNo=P.jobNo and P.date='2016-01-01';

To display the positions with respect to date, we need to join JobOpening and Posting table on jobNo column.

Then in addition to that we need to mention the given specific date as shown in the above answer query.

2. Select position from JobOpening J, Posting P where J.jobNo=P.jobNo and P.date Is Null;

to display postings that have never been posted, again we need to join JobOpening and Posting table on jobNo column. Since we are concerned with not posted postings i.e., date is null, we used Is Null constraint on date column.

3. Select name from NewsPaper N, JobOpening J, Posting P where (N.newsPaperNo= P.newsPaperNo) and (J.jobNo=P.jobNo) and (J.position=' database administrator') and p.date Is Not Null;

Since we are concerned with names of all the newspapers where the positions “database administrator has been posted, we need to join all the three different tables on relevant columns and with specific mention of position and date being not null in the constraint using where clause with multiple and clause.

date is not null as it is the date on which Person posted as database administrator.


Related Solutions

Consider the following relations and relationship property(propertyNo, ownerID, type, rent, address) Newspaper(newspaperNo, name, street, city, zipCode,...
Consider the following relations and relationship property(propertyNo, ownerID, type, rent, address) Newspaper(newspaperNo, name, street, city, zipCode, phoenNo) Advertisement(propertyNo, newspaperNo, date, cost) 1. List the propertyNo of all the properties that have been advertised on “Houston Chronical” 2. List the names of all the newspapers where the properties with rent greater 1000 have been posted.
Consider the following relations: Please answer in the form of symbol. Thank You Student (ssn, name,...
Consider the following relations: Please answer in the form of symbol. Thank You Student (ssn, name, address, major) Course(code, title) Registered(ssn,code) List the titles of all courses List the information of the students majoring in ‘CS’ List the codes of courses for which at least one student is registered (registered courses List the titles of registered courses List the codes of courses for which no student is registered
Describe what is a system requirement, what is a software requirement and what is the relationship...
Describe what is a system requirement, what is a software requirement and what is the relationship between them?
Consider the following relational database schema:             employee(employee-name, employee-id, street, e-city)             works(employee-
Consider the following relational database schema:             employee(employee-name, employee-id, street, e-city)             works(employee-id, company-id, salary)             company(company-name, company-id, c-city)             manages(employee-id, manager-id) Specify the following queries on this database schema using the relational operators we discussed in class. Write your answers on a separate sheet of paper in the order that they are specified below. Retrieve the name and address of employees who work for First Bank Corporation. Retrieve the name, street address, and city of residence of all employees...
Write a program that reads in the name and salary of an employee. Here the salary...
Write a program that reads in the name and salary of an employee. Here the salary will denote an hourly wage, such as $9.25. Then, ask how many hours the employee worked in the past week. Be sure to accept fractional hours. Compute the pay. Any overtime work (over 40 hours per week) is paid at 150 percent of the regular wage.4 pts Your code with comments A screenshot of the execution Test Cases: Enter name: Jorge Enter wage: 9.25...
Consider the following relations: R1 = {(a, b) ∈ R2 ∣ a > b}, the greater...
Consider the following relations: R1 = {(a, b) ∈ R2 ∣ a > b}, the greater than relation R2 = {(a, b) ∈ R2 ∣ a ≥ b}, the greater than or equal to relation R3 = {(a, b) ∈ R2 ∣ a < b}, the less than relation R4 = {(a, b) ∈ R2 ∣ a ≤ b}, the less than or equal to relation R5 = {(a, b) ∈ R2 ∣ a = b}, the equal to relation...
Consider this set A = { a, b, c, d } and the following relations R6...
Consider this set A = { a, b, c, d } and the following relations R6 = { ( a, a ), ( a, b), ( b, b), ( c, d ) } R7 = { ( a, a), ( b, b ), ( b, c ), ( c, c ), ( c, d), (d, d) } R8 = { (a, b), (a, d), ( b, a), ( d, a) , ( b, d) , (d, b) } R9 =...
For 125 years, the Wall Street Journal (WSJ) has been a venerated newspaper with a focus...
For 125 years, the Wall Street Journal (WSJ) has been a venerated newspaper with a focus on global business. It was a pioneer in developing a pay wall for its digital content in 1997. From 2010 to 2015, however, WSJ began to lag behind other newspapers (e.g., Financial Times, USA Today). In 2015, WSJ undertook a complete redesign of its website and mobile apps across multiple platforms. In 2008, 10% of WSJ’s traffic came via mobile devices. That figure sits...
Given the following 7 relations: MIScompany (name, address, phone, email, FedTaxId, StaTaxId) branch (branchId, name, address,...
Given the following 7 relations: MIScompany (name, address, phone, email, FedTaxId, StaTaxId) branch (branchId, name, address, phone, email, FedTaxId, StaTaxId) employee (empId, driverId, ssno, name, branchId) customer (custId, name, address, driverId, ssno, FedTaxId, StaTaxId) equipment (equipId, name, type, upc, purchaseDate, year, manufacturId, cost, rentFee, branchId ) manufacturer (manufacturId, name, FedTaxId, StaTaxId, phone, email) rental (rentalId, equipId, custId, rentDate&time, returnDate&time, empId) Use relational algebra to retrieve every customer that has not rented any equipment in September 2020. The report should contain...
Given the following 7 relations: MIScompany (name, address, phone, email, FedTaxId, StaTaxId) branch (branchId, name, address,...
Given the following 7 relations: MIScompany (name, address, phone, email, FedTaxId, StaTaxId) branch (branchId, name, address, phone, email, FedTaxId, StaTaxId) employee (empId, driverId, ssno, name, branchId) customer (custId, name, address, driverId, ssno, FedTaxId, StaTaxId) equipment (equipId, name, type, upc, purchaseDate, year, manufacturId, cost, rentFee, branchId ) manufacturer (manufacturId, name, FedTaxId, StaTaxId, phone, email) rental (rentalId, equipId, custId, rentDate&time, returnDate&time, empId) 1) Use relational algebra to list every manufacturer that only makes electric cleaning tool (type of equipment). The report should...
ADVERTISEMENT
ADVERTISEMENT
ADVERTISEMENT