WEEK 5 sql m ASSIGNMENT

.docx

School

Bellevue University *

*We aren’t endorsed by this school

Course

535

Subject

Computer Science

Date

Apr 3, 2024

Type

docx

Pages

3

Uploaded by Manojmanu7

Report
CIS 535-T301 MANAGEMENT AND DESIGN OF DATABASE WEEK 5 ASSIGNMENT STUDENT NAME: MANOJ KUMAR MARRIBOYINA STUDENT ID: 21430414 PROFESSOR: PATRICK NIELAND
1. Write the SQL code that will select the MOD_CODE and MOD_MANUFACTURER from the MODEL table where the MOD_CODE starts with “C”. 2. Write the SQL code that will select the EMP_NUM, EMP_LNAME and EMP_FNAME from the EMPLOYEE table where the EMP_FNAME is only five characters in length. 3. Using the data in the CHARTER table, write the SQL code that will yield the sum CHAR_DISTANCE grouped by CHAR_DESTINATION. The results of running this query are shown below. CHAR_DESTINATION DISTANCE ATL 3893 BNA 672 GNV 6367 MOB 884 MQY 312 STL 1452 TYS 1932 4. Using the data in the CHARTER table, write a query that will list the CHAR_DATE and CHAR_DESTINATION and a computed column for the total changes that is calculated by CHAR_HOURS_FLOWN * 1.29. 5. Write the SQL code required to list the MOD_CODE, MOD_NAME from the MODEL table where the MOD_NAME contains the word “Air”. 6. Write the SQL code required to list the sum of CHAR_DISTANCE from the CHARTER table where the CHAR_DESTINATION is “ATL”. The results of running this query are shown below. TOTAL_DISTANCE 3893 7. Write the SQL code required to list the CHAR_DATE, CHAR_DESTINATION, CHAR_DISTANCE from the CHARTER table where the CHAR_DISTANCE is greater than 500 order by the CHAR_DISTANCE in descending order. 8. Write the SQL code required to list the distinct CHAR_DESTINATION values (hint: research distinct) 9. Write the SQL code required to list the EMP_NUM and EARNRTG_DATE from the EARNEDRATING table where the RTG_CODE is equal to “CFI” and EMP_NUM is equal to 105. 10. Write the SQL code required to list the EMP_TITLE and RTG_CODE from joining the EARNEDRATING and EMPLOYEE tables. 1a. SELECT MOD_CODE, MOD_MANUFACTURER FROM MODEL WHERE MOD_CODE LIKE ‘C%’ 2a. SELECT EMP_NUM, EMP_LNAME, EMP_FNAME FROM EMPLOYEE WHERE LENGTH (EMP_FNAME) = 5;
Your preview ends here
Eager to read complete document? Join bartleby learn and gain access to the full version
  • Access to all documents
  • Unlimited textbook solutions
  • 24/7 expert homework help