This study source was downloaded by 100000841655955 from CourseHero com on 03 23 2022 01 08 28 GMT 05 00 https www coursehero com file 136224139 T2 TECHNICAL GAFFUD GLENNMICHAELdocx CCS0021 LABORATORYTECHNICAL ASSESSMENT 2NAME GAFFUD GLENN MICHAEL R SECTION 1 BPROF MARIA VICKY SOLOMOPart 1 Instructions Using the diagram below write the DDL code to create the following entities into tables The relationships of the tables should also be written on the code You can use SQL developer to solve this Copy and paste the codes below Save the SQL scripts as Tech6 fullname Save this document as Tech2Document fullname This study source was downloaded by 100000841655955 from CourseHero com on 03 23 2022 01 08 28 GMT 05 00 https www coursehero com file 136224139 T2 TECHNICAL GAFFUD GLENNMICHAELdocx CODE create table TimeCategory id TimeCategory number 11 0 not null primary key tc Name varchar2 50 char This study source was downloaded by 100000841655955 from CourseHero com on 03 23 2022 01 08 28 GMT 05 00 https www coursehero com file 136224139 T2 TECHNICAL GAFFUD GLENNMICHAELdocx tc Desc varchar2 500 char tc CreatedAt TIMESTAMP WITH TIME ZONE tc UpdatedAt TIMESTAMP WITH TIME ZONE tc Enabled char 3 Part 2 Answer the following numbers using the table given Use SQL developer to solve this Save the SQL script as Tech7 fullname Make sure you make the questions in the worksheet as comments Then copy your answer and paste your code below each number in this document Use the table above to answer the following by writing the SQL code Do this code in sequential order Each number is related to the previous number 1 Create the table above Job id is the primary key 2 Add a new column on the table named job category that accepts a string and it can be null This study source was downloaded by 100000841655955 from CourseHero com on 03 23 2022 01 08 28 GMT 05 00 https www coursehero com file 136224139 T2 TECHNICAL GAFFUD GLENNMICHAELdocx 3 Using the new table insert a new row on the Jobs table Use the following data Job id ST Assist Job title Stock Aid Min Salary 5000 Max salary 13000 job category M Operator 4 Show the all the jobid the sum of the salaries of the employees and the average of the salaries of the employees that has an job id that ends with ASST Group it by their job id Show only the sum of the salary that are less than 5000 Then arrange it by job id Then draw the table of the result CODE This study source was downloaded by 100000841655955 from CourseHero com on 03 23 2022 01 08 28 GMT 05 00 https www coursehero com file 136224139 T2 TECHNICAL GAFFUD GLENNMICHAELdocx Part 3 Write a correct SQL statement for each problem and show the result of the statement Use the tables below You may use SQL developer to help you with answering the questions Copy and past the source code and the result after each question StudentStudentStudentIdStudNameAge AMark18BMatthew17CRuth20DJohn15ESally18FJames17SubjectSubjIdSubjDescriptionUnitsPriceperunit1Math34002Science25003History12501 Create an SQL statement that would show the minimum and maximum units of a subject 5 points 2 Create an SQL statement that would show the student name enrollment date and subject description of the student who is enrolled in Math or Science 5 points 3 Create a view name it as EnrollDates that would show all the enrollment dates of students who are enrolled in the subject History 5 points 4 Create a view name it as studentDetails that would should show the student name enrollment date the total price per unit and subject description of students who are enrolled on the subject Science or History 5 points 5 Create a view name it as BiggestPrice that will show the subject id and highest total price per unit of all the subjects The view should show only the highest total price per unit that are greater than 1000 CODE EnrollmentEnrollmentIdEnrollmentDateStudentIdSubjIdE100Oct 10 2015A1E101Oct 11 2015B2E102Nov 10 2015C3E103Dec 15 2015D1E104Feb 1 2015E3E105Mar 10 2015F2 This study source was downloaded by 100000841655955 from CourseHero com on 03 23 2022 01 08 28 GMT 05 00 https www coursehero com file 136224139 T2 TECHNICAL GAFFUD GLENNMICHAELdocx This study source was downloaded by 100000841655955 from CourseHero com on 03 23 2022 01 08 28 GMT 05 00 https www coursehero com file 136224139 T2 TECHNICAL GAFFUD GLENNMICHAELdocx TASK 1 This study source was downloaded by 100000841655955 from CourseHero com on 03 23 2022 01 08 28 GMT 05 00 https www coursehero com file 136224139 T2 TECHNICAL GAFFUD GLENNMICHAELdocx TASK 2 TASK 3 This study source was downloaded by 100000841655955 from CourseHero com on 03 23 2022 01 08 28 GMT 05 00 https www coursehero com file 136224139 T2 TECHNICAL GAFFUD GLENNMICHAELdocx Powered by TCPDF www tcpdf org TASK 4 TASK 5
View Full Document