Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Q.5 Given that we have the follewing datahase tables with four entities EMPLOYEE, PROJECT, ASSICINMENT and 1OB (a) Identify primary keys and foreien keys for

image text in transcribed
image text in transcribed
Q.5 Given that we have the follewing datahase tables with four entities EMPLOYEE, PROJECT, ASSICINMENT and 1OB (a) Identify primary keys and foreien keys for each table. (4 marks) (b) Create the relational diagram for this database. ( 4 marks) (c) Write the SQL code that will create the table structure for a table named EMP_. This table is a subset of the EMPLOYEE table. The basic EMP_ 1 table structure is summarized in the following fable (3 marks) (d) Having created the table structure in Q.5(c). write the SQL code to enter the first two rows for the table shown in the following table. (2.marks) (c) Write the SQL code to count the number of employees from the EMPLOYEE table. ( 2 marks) (f) Write the SQL code to count the number of employees whose employee years are longer than 10 years from the EMPLOYEE table. (2 marks) (g) Draw the table to show the result of the following query. SELECT ASSIGNMENT.PROJ_NUM, MIN(ASSIGNMENT_ASSIGN_CHG_HR) FROM ASSIGNMENT GROUP BY PROJ_NUM; (4 marks) (h) Draw the table to show the result of the following query. SELECT PROJECT NUM, PROJ_NAME, PROJECT.EMP_NUM, EMP_LNAME,EMP FNAME FROM PROJECT, EMPLOYEE WHERE PROJECT.EMP_NUM = EMPLOYEE.EMP_NUM: (4 marks)

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

Students also viewed these Databases questions

Question

What are some of the possible scenes from our future?

Answered: 1 week ago