Write a single sql statement to find the count of all cities

Assignment Help Database Management System
Reference no: EM132154470

There are two tables. One is CITY, the other is COUNTRY.

CREATE TABLE CITY (

ID INTEGER NOT NULL,

Name NVARCHAR2(50) NOT NULL ,

CountryCode CHAR(3) NOT NULL ,

District NVARCHAR2(50) NOT NULL ,

Population INTEGER NOT NULL,

PRIMARY KEY (ID)

);

CREATE TABLE country (

Code NVARCHAR2(3) DEFAULT ON NULL '' NOT NULL,

Name NVARCHAR2(52) DEFAULT ON NULL '' NOT NULL,

-- 'Asia','Europe','North America','Africa','Oceania','Antarctica','South America',

Continent NVARCHAR2(20) DEFAULT ON NULL 'Asia' NOT NULL,

Region NVARCHAR2(26) DEFAULT ON NULL '' NOT NULL,

SurfaceArea BINARY_FLOAT DEFAULT ON NULL 0 NOT NULL,

IndepYear INTEGER DEFAULT 0,

Population INTEGER DEFAULT ON NULL 0 NOT NULL,

LifeExpectancy BINARY_FLOAT DEFAULT 0,

GNP BINARY_FLOAT DEFAULT 0,

GNPOld BINARY_FLOAT DEFAULT 0,

LocalName NVARCHAR2(45) DEFAULT ON NULL '' NOT NULL,

GovernmentForm NVARCHAR2(45) DEFAULT ON NULL '' NOT NULL,

HeadOfState NVARCHAR2(60) DEFAULT NULL,

Capital INTEGER DEFAULT 0,

Code2 NVARCHAR2(2) DEFAULT ON NULL '' NOT NULL,

PRIMARY KEY ( Code )

);

1. Write a single SQL statement to list all the city names, country names in Africa only from 2 tables city and country where the country codes matches and ordered by city name. Hint: Use a join.

2. Write a single SQL statement to find the count of all cities in the countries that are on the continent of "Europe".

Hint: Use a SQL join

Reference no: EM132154470

Questions Cloud

Find the probability that-both dice are even numbers : Two fair dice are tossed. Find the probability that: Both dice are even numbers
Which criterion will you select to use : Ensure that the benefits to those who gain from the decision are greater than the losses of those who are harmed by the decision.
Write an application that allows a user to enter two strings : Output the number of characters in the first String that also appear in the second String, and output those characters.
Length of time a commuter must wait for a train to arrive : We are interested in the length of time a commuter must wait for a train to arrive. The time follows a uniform distribution.
Write a single sql statement to find the count of all cities : Write a single SQL statement to find the count of all cities in the countries that are on the continent of "Europe".
Which are market consequences and intangible consequences : For the project in Problem, identify the major costs and benefits. Which are market consequences, which are extra-market consequences, and which are intangible.
Queuing discipline refers : Queuing discipline refers to. Java is not optimized to take advantage of interface elements specific to the Mac or Windows operating systems.
Thirteen do not use the foil as their main weapon : Find the probability that thirteen do not use the foil as their main weapon. (Round your answer to four decimal places.)
Find the probability that at most 3 students will attend : Find the probability that at most 3 students will attend. (Round your answer to four decimal places.)

Reviews

Write a Review

Database Management System Questions & Answers

  Knowledge and data warehousing

Design a dimensional model for analysing Purchases for Adventure Works Cycles and implement it as cubes using SQL Server Analysis Services. The AdventureWorks OLTP sample database is the data source for you BI analysis.

  Design a database schema

Design a Database schema

  Entity-relationship diagram

Create an entity-relationship diagram and design accompanying table layout using sound relational modeling practices and concepts.

  Implement a database of courses and students for a school

Implement a database of courses and students for a school.

  Prepare the e-r diagram for the movie database

Energy in the home, personal energy use and home energy efficiency and Efficient use of ‘waste' heat and renewable heat sources

  Design relation schemas for the entire database

Design relation schemas for the entire database.

  Prepare the relational schema for database

Prepare the relational schema for database

  Data modeling and normalization

Data Modeling and Normalization

  Use cases perform a requirements analysis for the case study

Use Cases Perform a requirements analysis for the Case Study

  Knowledge and data warehousing

Knowledge and Data Warehousing

  Stack and queue data structure

Identify and explain the differences between a stack and a queue data structure

  Practice on topic of normalization

Practice on topic of Normalization

Free Assignment Quote

Assured A++ Grade

Get guaranteed satisfaction & time on delivery in every assignment order you paid with us! We ensure premium quality solution document along with free turntin report!

All rights reserved! Copyrights ©2019-2020 ExpertsMind IT Educational Pvt Ltd