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

  Exhibiting all the primary keys and foreign keys

Draw the corresponding GRD, exhibiting all the primary keys and foreign keys. For simplicity, no other attributes nor multiplicity constraints are required.

  Create trend-moving averages with the given values form

Create trend-moving averages with the following values form: 10, 100, and 200. Graph the data with Excel. Create centered-moving averages with the following values form: 10, 100, and 200. Graph the data with Excel.

  Would you ever want to use a temporary stored procedure

Provide an example of a stored procedure that you might write to demonstrate why this capability is important.

  What information will be needed from the database

Why is it essential to know what information will be needed from the database from the outset of development? Which of the following statements about data organization are correct?

  Create a make-table query based on the tblmember table

Create a make-table query based on the tblMember table, selecting all fields from the table except the Street, City, State, and Zip fields, and only those records where the MemberStatus field value is on hold.

  Determine the cardinality and optionality for each direction

Draw the entities with their attributes. You will need to determine the cardinality and optionality for each direction of the relationships.

  Briefly summarize the results of the process

Import your data into IBM SPSS software using your assigned data set. Save the data file for future use, and use IBM SPSS software to compute frequencies on all appropriate variables. Briefly summarize the results of the process in 50 to 70 words

  How does access identify each record within a database

How does access identify each record within a database

  Discuss the definition of a data warehouse

Discuss the definition of a data warehouse. Discuss how Kimball and Inmon differ in their approaches. Provide examples within your post.

  Create the ddl statements that will build the appropriate

Describe (you need not write code) how would convert the ERD and DDL into a set of object-oriented classes in PHP that represent the data model.

  Primary keys and indexes

Primary Keys and Indexes

  Optimizing sql server query performance how to optimizing

how to optimizing sql server query performance? when optimizing your database server you need to tune the performance

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