Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

NEED SQL CODE. SQL MANAGEMENT 2009-2014 The following table refer to question (5-8) , pay attention to the foreign keys defined among the tables. question

NEED SQL CODE.

SQL MANAGEMENT 2009-2014

image text in transcribedimage text in transcribed

The following table refer to question (5-8) , pay attention to the foreign keys defined among the tables.

question 5)write a query to dislay the location id and city for all locations where the city name contains both letters b and g.

6) Display the last name department ID and the department name of all the employees wo work in the states of 'WA'.

question7)

image text in transcribed

Question 8

image text in transcribed

need SQL code.

SQL MANAGEMENT 2009-2014

Search _Database_Design_llecl_Exam - YEN_21) - Protected view - Saved to this PC Sie Review Grammarly Help ences Mailings Enable Editing Ean contain viruses. Unless you need to edit, it's safer to stay in Protected View. Reactivate aption, please reactivate now. TABLE Name: Employee Column name Data type Key Type Nul Unique FK referencing FK Table column PK Not Null employee id int first name varchar(20) last name varchar(25) hire date datetime job_id varchar(10) salary numeric (8,2) manager_id int department_id smallint Not Null Not Null Not Null Foreign job_id Tob Foreign Foreign employee id Employee department_id Department TABLE Name: Department Column name Data type Key Type Null Unique FK referencing FK Table column department id smallint PK Not Null department varchar(30) Not Null namc manager id int FK employee id Employee location id smallint FK Location id Location TABLE Name: Location Column name Data type Key Type Null/ Unique FK referencing FK Table column PK Not Null location id smallint street_address varchar(40) postal_code varchar(8) City varchar(20) state varchar(12) country varchar(20) TABLE Name: Job Column name Data type Key Type Null Unique FK referencing FK Table column PK Not Nul! Not Null job id Ljob_title min salary varchar(10) varchar(30) int D) Focus o Foreign Not Null job_id Job job_id varchar(10) salary numeric (8,2) manager id int department id smallint Foreign Foreign employee id department id Employee Department TABLE Name: Department Column name Data type Key Type Null Unique FK referencing FK Table column department id smallint PK Not Null department varchar(30) Not Null namc manager_id int FK employee id Employee location id smallint FK Location id Location TABLE Name: Location Column name Data type Key Type Null Unique FK referencing FK Table column PK Not Null location id smallint street_address varchar(40) postal_code varchar(8) City varchar(20) varchar(12) country varchar(20) state TABLE Name: Job Column name Data type Key Type Null Unique FK referencing FK Table column PK Not Null Not Null job id varchar(10) job_title varchar(30) min salary int max_salary int Notes: PK - Primary key FK - Foreign key I Focus SI bp O () TEN hp f9 + ho fu 12 ins prt so delete DON ! Search Sign EE_Design_Mocl_Exam_-_ver_2 || - Protected View - Saved to this PC- Mailings Review View Help Grammarly Enable Editing an viruses. Unless you need to edit, it's safer to stay in Protected View. ease reactivate now. Reactivate Question 7 (7 marks) Based on the data types shown in the employee table, create a table named SalesStaff, which contains the following information about employees working in department 80: employee number, last name, job_id, salary, and hire date. Then insert the following data into the table. Employee ID 135 290 Last name Moody Patri Job id Salary SALESMAN 1200 SALE REP 3600 Hire date 14-FEB-07 04-JUN-06 Page 5 of 7 O Focus ho Help Reje. Grammarly ces Mailings Enable Editing contain viruses. Unless you need to edit, it's safer to stay in Protected View. Reactivate Eion, please reactivate now. Question 8 (6 marks) Update the minimum and maximum salary of Job Id 10 to match that of Job Id 20. - online resources (see next page) I D Focus 30

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

1 2 3 Data Base Techniques

Authors: Dick Andersen

1st Edition

0880223464, 978-0880223461

More Books

Students also viewed these Databases questions