Query an alphabetically ordered list of all names in OCCUPATIONS, immediately followed by the first letter of each profession as a parenthetical (i.e.: enclosed in parentheses). For example: AnActorName(A), ADoctorName(D), AProfessorName(P), and ASingerName(S). Query the number of ocurrences of each occupation in OCCUPATIONS. Sort the occurrences in ascending order, and output them in the following format:
There are a total of [occupation_count] [occupation]s. where [occupation_count] is the number of occurrences of an occupation in OCCUPATIONS and [occupation] is the lowercase occupation name. If more than one Occupation has the same [occupation_count], they should be ordered alphabetically.
Note: There will be at least two entries in the table for each type of occupation.
Input Format
The OCCUPATIONS table is described as follows: Occupation will only contain one of the following values: Doctor, Professor, Singer or Actor.
Sample Input
An OCCUPATIONS table that contains the following records:
Sample Output
Ashely(P) Christeen(P) Jane(A) Jenny(D) Julia(A) Ketty(P) Maria(A) Meera(S) Priya(S) Samantha(D) There are a total of 2 doctors. There are a total of 2 singers. There are a total of 3 actors. There are a total of 3 professors. Explanation
The results of the first query are formatted to the problem description's specifications. The results of the second query are ascendingly ordered first by number of names corresponding to each profession(2<=2<=3<=3) and then alphabetically by profession. (doctor<=singer) and (actor<=professor)
Query an alphabetically ordered list of all names in OCCUPATIONS, immediately followed by the first letter of each profession as a parenthetical (i.e.: enclosed in parentheses). For example: AnActorName(A), ADoctorName(D), AProfessorName(P), and ASingerName(S). Query the number of ocurrences of each occupation in OCCUPATIONS. Sort the occurrences in ascending order, and output them in the following format:
There are a total of [occupation_count] [occupation]s. where [occupation_count] is the number of occurrences of an occupation in OCCUPATIONS and [occupation] is the lowercase occupation name. If more than one Occupation has the same [occupation_count], they should be ordered alphabetically.
Note: There will be at least two entries in the table for each type of occupation.
Input Format
The OCCUPATIONS table is described as follows: Occupation will only contain one of the following values: Doctor, Professor, Singer or Actor.
Sample Input
An OCCUPATIONS table that contains the following records:
Sample Output
Ashely(P) Christeen(P) Jane(A) Jenny(D) Julia(A) Ketty(P) Maria(A) Meera(S) Priya(S) Samantha(D) There are a total of 2 doctors. There are a total of 2 singers. There are a total of 3 actors. There are a total of 3 professors. Explanation
The results of the first query are formatted to the problem description's specifications. The results of the second query are ascendingly ordered first by number of names corresponding to each profession(2<=2<=3<=3) and then alphabetically by profession. (doctor<=singer) and (actor<=professor)
Weather Observation Longest Query the two cities in STATION with the longest, as well as their lengths (i.e.: number of characters in the name). Input Format The STATION table is described as follows: Input Fornmat The STATION table is described as follows:
SESSION NAME:Advance Select - 2 QUESTION NAME: Weather Observation - Shortest Query 4 TABLE DESCRIPTION Query the two cities in STATION with the shortest names, as well as their respective lengths (i.e.: number of characters in the name). If there is more than one smallest choose the one that comes first when ordered alphabetically.
Input Format
The STATION table is described as follows: Input Format
The STATION table is described as follows:
where LAT_N is the northern latitude and LONG_W is the western longitude.
Sample Input
Let's say that CITY only has three entries: DEF, ABC, and WXY
Sample Output
ABC 3
Explanation
When ordered alphabetically, the CITY names are listed as ABC, DEF, and WXY, with the respective lengths 3, 3, and 3. But there are 3 options for shortest-named city; we choose ABC, because it comes first alphabetically.
8 Comments
PLEASE leave your QUESTION that need to be uploaded or
ReplyDeleteIF ANYTHING IS MISSING please leave it in the comments.
Q; The PADS
DeleteGenerate the following two result sets:
Query an alphabetically ordered list of all names in OCCUPATIONS, immediately followed by the first letter of each profession as a parenthetical (i.e.: enclosed in parentheses). For example: AnActorName(A), ADoctorName(D), AProfessorName(P), and ASingerName(S).
Query the number of ocurrences of each occupation in OCCUPATIONS. Sort the occurrences in ascending order, and output them in the following format:
There are a total of [occupation_count] [occupation]s.
where [occupation_count] is the number of occurrences of an occupation in OCCUPATIONS and [occupation] is the lowercase occupation name. If more than one Occupation has the same [occupation_count], they should be ordered alphabetically.
Note: There will be at least two entries in the table for each type of occupation.
Input Format
The OCCUPATIONS table is described as follows: Occupation will only contain one of the following values: Doctor, Professor, Singer or Actor.
Sample Input
An OCCUPATIONS table that contains the following records:
Sample Output
Ashely(P)
Christeen(P)
Jane(A)
Jenny(D)
Julia(A)
Ketty(P)
Maria(A)
Meera(S)
Priya(S)
Samantha(D)
There are a total of 2 doctors.
There are a total of 2 singers.
There are a total of 3 actors.
There are a total of 3 professors.
Explanation
The results of the first query are formatted to the problem description's specifications.
The results of the second query are ascendingly ordered first by number of names corresponding to each profession(2<=2<=3<=3) and then alphabetically by profession. (doctor<=singer) and (actor<=professor)
Q; The PADS
ReplyDeleteGenerate the following two result sets:
Query an alphabetically ordered list of all names in OCCUPATIONS, immediately followed by the first letter of each profession as a parenthetical (i.e.: enclosed in parentheses). For example: AnActorName(A), ADoctorName(D), AProfessorName(P), and ASingerName(S).
Query the number of ocurrences of each occupation in OCCUPATIONS. Sort the occurrences in ascending order, and output them in the following format:
There are a total of [occupation_count] [occupation]s.
where [occupation_count] is the number of occurrences of an occupation in OCCUPATIONS and [occupation] is the lowercase occupation name. If more than one Occupation has the same [occupation_count], they should be ordered alphabetically.
Note: There will be at least two entries in the table for each type of occupation.
Input Format
The OCCUPATIONS table is described as follows: Occupation will only contain one of the following values: Doctor, Professor, Singer or Actor.
Sample Input
An OCCUPATIONS table that contains the following records:
Sample Output
Ashely(P)
Christeen(P)
Jane(A)
Jenny(D)
Julia(A)
Ketty(P)
Maria(A)
Meera(S)
Priya(S)
Samantha(D)
There are a total of 2 doctors.
There are a total of 2 singers.
There are a total of 3 actors.
There are a total of 3 professors.
Explanation
The results of the first query are formatted to the problem description's specifications.
The results of the second query are ascendingly ordered first by number of names corresponding to each profession(2<=2<=3<=3) and then alphabetically by profession. (doctor<=singer) and (actor<=professor)
We will Try bro
DeleteWe have uploaded answer for THE PADS
DeleteWeather Observation Longest
ReplyDeleteQuery the two cities in STATION with the longest, as well as their lengths (i.e.: number of characters in the name). Input Format The STATION table is described as follows: Input Fornmat The STATION table is described as follows:
Need answers for weather Observation Longest and shortest and also for The Pads
ReplyDeleteSESSION NAME:Advance Select - 2
ReplyDeleteQUESTION NAME: Weather Observation - Shortest Query 4
TABLE DESCRIPTION
Query the two cities in STATION with the shortest names, as well as their respective lengths (i.e.: number of characters in the name). If there is more than one smallest choose the one that comes first when ordered alphabetically.
Input Format
The STATION table is described as follows:
Input Format
The STATION table is described as follows:
where LAT_N is the northern latitude and LONG_W is the western longitude.
Sample Input
Let's say that CITY only has three entries: DEF, ABC, and WXY
Sample Output
ABC 3
Explanation
When ordered alphabetically, the CITY names are listed as ABC, DEF, and WXY, with the respective lengths 3, 3, and 3. But there are 3 options for shortest-named city; we choose ABC, because it comes first alphabetically.