Great Deal! Get Instant $10 FREE in Account on First Order + 10% Cashback on Every Order Order Now

37. Consider the three tables below and formulate the following query in SQL: List the capital cities and populations of countries whose GDP exceeds one trillion dollars (3pt). 38. Consider the three...

1 answer below »
37. Consider the three tables below and formulate the following query in SQL: List the capital cities and populations of countries whose GDP exceeds one trillion dollars (3pt).
38. Consider the three tables below and formulate the following query in SQL: For each continent, find the average GDP (3pt).
39. Consider the three tables below and formulate the following query in SQL: For each country in which at least two rivers originate, find the length of the smallest river (3pt).
40. Suppose that you have the following table. Specify a query that return all rows in which the field ‘death’ has the value NULL. (2pt)
+----------+--------+---------+------+------------+------------+
| name | owner | species | sex | birth | death |
+----------+--------+---------+------+------------+------------+
| Puffball | Fluffy |Claws
| Buffy
| Diane | hamster |f | Harold | cat |f |Gwen |cat |m | Harold | dog |f
| XXXXXXXXXX | NULL | | XXXXXXXXXX | NULL | | XXXXXXXXXX|NULL | | XXXXXXXXXX | NULL |
| Bowser | Diane | dog | m | XXXXXXXXXX | XXXXXXXXXX | +—————+————+---------+------+------------+------------+

41. Suppose that you have a table of the structure below. Specify the following query: List animal names and birthdays, sorted by date (2pt)
Answered Same Day Dec 01, 2021

Solution

Neha answered on Dec 01 2021
142 Votes
create table country
( Name varchar(100) primary key,
Cont varchar(4) not null,
Pop decimal not null,
GDP decimal not null,
LifeExp decimal not null,
Shape varchar(50) not null
);
Create table City
(
Name varchar(150) not null,
Country varchar(100) not null,
Pop decimal not null,
capital varchar(1) not null,
Shape varchar(20) not null,
foreign key(Country) references Country(Name)
);
Create table Rive
(
Name varchar(150) not null,
Origin varchar(150) not null,
Length bigint not null,
Shape varchar(200),
foreign key(Origin) references Country(Name)
);
Insert into Country(Name,Cont,Pop,GDP,LifeExp,Shape)...
SOLUTION.PDF

Answer To This Question Is Available To Download

Related Questions & Answers

More Questions »

Submit New Assignment

Copy and Paste Your Assignment Here