answer.
Ask question
Login Signup
Ask question
All categories
  • English
  • Mathematics
  • Social Studies
  • Business
  • History
  • Health
  • Geography
  • Biology
  • Physics
  • Chemistry
  • Computers and Technology
  • Arts
  • World Languages
  • Spanish
  • French
  • German
  • Advanced Placement (AP)
  • SAT
  • Medicine
  • Law
  • Engineering
AlexFokin [52]
1 year ago
10

A blood bank maintains two tables - DONOR, with information about people who are willing to donate blood and ACCEPTOR, with info

rmation about the people who are in need of blood. The bank wants to know the number of males and the number of females with a particular blood group.
In the Output: each row must contain gender, BG and count of people with that CG and GENDER.

Table Schemas:

DONOR

Name -- Type -- Desc

DID int Donor ID
NAME VARCHAR Name of Donor
BG VARCHAR BLOOD GROUP
GENDER VARCHAR Gender
ACCEPTOR

Name -- Type -- Desc

AID int Acceptor ID
NAME VARCHAR Name of Acceptor
BG VARCHAR BLOOD GROUP
GENDER VARCHAR Gender
Computers and Technology
1 answer:
Kipish [7]1 year ago
7 0

Answer:

The sql query is given below.

Since we need to count of males and females for a particular blood group, we put xxx for the blood group.

SELECT COUNT(SELECT DID FROM DONOR WHERE GENDER LIKE "M%") as Male_Donors,

COUNT(SELECT DID FROM DONOR WHERE GENDER LIKE "F%") as Female_Donors

FROM DONOR

WHERE BG = xxx;

Explanation:

The clauses in the query are as follows.

1. SELECT: all the columns required in the output are put in this clause.

2. FROM JOIN ON: the table(s) from which the above columns are taken are put in this clause.

3. WHERE: any condition required to filter the output is put in this clause.

The query is explained below.

1. Find the number of male donors. Number of anything can be found using COUNT() function. A query is required since gender is included in deciding the type of donor.

2. The query is defined to find number of male donors as follows.

COUNT( SELECT DID FROM DONOR WHERE GENDER LIKE "M%"; )

3. In the previous query, LIKE operator is used since it is not defined what value is stored for male donors.

4. Similarly, the query to find the number of female donors is formed.

COUNT( SELECT DID FROM DONOR WHERE GENDER LIKE "F%"; )

5. Next, the final query is formed as follows.

SELECT: both COUNT() functions will come here.

FROM: table name

WHERE: specific blood group will be put here

GROUP BY: this clause is optional and is not used in this query.

HAVING: this clause is optional and is not used in this query.

6. The query after putting all clauses is shown below.

SELECT COUNT(SELECT DID FROM DONOR WHERE GENDER LIKE "M%"),

COUNT(SELECT DID FROM DONOR WHERE GENDER LIKE "F%")

FROM DONOR

WHERE BG = xxx;

7. Alias is used in the above query for each column to get the final query.

SELECT COUNT(SELECT DID FROM DONOR WHERE GENDER LIKE "M%") as Male_Donors, COUNT(SELECT DID FROM DONOR WHERE GENDER LIKE "F%") as Female_Donors

FROM DONOR

WHERE BG = xxx;

You might be interested in
Lin is booting up his computer, and during the boot process, the computer powers down. After several unsuccessful attempts to bo
mel-nik [20]

Answer:

The RAM Modules.

Explanation:

If the power supply is working properly, the next thing that could cause an auto-shutdown could be the RAM.

Sometimes static electricity,  a faulty slot, or even a faulty memory module  could be causing the RAM to fail. And as the OS needs to read from the RAM in order to boot, at the moment the processor can't find the RAM information, it shuts down the system.

Changing the RAM modules to a different slot, switching slots, or cleaning the memory module pins with a regular eraser can help solve the problem. If not, then Lin might need to buy a new module, or keep going forward with the diagnostic process.

3 0
1 year ago
Identify the correct language concept or term from the drop-down menu. A Programming Language is a language that physically runs
babymother [125]

Answer and Explanation:

In computer processing of text, a markup language is a way to annotating a document that is different from the book.In the computer, the markup language is a system annotating a text. Such a system uses procedural and descriptive markup. These are called lightweight markup language.

A programming language that physically runs on the website is called display markup.A programming language that is frequently used to develop websites with database is known as JAVA , PHP , HTML ,tags.These are the language that are used with existing markup language.

8 0
1 year ago
Read 2 more answers
Assign test_stat_72 to the value of the test statistic for the years 1971 to 1973 using the states in death_penalty_murder_rates
Alika [10]

Answer:

Find attached below the solution and explanation to the problem.

Explanation:

3 0
2 years ago
Describe copyright statute, disclaimers, and filing procedures.
gayaneshka [121]

Answer:(Answers may vary.)

I researched about different concepts regarding statute of limitations, disclaimers, and filing procedures regarding copyright issues.

Statute of limitations

Statute of limitations for copyright falls under two categories. The first is a limitation for ‘Criminal Proceedings’. In this case, the statute stands that the claim (or lawsuit) has to be filed within five years of the cause (act of infringement). The second consideration is in the ‘Civil Action’ case. Here the claim (lawsuit) has to be filed within three years of the cause. Many times the last act of infringement is taken as the date from which these five (or three) years are calculated. There have been cases where the date when the infringement was discovered by the victim, is taken as a starting date.

Disclaimers

A disclaimer is a statement that is intended to pass on some information about the content of the design to the viewer. This disclaimer may be to signify the intent of the designer behind the content. It may also be a suggestion or warning to ensure the viewer uses discretion while viewing the content. A disclaimer is mutual understanding between the designer and viewer. This would protect the designer rights in a situation where the viewer claims damages after the viewer clearly disregarded the disclaimer.

Filing procedures

A claim for copyright has to be filed (ideally) before any infringement occurs, or within three months of the infringement. Timely registration would help the claim for damages. I can file for a copyright online (U.S. Copyright Office). I can also file for a copyright in printed form at the U.S. Copyright Office. I would need two copies of my work at the time of filing. The online facility is charged (fees) lesser than direct submission. I would have to sure which form I fill, as all the forms refer to different types of work.

Explanation: I just did it and it showed me.

7 0
1 year ago
Write a algorithm to attend birthday party​
kolezko [41]

Answer:

2     No

5 14    Yes

Explanation:

8 0
1 year ago
Read 2 more answers
Other questions:
  • Secure Wi-Fi networks and VPNs use _____ to secure data transferred over a network.
    13·1 answer
  • An organization has a datacenter manned 24 hours a day that processes highly sensitive information. The datacenter includes emai
    5·1 answer
  • JAVAThe method longestStreak is intended to determine the longest substring of consecutive identical characters in the parameter
    7·1 answer
  • The kings and queens of England are listed in a relation Kings(name,nickname,house,beginReign,endReign). Their name is unique, e
    8·1 answer
  • To play game, go inside the Grand Theft Auto V folder and right click and runGTAVLauncher as administrator.If you get any missin
    5·1 answer
  • int decode2(int x, int y, int z); is compiled into 32bit x86 assembly code. The body of the code is as follows: NOTE: x at %ebp+
    5·1 answer
  • Write a loop that continually asks the user what pets the user has, until the user enters "rock", in which case the loop ends. I
    12·1 answer
  • .Ten pounds of candy were prepared for the school party.
    10·1 answer
  • The hostel in which you plan to spend the night tonight offers very interesting rates, as long as you do not arrive too late. Ho
    5·1 answer
  • Which are technical and visual demands that need to be considered when planning a project? Choose three answers
    13·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!