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...

  • A guide to SQL 9th edition Colonial Adventure Tours chapter 3 page 90-92 Odd numbered exercises...

    A guide to SQL 9th edition Colonial Adventure Tours chapter 3 page 90-92 Odd numbered exercises only figure 3-39(Guide, trip, customer, reservation and Trip_Guides) figure 1-5 chapter 1: 7. Review me on TUI UTILIVUDIJ types used to create the ITEM table in Figure 3-34. Suggest alternate data types for the DESCRIPTION, ON HAND. and STOREHOUSE fields and explain your recommendation Colonial Adventure Tours Use SQL to complete the following exercises 1. Create a table named ADVENTURE TRIP. The table has...

  • * myCompany.SQL Introduction to SQL Script file for ORACLE DBMS This script file creates the following...

    * myCompany.SQL Introduction to SQL Script file for ORACLE DBMS This script file creates the following tables: VENDOR, PRODUCT, CUSTOMER, INVOICE, LINE EMPLOYEE and loads the default data rows */ set echo on; set serveroutput on; select systimestamp from dual; show user; ALTER SESSION SET NLS_DATE_FORMAT = 'DD-MON-YYYY'; DROP TABLE LINE CASCADE CONSTRAINTS; DROP TABLE INVOICE CASCADE CONSTRAINTS; DROP TABLE CUSTOMER CASCADE CONSTRAINTS; DROP TABLE PRODUCT CASCADE CONSTRAINTS; DROP TABLE VENDOR CASCADE CONSTRAINTS; DROP TABLE EMPLOYEE CASCADE CONSTRAINTS; CREATE TABLE...

  • Find the equation of the regression line for the given data. Then construct a scatter plot...

    Find the equation of the regression line for the given data. Then construct a scatter plot of the data and draw the regression line. (The pair of variables have a significa correlation.) Then use the regression equation to predict the value of y for each of the given x-values, if meaningful. The table below shows the heights (in feet) and the number of stories of six notable buildings in a city. Height, x 758 621 518 510 492 483 (a)...

  • Create SQL statements based on the given tables: Code to create the tables: CREATE DATABASE LAB...

    Create SQL statements based on the given tables: Code to create the tables: CREATE DATABASE LAB4DB; USE LAB4DB; CREATE TABLE CUSTOMER ( CUS_CODE int primary key, CUS_LNAME varchar(15), CUS_FNAME varchar(15), CUS_INITIAL varchar(1), CUS_AREACODE varchar(3), CUS_PHONE varchar(8), CUS_BALANCE float(8) ); INSERT INTO CUSTOMER VALUES('10010','Ramas','Alfred','A','615','844-2573','0'); INSERT INTO CUSTOMER VALUES('10011','Dunne','Leona','K','713','894-1238','0'); INSERT INTO CUSTOMER VALUES('10012','Smith','Kathy','W','615','894-2285','345.86'); INSERT INTO CUSTOMER VALUES('10013','Olowski','Paul','F','615','894-2180','536.75'); INSERT INTO CUSTOMER VALUES('10014','Orlando','Myron','','615','222-1672','0'); INSERT INTO CUSTOMER VALUES('10015','O''Brian','Amy','B','713','442-3381','0'); INSERT INTO CUSTOMER VALUES('10016','Brown','James','G','615','297-1228','221.19'); INSERT INTO CUSTOMER VALUES('10017','Williams','George','','615','290-2556','768.93'); INSERT INTO CUSTOMER VALUES('10018','Farriss','Anne','G','713','382-7185','216.55'); INSERT INTO CUSTOMER VALUES('10019','Smith','Olette','K','615','297-3809','0'); /*...

  • 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
ADVERTISEMENT