CS580_Assign2_DeepakMuthaiyan
.docx
keyboard_arrow_up
School
Boston University *
*We aren’t endorsed by this school
Course
580
Subject
Computer Science
Date
Dec 6, 2023
Type
docx
Pages
6
Uploaded by SargentMask24623
CS 580
Assignment 2
Name: Deepak Muthaiyan
BU ID : U12253188
A)
SELECT
(sum(CASE gender WHEN 'Male' then 1 else 0 end)/sum(1))*100 as
malePercent
FROM `patient_core`
The male percent is 48%
B)
SELECT
(sum(CASE race WHEN 'African American' then 1 else 0
end)/sum(1))*100 as AfricanAmercianPercent
FROM `patient_core`
The AmericanAfricanPercent is 15%
C)
SELECT COUNT(primary_diagnosis_description) FROM
`admission_diagnosis_core` WHERE
admission_diagnosis_core.primary_diagnosis_description like '%type
%1%diabetes%'
Admissions for
Type 1 Diabetes
is 580
D)
SELECT COUNT(DISTINCT patient_id) FROM `admission_diagnosis_core`
WHERE primary_diagnosis_code LIKE '%E10%'
Patients admitted due to Type 1 Diabetes is 567
E)
We are taking the 3 patients.
The ids are :
009ED699-7264-4BC6-80BC-6214321FA867
016A4267-593F-4520-968E-FD8F97FC4E42
02B867CE-8212-4E86-83F3-80D20AAB8FBA
For Patient id
02B867CE-8212-4E86-83F3-80D20AAB8FBA we can see
gender is female, Date of birth is 1937-04-23, Race is white, Martial
status is married, Her language is English,
population_percentage_below_poverty is 15.29 and she was admitted 5
times in the hospital
SELECT * FROM `patient_core` WHERE id='02B867CE-8212-4E86-83F3-
80D20AAB8FBA'
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
Related Questions
Company Dinner
Lili works part-time in a restaurant near her campus as a waitress. One day, a boss from a company down the street decided to hold a company dinner in the restaurant she worked at. Before the dinner, the food is arranged in a sorted order A according to their type. Moments later, the manager of the restaurant confronted Lili and asks Q questions, each one asks how many foods of type Bi are there. Lili has asked you as her friend to help her count and answer as fast as possible.
Format Input
A single line with two integers N and Q denoting the number of food and the number of question respectively, followed by a line containing N elements denoting the type of the foods and another Q lines each containing a single integer denoting the number of occurrences of the type of food asked by the manager.
Format Output
Q lines each with a single integer denoting the number of occurence of Bi
in A.
Constraints
• 1 ≤ N, Q ≤ 10^5
• 1 ≤ Ai, Bi ≤ 10^9
• Ai ≤ Aj for all 1 ≤ i ≤ j ≤ N…
arrow_forward
Querry
arrow_forward
Some rows of the STUGRADE table of a school are shown below:
STU_CODE
CLS_CODE
GRADE
YEAR
291
111
3.1
2010
938
101B
2.3
2011
931
M101
3.3
2040
291
M101
3.4
2018
190
111
2.0
2021
931
321
3.9
2003
Suppose that STU_CODE is the student code (foreign key) and CLS_CODE is the class code (foreign key). Which of the following computes the average for each year of the student with code 931?
a.
SELECT AVG(GRADE) FROM STUGRADE WHERE STU_CODE = 931 GROUP BY YEAR
b.
SELECT AVG(GRADE) FROM STUGRADE WHERE STU_CODE = 931.
c.
SELECT AVG(GRADE) FROM STUGRADE GROUP BY STU_CODE = 931
d.
SELECT AVG(GRADE) FROM STUGRADE WHERE STU_CODE = 931 GROUP BY AVG(GRADE)
arrow_forward
Question 64
arrow_forward
Code 4 SELECT statements to exemplify nested and/or correlated nested queries.
arrow_forward
Question 8
Find the score (mean accuracy) of your knn classifier using x_test and y_test.
This function should return a float between 0 and 1
[ ]: def answer_eight():
# YOUR CODE HERE
raise NotImplementedError()
[ ]:
arrow_forward
In the binary data below "1" is assigned to students who are business majors in a statistics class and "0" is for all other majors.
1
1
1
0
1
1
1
1
0
1
1
1
1
1
1
1
1
1
0
1
1
1
1
1
1
1
1
1
1
1
1
1
1
0
1
0
1
1
1
1
1
1
0
1
1
1
1
0
1
0
0
1
1
1
1
1
1
0
1
1
1
1
1
1
1
1
1
0
0
1
1
1
1
1
1
0
1
1
1
1
1
0
1
1
1
1
1
1
1
1
0
1
1
1
1
1
0
1
1
1
0
1
1
0
1
1
1
1
1
1
1
1
1
0
1
1
1
1
0
0
1
0
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
17
What proportion of students are business majors?
a
0.894
b
0.868
c
0.843
d
0.818
arrow_forward
Please print from the which generation are you
arrow_forward
Task 2
Use function to calculate Computer Skills. Both skills Yes: show "Sufficient", only one skill: show "Good", no skill: show "Poor"
Computer Skills
Student ID
521370
811298
780223
528112
427747
207676
158877
154194
480967
962948
701444
803700
268544
975048
204401
846716
127466
621984
285594
826758
972888
739477
857713
339297
249521
868320
872950
198271
702356
726662
365857
136850
492928
850557
987114
776815
666031
904552
161237
268716
Software Skill
Yes
Yes
Yes
No
Yes
Yes
No
Yes
No
No
Yes
No
No
Yes
Yes
No
No
No
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
No
Yes
No
Yes
No
Yes
No
Yes
No
Yes
No
Yes
Yes
Yes
Hardware Skill
No
Yes
Yes
No
Yes
Yes
No
No
Yes
No
Yes
No
No
No
No
Yes
No
No
No
No
Yes
Yes
Yes
Yes
No
No
Yes
No
Yes
No
Yes
Yes
| No
Yes
Yes
Yes
No
Yes
Yes
Yes
arrow_forward
Topic name: data structures please solve quickly
arrow_forward
pls help me databaste
arrow_forward
Hospital :ER Case Study
A General Hospital consists of a number of specialized wards (such
as Radiology, Oncology, etc).Information about ward includes unique
name, total numbers of current patients. Each ward hosts a number of
patients, who were admitted by a consultant (doctors) employed by the
Hospital. On admission, the date and time are kept. The personal
details of every patient includes name, Medical Recode Number
(MRN), set of phone and one address (city, street, code). A separate
register is to be held to store the information of the tests undertaken.
Each test has unique episode No., category and the final result of test.
Number of tests may be conducted for each patient. Doctors are
specialists in a specific ward and may be leading consultants for a
number of patients. Each patient is assigned to one leading consultant
but may be examined by other doctors, if required.
arrow_forward
Hospital :ER Case Study
A General Hospital consists of a number of specialized wards (such
as Radiology, Oncology, etc) .Information about ward includes unique
name, total numbers of current patients. Each ward hosts a number of
patients, who were admitted by a consultant (doctors) employed by the
Hospital. On admission, the date and time are kept. The personal
details of every patient includes name, Medical Recode Number
(MRN), set of phone and one address (city, street, code). A separate
register is to be held to store the information of the tests undertaken.
Each test has unique episode No. , category and the final result of test.
Number of tests may be conducted for each patient. Doctors are
specialists in a specific ward and may be leading consultants for a
number of patients. Each patient is assigned to one leading consultant
but may be examined by other doctors, if required.
u
arrow_forward
v. Display only the StudentID, Programming Score and the Maths Score.
vi. Show records of students with ID numbers from BIT2016003 to BIT2016005
vii. Select records of students who scored below 70 in Maths.
viii. Insert the sixth record with Student ID=BIT2016006, First name =Gabriela, Surname =
Yeboah, Maths =82, French=79 and Programming=58.
ix. Select student(s) whose first name begins with the letter “J”.
x. Delete student whose ID = BIT2016004
xi. Remove the surname column from the table
xii. Change the French score to 79 for Student ID = BIT2016002
xiii. Remove the Student table from the database
xiv. Remove MySchool database from the computer
arrow_forward
c++
arrow_forward
Pl/sql
arrow_forward
Write a program to find the
results of the following
options Select case
1_Marriage numbers group 0
- 300
2_The confined set of
numbers 301 - 500
3_Individual set of numbers
501 - 1999
arrow_forward
Q2
arrow_forward
123
4
5
6
7
8
A
B
Paper Type
Name
Letter Stock
65lb Cover Stock
Premium White Copy Paper
2 Hole punch Letter
Ultra-White Cardstock
C
Quantity
100
17
25
66
87
DE
Discount
25%
5%
10%
15%
20%
F
Order Discounts
G
Minimum Quantity Discount
0
25
50
75
100
5%
10%
15%
20%
25%
In the above spreadsheet, create a formula in cell D4 that uses
the VLOOKUP function with the table array $F$4:$G$8. The formula will determine
the applicable discount for each paper type order. You should be able to autofill this
formula down through cells D4:D8.
arrow_forward
Whoever must play, cannot play def subtract_square(queries):
Two players play a game of "Subtract a square", starting with a positive integer. On their turn to play, each player must subtract some square number (1, 4, 9, 16, 25, 36, 49, ...) from the current number so that the result does not become negative. Under the normal play convention of these games, the player who moves to zero wins, leaving his opponent stuck with no possible moves. (In the misère version of the game that has otherwise identical rules but where you win by losing the original game, these definitions would be adjusted accordingly.)
This and many similar combinatorial games can be modelled with recursive equations. This game is an example of an impartial game since the moves available to both players are exactly the same, as opposed to “partisan games” such as chess where each player can only move pieces of one colour. A game state is therefore determined by the remaining number alone, but not by which player has…
arrow_forward
SUNSHINE AIRLINE COMPANY
The ER Diagram for the SUNSHINE AIRLINE COMPANY is based on the following:
- For each airplane type, we keep track of a unique airplane type ID (AirplaneTypelD), number of engines
(NoOfEngines), and number of seats (NoOfSeats).
- For each airport, we keep track of a unique airport ID (AirportID), and the length of the main runway
(LengthOfRunway).
- Each airplane type is able to land at one airport at least, but may be able to land at many airports. Each
airport accommodates landing of at least one airplane type, but may accommodate landing of more airplane
types.
SUNSHINE AIRLINE COMANY (ERD)
XXX
YYY
zzz
PPP
AAA
Relationship
BBB
Symbol1
Symbol2
In the ER Diagram for the SUNSHINE AIRLINE COMPANY, which word should replace gg?
O LengthOfRunway
O NoOfEngines
O AirplaneTypelD
O AirportID
O NoOfSeats
arrow_forward
SEE MORE QUESTIONS
Recommended textbooks for you
Np Ms Office 365/Excel 2016 I Ntermed
Computer Science
ISBN:9781337508841
Author:Carey
Publisher:Cengage
Related Questions
- Company Dinner Lili works part-time in a restaurant near her campus as a waitress. One day, a boss from a company down the street decided to hold a company dinner in the restaurant she worked at. Before the dinner, the food is arranged in a sorted order A according to their type. Moments later, the manager of the restaurant confronted Lili and asks Q questions, each one asks how many foods of type Bi are there. Lili has asked you as her friend to help her count and answer as fast as possible. Format Input A single line with two integers N and Q denoting the number of food and the number of question respectively, followed by a line containing N elements denoting the type of the foods and another Q lines each containing a single integer denoting the number of occurrences of the type of food asked by the manager. Format Output Q lines each with a single integer denoting the number of occurence of Bi in A. Constraints • 1 ≤ N, Q ≤ 10^5 • 1 ≤ Ai, Bi ≤ 10^9 • Ai ≤ Aj for all 1 ≤ i ≤ j ≤ N…arrow_forwardQuerryarrow_forwardSome rows of the STUGRADE table of a school are shown below: STU_CODE CLS_CODE GRADE YEAR 291 111 3.1 2010 938 101B 2.3 2011 931 M101 3.3 2040 291 M101 3.4 2018 190 111 2.0 2021 931 321 3.9 2003 Suppose that STU_CODE is the student code (foreign key) and CLS_CODE is the class code (foreign key). Which of the following computes the average for each year of the student with code 931? a. SELECT AVG(GRADE) FROM STUGRADE WHERE STU_CODE = 931 GROUP BY YEAR b. SELECT AVG(GRADE) FROM STUGRADE WHERE STU_CODE = 931. c. SELECT AVG(GRADE) FROM STUGRADE GROUP BY STU_CODE = 931 d. SELECT AVG(GRADE) FROM STUGRADE WHERE STU_CODE = 931 GROUP BY AVG(GRADE)arrow_forward
- Question 64arrow_forwardCode 4 SELECT statements to exemplify nested and/or correlated nested queries.arrow_forwardQuestion 8 Find the score (mean accuracy) of your knn classifier using x_test and y_test. This function should return a float between 0 and 1 [ ]: def answer_eight(): # YOUR CODE HERE raise NotImplementedError() [ ]:arrow_forward
- In the binary data below "1" is assigned to students who are business majors in a statistics class and "0" is for all other majors. 1 1 1 0 1 1 1 1 0 1 1 1 1 1 1 1 1 1 0 1 1 1 1 1 1 1 1 1 1 1 1 1 1 0 1 0 1 1 1 1 1 1 0 1 1 1 1 0 1 0 0 1 1 1 1 1 1 0 1 1 1 1 1 1 1 1 1 0 0 1 1 1 1 1 1 0 1 1 1 1 1 0 1 1 1 1 1 1 1 1 0 1 1 1 1 1 0 1 1 1 0 1 1 0 1 1 1 1 1 1 1 1 1 0 1 1 1 1 0 0 1 0 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 17 What proportion of students are business majors? a 0.894 b 0.868 c 0.843 d 0.818arrow_forwardPlease print from the which generation are youarrow_forwardTask 2 Use function to calculate Computer Skills. Both skills Yes: show "Sufficient", only one skill: show "Good", no skill: show "Poor" Computer Skills Student ID 521370 811298 780223 528112 427747 207676 158877 154194 480967 962948 701444 803700 268544 975048 204401 846716 127466 621984 285594 826758 972888 739477 857713 339297 249521 868320 872950 198271 702356 726662 365857 136850 492928 850557 987114 776815 666031 904552 161237 268716 Software Skill Yes Yes Yes No Yes Yes No Yes No No Yes No No Yes Yes No No No Yes Yes Yes Yes Yes Yes Yes Yes No Yes No Yes No Yes No Yes No Yes No Yes Yes Yes Hardware Skill No Yes Yes No Yes Yes No No Yes No Yes No No No No Yes No No No No Yes Yes Yes Yes No No Yes No Yes No Yes Yes | No Yes Yes Yes No Yes Yes Yesarrow_forward
- Topic name: data structures please solve quicklyarrow_forwardpls help me databastearrow_forwardHospital :ER Case Study A General Hospital consists of a number of specialized wards (such as Radiology, Oncology, etc).Information about ward includes unique name, total numbers of current patients. Each ward hosts a number of patients, who were admitted by a consultant (doctors) employed by the Hospital. On admission, the date and time are kept. The personal details of every patient includes name, Medical Recode Number (MRN), set of phone and one address (city, street, code). A separate register is to be held to store the information of the tests undertaken. Each test has unique episode No., category and the final result of test. Number of tests may be conducted for each patient. Doctors are specialists in a specific ward and may be leading consultants for a number of patients. Each patient is assigned to one leading consultant but may be examined by other doctors, if required.arrow_forward
arrow_back_ios
SEE MORE QUESTIONS
arrow_forward_ios
Recommended textbooks for you
- Np Ms Office 365/Excel 2016 I NtermedComputer ScienceISBN:9781337508841Author:CareyPublisher:Cengage
Np Ms Office 365/Excel 2016 I Ntermed
Computer Science
ISBN:9781337508841
Author:Carey
Publisher:Cengage