Question

In: Computer Science

Question 1: The following questions contains real numbers for COVID-19 daily report made on 2020-09-07 Use...

Question 1:

The following questions contains real numbers for COVID-19 daily report made on 2020-09-07

Use the CREATE TABLE command and Insert command to create the following table. For each field, pick the most appropriate data type for it.

Give the table name COVID_REPORT and make “Country_name” as Primary Key.

Question 1:

The following questions contains real numbers for COVID-19 daily report made on 2020-09-07

Use the CREATE TABLE command and Insert command to create the following table. For each field, pick the most appropriate data type for it.

Give the table name COVID_REPORT and make “Country_name” as Primary Key.

Country_name

Continent

new_cases

new_deaths

total_cases

total_deaths

Saudi Arabia

Asia

895

32

320827

4081

Bahrain

Asia

676

2

54771

198

United Kingdom

Europe

2988

2

347152

41551

France

Europe

7071

3

324777

30701

Lebanon

Asia

415

4

20426

191

Country_name

Continent

new_cases

new_deaths

total_cases

total_deaths

Saudi Arabia

Asia

895

32

320827

4081

Bahrain

Asia

676

2

54771

198

United Kingdom

Europe

2988

2

347152

41551

France

Europe

7071

3

324777

30701

Lebanon

Asia

415

4

20426

191

Solutions

Expert Solution

Explanation:

The CREATE TABLE statement is used to create a new table.

Basic syntax of CREATE TABLE statement is as follows:

CREATE TABLE table_name
(
column1 datatype,
column2 datatype,
column3 datatype,
.....
columnN datatype
);

The unique name or identifier for the table follows the CREATE TABLE statement. Then in brackets comes the list defining each column in the table and what sort of data type it is.

Syntax for creating primary key is as follows:

CREATE TABLE table_name
(
column1 datatype,
column2 datatype,
column3 datatype,
.....
columnN datatype,
PRIMARY KEY(one or more columns)
);

A primary key is a field in a table which uniquely identifies each row/record in a database table. Primary keys must contain unique values. A primary key column cannot have NULL values.

If a table has a primary key defined on any field(s), then you can not have two records having the same value of that field(s).

Syntax for creating foreign key is as follows:

CREATE TABLE table_name
(
column1 datatype,
column2 datatype,
column3 datatype,
.....
columnN datatype,
PRIMARY KEY(one or more columns),
FOREIGN KEY (column_name) REFERENCES tbl_name(column_name)
);

A foreign key is a key used to link two tables together. This is sometimes also called as a referencing key.

Now let us create COVID_REPORT table as :

CREATE TABLE COVID_REPORT(Country_name VARCHAR(50), Continent VARCHAR(50) NOT NULL, new_cases INT NOT NULL, new_deaths INT NOT NULL, total_cases INT NOT NULL, total_deaths INT NOT NULL, PRIMARY KEY(Country_name));

From the above create statement we can see that COVID_REPORT table is created with 6 columns:

Column name

Datatype

Constraint

Country_name

VARCHAR(50)

PRIMARY KEY

Continent

VARCHAR(50)

NOT NULL

new_cases

INT

NOT NULL

new_deaths

INT

NOT NULL

total_cases

INT

NOT NULL

total_deaths

INT

NOT NULL

Now in order to insert values in the table.

The INSERT INTO statement is used to insert new records in a table.

It is possible to write the INSERT INTO statement in two ways.

The first way specifies both the column names and the values to be inserted:

INSERT INTO table_name (column1, column2, column3, ...) VALUES (value1, value2, value3, ...);

If you are adding values for all the columns of the table, you do not need to specify the column names. The order of the values should be in the same order as the columns in the table.

The INSERT INTO syntax for second way would be as follows:

INSERT INTO table_name VALUES (value1, value2, value3, ...);

Now let us insert values to the COVID_REPORT Table :

INSERT INTO COVID_REPORT VALUES('Saudi Arabia','Asia',895,32,320827,4081);

INSERT INTO COVID_REPORT VALUES('Bahrain','Asia',676,2,54771,198);

INSERT INTO COVID_REPORT VALUES('United Kingdom','Europe',2988,2,347152,41551);

INSERT INTO COVID_REPORT VALUES('France','Europe',7071,3,324777,30701);

INSERT INTO COVID_REPORT VALUES('Lebanon','Asia',415,4,20426,191);

Thus, we have created COVID_REPORT Table with Country_name as Primary key and inserted values into it.


Related Solutions

Use the following information from June 17, 2020 to answer the questions below. COVID-19 case data...
Use the following information from June 17, 2020 to answer the questions below. COVID-19 case data by county - Connecticut County Total Cases New London 1,217 Fairfield 16,475 Windham 579 Hartford 11,405 Litchfield 1,467 Middlesex 1,259 New Haven 12,185 Tolland 895 Based on the data from 6/17/20, which county is at the 75th percentile for total number of cases by county. Based on the data from 6/17/20, what is the percentile rank for New London? Please show all your work,...
Question 1. Write a report to explain the impact on Covid- 19 on the foreign exchange...
Question 1. Write a report to explain the impact on Covid- 19 on the foreign exchange trading movement in Mauritius
QUESTION THREE Ghana recorded its first Covid-19 case in March, 2020. The outbreak of the Covid-19...
QUESTION THREE Ghana recorded its first Covid-19 case in March, 2020. The outbreak of the Covid-19 Pandemic in Ghana has affected the various sectors of the Ghanaian economy in many ways. The Government of Ghana has requested the businesses in the industry your business operates to submit a business plan for financial support. Required: Describe the elements of a solid business plan you will submit to Government of Ghana.
Answer the following question on COVID-19. Each questions 1 page with source!! 1. Treatment options so...
Answer the following question on COVID-19. Each questions 1 page with source!! 1. Treatment options so far used on patients at various stages of the disease 2. Prevention and control methods so far used and adopted by different agencies(WHO, CDC, etc) localities, cities, states and nations.
Question 1 The Covid-19 pandemic in the first half of 2020 has significantly changed the business...
Question 1 The Covid-19 pandemic in the first half of 2020 has significantly changed the business landscape globally and locally. Businesses struggle to survive and share prices of companies continue to tumble. This situation, however, presents good investment opportunities for PropThrive Pte Ltd (PropThrive). PropThrive is an investment holding company which invests in companies with strong fundamentals and promising growth opportunities. Given the current depressed share prices, the Chief Investment Officer (CIO) thinks that now is a good time to...
The below contains the actual data on COVID-19 cases in Ghana from 1st April, 2020 to...
The below contains the actual data on COVID-19 cases in Ghana from 1st April, 2020 to 25th May, 2020 as presented by the Ghana Health Service. Use the information provided to answer the following questions: Construct a graph to show the trends of the COVID-19 confirmed cases and fatalities in Ghana, and speculate on the factors that might have influenced these trend Date Total confirmed Death Recoveries Test 1-Apr 195 5 3 12046 2-Apr 204 5 3 12046 3-Apr 205...
RESEARCH REPORT The Covid-19 Pandemic of 2020 has caused great physical, emotional, and economic devastation on...
RESEARCH REPORT The Covid-19 Pandemic of 2020 has caused great physical, emotional, and economic devastation on a global level. Certain countries have done a relatively better job, to date, dealing with both the significant health crisis – in terms of containing the disease and also allowing their economies to continue operating without complete freezing of economic activity. Your report should compare and contrast two different countries: 1. A country doing a poor job balancing health and economic impacts vs. 2....
Question 3 (Fiscal Policy): The Treasurers department have made the following statement: “The COVID-19 pandemic has...
Question 3 (Fiscal Policy): The Treasurers department have made the following statement: “The COVID-19 pandemic has had a profound impact on Australia’s health system, community and economy, as it has all around the world… This is a once-in-a-century shock that requires an unprecedented level of support across the economy. The Government’s initial response to the COVID19 pandemic provided $299 billion in overall support.” Do you think the Australian Government have done enough help with economic recovery? In answering the question,...
As the COVID-19 epidemic rages in Ghana, many are seeking answers to the following questions: 1....
As the COVID-19 epidemic rages in Ghana, many are seeking answers to the following questions: 1. What are the risk factors for getting infected with COVID-19? 2. What are the risk factors for having symptomatic infection i.e. feeling unwell? 3. What are the risk factors for severe disease (needing hospitalization) and death once a person is infected with COVID-19? Out of the under listed, choose a study design to answer any ONE of the three research questions above: 1. Case-based...
Considering the newly discovered Coronavirus COVID-19, please answer the following questions. How the COVID-19 virus affects...
Considering the newly discovered Coronavirus COVID-19, please answer the following questions. How the COVID-19 virus affects the respiratory system and give a brief description of the disease process. How might this affect a spirometry reading? What are some of the preexisting conditions that make the virus more dangerous? Who is more susceptible to it and why?
ADVERTISEMENT
ADVERTISEMENT
ADVERTISEMENT