Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

4) You will create and use a new second database, sem_projectB. Your script must be able to be run repeatedly as a single file. Add

4) You will create and use a new second database, sem_projectB. Your script must be able to be run repeatedly as a single file. Add the following tables,

Add data with a single INSERT for each table: Table employee with fields ID as an integer field; do not allow NULL values; have it auto-increment firstName as a 100 variable character field; do not allow NULL values lastName as a 100 variable character field; do not allow NULL values jobTitle as a 100 variable character field; default to a NULL value salary as a double field; default to a NULL value notes as a text field Make ID the primary key.

Use the following as data for the respective fields: Robin, Jackman, Software Engineer, 5500 Taylor, Edward, Software Architect, 7200 Vivian, Dickens, Database Administrator, 6000 Harry, Clifford, Database Administrator, 6800 Eliza, Clifford, Software Engineer, 4750 Nancy, Newman, Software Engineer, 5100 Melinda, Clifford, Project Manager, 8500 Harley, Gilbert, Software Architect, 8000

Table education with fields ID as a tiny integer field; do not allow NULL values; have it auto-increment edname as a 50 variable character field; do not allow NULL values Make ID the primary key.

Use the following as data for the respective fields: BSc, MSc, MD, JD, DDS, PhD

Table employee_education with fields employeeID as an integer field; do not allow NULL values educationID as a tiny integer field; do not allow NULL values Add constraints fk_Employee_EmployeeID indicating that employeeID is a foreign key for the ID field in table employee fk_Education_EducationID indicating that educationID is a foreign key for the ID field in table education .

Make a compound primary key from employeeID and educationID Use the following as data for the respective fields: (1, 1), (2, 1), (3, 2), (3, 6) Perform the following queries:

Query 2-1: Show the employee first name, last name, and education level for all employees, utilizing the many-to-many relationship so your results are as in the following table. (Hint: only a single table select using employee; LEFT JOIN with others; do not use WHERE.)

Query 2-2: Show the employee first name, last name, and education level for only those employees with an entered education level, so that your results are as in the following table. (Hint: only a single table select using employee; JOIN with others; do not use WHERE.)

Query 2-3: Show the employee first name, last name, and education level for only those employees with an entered education level, but show all available education levels, so that your results are as in the following table. (Hint: only a single table select using employee; RIGHT JOIN with others; do not use WHERE.)

I have created the above database need some help in these 3 queries in MySQL.

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_2

Step: 3

blur-text-image_3

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

More Books

Students also viewed these Databases questions

Question

How does being physically attractive influence others perceptions?

Answered: 1 week ago

Question

How to find if any no. is divisble by 4 or not ?

Answered: 1 week ago

Question

Explain the Pascals Law ?

Answered: 1 week ago

Question

What are the objectives of performance appraisal ?

Answered: 1 week ago