Question Details

Answered) SET @OLD_UNIQUE_CHECKS=@@UNIQUE_CHECKS, UNIQUE_CHECKS=0; SET @OLD_FOREIGN_KEY_CHECKS=@@FOREIGN_KEY_CHECKS, FOREIGN_KEY_CHECKS=0; SET


Using the Company schema, select the unique project numbers and project names where either the project department’s manager is ‘Freed’ or an employee’s last name is ‘Freed’.  

Use explicit join notation where necessary.

Nested selects may be needed in this case.

Expected Result Set Size: 2

The company schema is attached that can be used with MySQL workbench or whatever preferred program

SET @OLD_UNIQUE_CHECKS=@@UNIQUE_CHECKS, UNIQUE_CHECKS=0;
SET @OLD_FOREIGN_KEY_CHECKS=@@FOREIGN_KEY_CHECKS, FOREIGN_KEY_CHECKS=0;
SET @OLD_SQL_MODE=@@SQL_MODE, SQL_MODE='TRADITIONAL,ALLOW_INVALID_DATES';
-- ------------------------------------------------------ Schema company
-- ----------------------------------------------------CREATE SCHEMA IF NOT EXISTS `company` DEFAULT CHARACTER SET utf8 ;
USE `company` ;
-- ------------------------------------------------------ Table `company`.`employee`
-- ----------------------------------------------------CREATE TABLE IF NOT EXISTS `company`.`employee` (
`fname` VARCHAR(15) NOT NULL,
`minit` VARCHAR(1) NULL DEFAULT NULL,
`lname` VARCHAR(15) NOT NULL,
`ssn` CHAR(9) NOT NULL DEFAULT '',
`bdate` DATE NULL DEFAULT NULL,
`address` VARCHAR(50) NULL DEFAULT NULL,
`sex` CHAR(1) NULL DEFAULT NULL,
`salary` DECIMAL(10,2) NULL DEFAULT NULL,
`superssn` CHAR(9) NULL DEFAULT NULL,
`dno` BIGINT NULL,
PRIMARY KEY (`ssn`),
INDEX `superssn` (`superssn` ASC),
INDEX `dno` (`dno` ASC),
CONSTRAINT `employee_ibfk_2`
FOREIGN KEY (`dno`)
REFERENCES `company`.`department` (`dnumber`),
CONSTRAINT `employee_ibfk_1`
FOREIGN KEY (`superssn`)
REFERENCES `company`.`employee` (`ssn`))
ENGINE = InnoDB
DEFAULT CHARACTER SET = utf8;
-- ------------------------------------------------------ Table `company`.`department`
-- ----------------------------------------------------CREATE TABLE IF NOT EXISTS `company`.`department` (
`dnumber` BIGINT NOT NULL DEFAULT '0',
`dname` VARCHAR(25) NOT NULL,
`mgrssn` CHAR(9) NOT NULL,
`mgrstartdate` DATE NULL DEFAULT NULL,
PRIMARY KEY (`dnumber`),
UNIQUE INDEX `dname` (`dname` ASC),
INDEX `mgrssn` (`mgrssn` ASC),
CONSTRAINT `department_ibfk_1`
FOREIGN KEY (`mgrssn`)
REFERENCES `company`.`employee` (`ssn`))
ENGINE = InnoDB
DEFAULT CHARACTER SET = utf8;
-- ------------------------------------------------------ Table `company`.`dependent`
-- ----------------------------------------------------CREATE TABLE IF NOT EXISTS `company`.`dependent` (
`essn` CHAR(9) NOT NULL DEFAULT '',
`dependent_name` VARCHAR(15) NOT NULL DEFAULT '',
`sex` CHAR(1) NULL DEFAULT NULL,
`bdate` DATE NULL DEFAULT NULL,
`relationship` VARCHAR(8) NULL DEFAULT NULL, PRIMARY KEY (`essn`, `dependent_name`),
CONSTRAINT `dependent_ibfk_1`
FOREIGN KEY (`essn`)
REFERENCES `company`.`employee` (`ssn`))
ENGINE = InnoDB
DEFAULT CHARACTER SET = utf8;
-- ------------------------------------------------------ Table `company`.`dept_locations`
-- ----------------------------------------------------CREATE TABLE IF NOT EXISTS `company`.`dept_locations` (
`dnumber` BIGINT NOT NULL DEFAULT '0',
`dlocation` VARCHAR(15) NOT NULL DEFAULT '',
PRIMARY KEY (`dnumber`, `dlocation`),
CONSTRAINT `dept_locations_ibfk_1`
FOREIGN KEY (`dnumber`)
REFERENCES `company`.`department` (`dnumber`))
ENGINE = InnoDB
DEFAULT CHARACTER SET = utf8;
-- ------------------------------------------------------ Table `company`.`project`
-- ----------------------------------------------------CREATE TABLE IF NOT EXISTS `company`.`project` (
`pname` VARCHAR(25) NOT NULL,
`pnumber` BIGINT NOT NULL DEFAULT '0',
`plocation` VARCHAR(15) NULL DEFAULT NULL,
`dnum` BIGINT NOT NULL,
PRIMARY KEY (`pnumber`),
UNIQUE INDEX `pname` (`pname` ASC),
INDEX `dnum` (`dnum` ASC),
CONSTRAINT `project_ibfk_1`
FOREIGN KEY (`dnum`)
REFERENCES `company`.`department` (`dnumber`))
ENGINE = InnoDB
DEFAULT CHARACTER SET = utf8;
-- ------------------------------------------------------ Table `company`.`works_on`
-- ----------------------------------------------------CREATE TABLE IF NOT EXISTS `company`.`works_on` (
`essn` CHAR(9) NOT NULL DEFAULT '',
`pno` BIGINT NOT NULL DEFAULT '0',
`hours` DECIMAL(4,1) NULL DEFAULT NULL,
PRIMARY KEY (`essn`, `pno`),
INDEX `pno` (`pno` ASC),
CONSTRAINT `works_on_ibfk_1`
FOREIGN KEY (`essn`)
REFERENCES `company`.`employee` (`ssn`),
CONSTRAINT `works_on_ibfk_2`
FOREIGN KEY (`pno`)
REFERENCES `company`.`project` (`pnumber`))
ENGINE = InnoDB
DEFAULT CHARACTER SET = utf8;
SET [email protected]_SQL_MODE;
SET [email protected]_FOREIGN_KEY_CHECKS;
SET [email protected]_UNIQUE_CHECKS;

 


Solution details:
STATUS
Answered
QUALITY
Approved
ANSWER RATING

This question was answered on: Sep 05, 2019

PRICE: $18

Solution~000200097282.zip (25.37 KB)

Buy this answer for only: $18

This attachment is locked

We have a ready expert answer for this paper which you can use for in-depth understanding, research editing or paraphrasing. You can buy it or order for a fresh, original and plagiarism-free solution (Deadline assured. Flexible pricing. TurnItIn Report provided)

Pay using PayPal (No PayPal account Required) or your credit card . All your purchases are securely protected by .
SiteLock

About this Question

STATUS

Answered

QUALITY

Approved

DATE ANSWERED

Sep 05, 2019

EXPERT

Tutor

ANSWER RATING

GET INSTANT HELP/h4>

We have top-notch tutors who can do your essay/homework for you at a reasonable cost and then you can simply use that essay as a template to build your own arguments.

You can also use these solutions:

  • As a reference for in-depth understanding of the subject.
  • As a source of ideas / reasoning for your own research (if properly referenced)
  • For editing and paraphrasing (check your institution's definition of plagiarism and recommended paraphrase).
This we believe is a better way of understanding a problem and makes use of the efficiency of time of the student.

NEW ASSIGNMENT HELP?

Order New Solution. Quick Turnaround

Click on the button below in order to Order for a New, Original and High-Quality Essay Solutions. New orders are original solutions and precise to your writing instruction requirements. Place a New Order using the button below.

WE GUARANTEE, THAT YOUR PAPER WILL BE WRITTEN FROM SCRATCH AND WITHIN YOUR SET DEADLINE.

Order Now