Question

SQL – Microsoft Access

--------------------------------------------------------------------------

Display the percent of charter trips that have co-pilots and use COUNT

------------------------------------------------------------------------------

CHAR PLOT CHAR COPILOT AC NUMBER CHAR DESTINATION CHAR DISTANCE CHAR HOURS FLOWN CHAR HOURS AT CHAR FUEL GALLONS CHAR OL QTS

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

SELECT ((COUNT(CHAR_COPILOT)/COUNT(CHAR_TRIP))*100 AS PERCENT_TRIP FROM <TABLE_NAME>

explanation:

COUNT(variable) -- counts the no of rows which dont have NULL as their value.

COUNT(*) -- returns the all rows which have null and not nulla.

COUNT(CHAR_COPILOT) gives only no of copilots which have the values (doesnt consider nulls)

COUNT(CHAR_TRIP) - gives only no of trips which have the values (doesnt consider nulls)

(COUNT(CHAR_COPILOT)/COUNT(CHAR_TRIP)) -- divides the no of copilot rows with no of total trips

then multiply with 100 to get percentage.

note: if u have any doubt, let me know.

Add a comment
Know the answer?
Add Answer to:
SQL – Microsoft Access -------------------------------------------------------------------------...
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
  • SQL- Microsoft Access List the employee number, employee last name, and pilot license type (if an...

    SQL - Microsoft Access --------------------------------------------------------------------- SQL- Microsoft Access List the employee number, employee last name, and pilot license type (if any) for all employees. (Hint: LEFT oUTER JOIN or OUTER JOIN must be used, because "if any"-some of them are not pilots). EMP NUM EMP TITLE EMP LNAME EMP FNAME EMP INITIAL EMP DOB EMP HIRE_DATE Click to Add 100 Mr 101 Ms. 102 Mr 103 Ms. 104 Mr 105 Mr 106 Mrs 107 Mr 108 Mr 109 Ms. 110...

  • Partial Question 10 1/2 pts Give the SQL statement to list the trip name and state...

    Partial Question 10 1/2 pts Give the SQL statement to list the trip name and state for each trip that occurs during one of the Fall seasons that is Early Fall, Spring and Late Fall. Sort by State. Use the wildcard for the season. SELECT TripName, State FROM Trip WHERE Season LIKE '%Fall' OR SEA ORDER BY State: Answer 1: LIKE '%Fall' OR SEASON LIKE 'Spring' Answer 2: ORDER BY Partial Question 11 1/2 pts Give the SQL statement to...

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