Question

I need to write a SQL procedure that will look for sections with an enrollment less than 6 with the following information:

course.course_no,

course.course_description,

section.section_no,

CountOfEnrollment (which is less than 6)

Given the following tables:

Course:

NM + ON OO COURSE_NO DESCRIPTION 10 Test Course 20 Intro to Information Systems 25 Intro to Programming 80 Programming Techni

Section:

SECTION_ID COURSE_NO 79 350 80 10 81 82 nm . ONO 83 84 85 SECTION_NO START_DATE_TIME LOCATION INSTRUCTOR_ID 3 14-APR-17 L509Enrollment:

STUDENT_ID 215 215 216 217 NM ONO 218 220 221 223 223 SECTION_ID ENROLL DATE FINAL GRADE CREATED_BY CREATED_DATE MODIFIED_BY

ENROLLMENT PF* STUDENT_ID NUMBER (8) PF* SECTION_ID NUMBER (8) * ENROLL_DATE DATE FINAL_GRADE NUMBER (3) * CREATED_BY VARCHAR

0 0
Add a comment Improve this question Transcribed image text
Answer #1

SQL PROCEDURE:

CREATE PROCEDURE enrollment_info

AS

SELECT course.course_no, course.course_description, section_no

FROM course, section, enrollment

WHERE course.course_no=section.course_no

AND section.section_id=enrollment.section_id

GROUP BY enrollment.section_id

HAVING COUNT(enrollment.section_id)<6;

To execute created procedure, the SQL syntax is:

EXEC procedure_name;

Hence:

EXEC enrollment_info;

On executing the above statement the required information is resulted as output.

Add a comment
Know the answer?
Add Answer to:
I need to write a SQL procedure that will look for sections with an enrollment less...
Your Answer:

Post as a guest

Your Name:

What's your source?

Earn Coins

Coins can be redeemed for fabulous gifts.

Not the answer you're looking for? Ask your own homework help question. Our experts will answer your question WITHIN MINUTES for Free.
Similar Homework Help Questions
  • If there are any seasonality or relationship between the price and the US oil price? How...

    If there are any seasonality or relationship between the price and the US oil price? How to analyze? Jan-10 2.769 Jan-11 3.148 Jan-12 3.44 Jan-13 3.391 Jan-14 3.392 Feb-10 2.699 Feb-11 3.264 Feb-12 3.64 Feb-13 3.736 Feb-14 3.434 Mar-10 2.824 Mar-11 3.615 Mar-12 3.907 Mar-13 3.779 Mar-14 3.606 Apr-10 2.9 Apr-11 3.852 Apr-12 3.958 Apr-13 3.638 Apr-14 3.735 May-10 2.89 May-11 3.96 May-12 3.791 May-13 3.675 May-14 3.75 Jun-10 2.785 Jun-11 3.735 Jun-12 3.596 Jun-13 3.689 Jun-14 3.766 Jul-10 2.782...

  • Date Gasoline Crude Oil Jan 01, 2010 2.031 79.07 Jan 08, 2010 2.124 82.34 Jan 15,...

    Date Gasoline Crude Oil Jan 01, 2010 2.031 79.07 Jan 08, 2010 2.124 82.34 Jan 15, 2010 2.079 80.06 Jan 22, 2010 2.010 76.62 Jan 29, 2010 1.942 73.94 Feb 05, 2010 1.885 74.57 Feb 12, 2010 1.908 73.88 Feb 19, 2010 2.031 78.25 Feb 26, 2010 2.042 79.22 Mar 05, 2010 2.127 80.19 Mar 12, 2010 2.154 81.76 Mar 19, 2010 2.150 81.44 Mar 26, 2010 2.118 80.65 Apr 02, 2010 2.191 83.01 Apr 09, 2010 2.238 85.66 Apr...

  • What is the major product for each reaction? Could you please draw the mechanism? JAN FEB...

    What is the major product for each reaction? Could you please draw the mechanism? JAN FEB MAR APR MAY 01 02 03 04 05 06 07 08 09 10 11 12 13 JUN 14 15 16 JUL AUG SEP O 17 18 19 20 21 22 23 24 25

  • calculate the monthly time-weighted and money weighted returns for shareholders in the ADKSX with using excel....

    calculate the monthly time-weighted and money weighted returns for shareholders in the ADKSX with using excel. In a text box nearby, comment on whether investors’ trading decisions have created value. Month ADKSX Return (%) ADKSX Cash Flow ($) Nov-09 3.49 -$10,648,393 Dec-09 6.93 -$618,800 Jan-10 -2.05 $940,820 Feb-10 5.74 -$2,484,437 Mar-10 5.19 -$3,699,836 Apr-10 5.48 -$1,379,757 May-10 -4.68 $2,145,936 Jun-10 -6.31 -$2,953,884 Jul-10 5.9 -$4,160,472 Aug-10 -5.18 $1,096,304 Sep-10 8.61 -$5,571,657 Oct-10 4.5 -$669,464 Nov-10 2.77 -$3,145,367 Dec-10 9.16 -$6,162,018...

  • On Blackboard under "Course Content / Homeworks and Practice Tests" there is an Excel file titled...

    On Blackboard under "Course Content / Homeworks and Practice Tests" there is an Excel file titled "HW 6 Data" with monthly stock return data to be used for this question: What is Deckers Outdoor Corporation's [DECK] beta? Round to two decimal places. [Hint: Take S&P 500 as a proxy for the market, and use the beta formula from the book. You will need to use two Excel functions: STDEV.S and CORREL] Numeric Answer S&PS00 DECK NKE SBUX -1.5% Ос-19 7.4%...

  • Calculate the sample correlation coefficient rxy. Calculate the value of the test statistic. Date Energy Healthcare...

    Calculate the sample correlation coefficient rxy. Calculate the value of the test statistic. Date Energy Healthcare Jan-10 -4.87 -0.15 Feb-10 1.8 0.53 Mar-10 2.26 1.41 Apr-10 3.03 -3.75 May-10 -11.5 -5.12 Jun-10 -5.67 -0.52 Jul-10 8.73 1.49 Aug-10 -5.99 -0.97 Sep-10 10.15 8.24 Oct-10 3.89 2.28 Nov-10 2.85 -2.52 Dec-10 5.55 1.4 Jan-11 6.6 1.55 Feb-11 5.7 3.04 Mar-11 1.32 1.22 Apr-11 1.64 5.89 May-11 -4.06 2.62 Jun-11 -2.08 -0.55 Jul-11 1.14 -2.64 Aug-11 -10.41 -2.8 Sep-11 -15.06 -4.17 Oct-11...

  • I need the answer to #2 listed above. This is the code I have come up...

    I need the answer to #2 listed above. This is the code I have come up with, and it is wrong. I am new to this and need help. group by sust.cida Q2 (7 Points) Show customer id (CID) for customers who have spent 30,000 or more with the company in 2019. Money is considered "spent" when the entire work order is completed as recorded in workorder.completionDate. (Correct query will find customer 2). Use ONE SQL statement. select workarder.id from...

  • From the following monthly stock prices assume rf of 0.5% per month and calculate 1.Monthly growth...

    From the following monthly stock prices assume rf of 0.5% per month and calculate 1.Monthly growth return 2.CAPM and beta 3.Average return 4.Variance 5.Covariance 6. Assume a credit rating and calculate a VAT assuming debt to equity structure 1 date share price benchmark 2 Mar 18 3 Feb-18 4 Jan-18 5 Dec-17 6 Nov-17 7 Oct-17 8 Sep-17 304.85 24,263.35 322.3 25,107.40 354.4 27,379.45 315.15 25,539.45 306.9 25,332.40 314.25 25,019.35 350 24.053.00 350.61 24,318.40 361.9 25,103.65 292.7 23,211.20 286.27 23,424.80...

  • Consider five years of monthly sales data for a company in the attached file (Q5.xlsx). a) Foreca...

    Consider five years of monthly sales data for a company in the attached file (Q5.xlsx). a) Forecast monthly sales for the next year (2020). (10 marks) b) Discuss whether a simple exponential smoothing model works well with this data or not. (5 m 7 9 Month Sales 747 Feb-14 697 Mar-14 1014 Jan-14 Ap4 1126 May-14 1105 Jun-14 1450 Jul-14 1633 Aug-14 1711 Sep-14 1307 Oct-1223 Nov-14 9T5 Dec-14S53 4J-15 1024 Feb-15928 Mar-151442 7Apr-151371 May-15 1536 Ju15 2004 Jul-15 1854...

  • SQL: CREATE STATEMENT For patients whose last name matches the name entered by the user, display...

    SQL: CREATE STATEMENT For patients whose last name matches the name entered by the user, display their first name, phone number, and doctor's name. Note: Try Davis. (TEXT FOR DATABASE BELOW) DROP TABLE PATIENT; DROP TABLE BILLING; DROP TABLE DOCTOR; CREATE TABLE DOCTOR( DOC_ID VARCHAR2(10) NOT NULL, DOC_NAME VARCHAR2(20), DATEHIRED DATE, SALPERMON NUMBER(8), AREA VARCHAR2(20), SUPERVISOR_ID NUMBER(8), CHGPERAPPT NUMBER(8), ANNUAL_BONUS NUMBER(8), PRIMARY KEY (DOC_ID) ); INSERT INTO DOCTOR VALUES('432', 'Harrison', to_date('05-DEC-1994','dd-mon-yyyy'), 12000, 'Pediatrics', 100, 75, 4500); INSERT INTO DOCTOR VALUES('509',...

ADVERTISEMENT
Free Homework Help App
Download From Google Play
Scan Your Homework
to Get Instant Free Answers
Need Online Homework Help?
Ask a Question
Get Answers For Free
Most questions answered within 3 hours.
ADVERTISEMENT
ADVERTISEMENT
ADVERTISEMENT