Ask Question, Ask an Expert

+61-413 786 465

info@mywordsolution.com

Ask DBMS Expert


Home >> DBMS

You need help with this SQL question You have seen answers that work for only two leagues, but as the question states, the solution has to work for an unknown amount of leagues 4) List all cities that have a team in all leagues.

For example, there are currently two leagues (National and American).

Although not shown in this instance, New York is home to the Mets in the National league as well as the Yankees in the American league (Chicago also has one in each league, for those of you who are baseball fans).

Remember that your query must work over all instances of this schema, even if there are more than two leagues in the instance.

Databases: Print all teamIDs where the team played against th Databases Code:

CREATE TABLE `teams` ( `teamID` tinyint(4) default NULL, `teamName` varchar(50) default NULL, `home` varchar(50) default NULL, `leagueName` varchar(50) default NULL ) ENGINE=MyISAM DEFAULT CHARSET=latin1; INSERT INTO `teams`(`teamID`,`teamName`,`home`,`leagueName`) VALUES ('1','Phillies','Philadelphia','National'); INSERT INTO `teams`(`teamID`,`teamName`,`home`,`leagueName`) VALUES ('2','Braves','Atlanta','National'); INSERT INTO `teams`(`teamID`,`teamName`,`home`,`leagueName`) VALUES ('3','Yankees','New York','American'); INSERT INTO `teams`(`teamID`,`teamName`,`home`,`leagueName`) VALUES ('4','Twins','Minnesota','American'); INSERT INTO `teams`(`teamID`,`teamName`,`home`,`leagueName`) VALUES ('5','Rangers','Texas','American'); INSERT INTO `teams`(`teamID`,`teamName`,`home`,`leagueName`) VALUES ('6','Cubs','Chicago','National');

DBMS, Programming

  • Category:- DBMS
  • Reference No.:- M93067533

Have any Question?


Related Questions in DBMS

Suppose that we have a table of house prices and a table of

Suppose that we have a table of house prices and a table of zip codes: • hprices(hid (PK),address,bedrooms,price,zipcode) • zipcodes(zipcode (PK),state) Write a SQL query that finds the average, maximum, and minimum pric ...

In this section the student is required to develop a

In this section, the student is required to develop a technical debate based on his/her understanding using available scientific literature. The answer to this question should not exceed three A4 Pages. In the traditiona ...

The groceries datasetimagine 10000 receipts sitting on your

The groceries Dataset Imagine 10000 receipts sitting on your table. Each receipt represents a transaction with items that were purchased. The receipt is a representation of stuff that went into a customer's basket. That ...

The relation memberstudentid organizationid roleid stores

The relation Member(StudentId, OrganizationId, RoleId) stores the membership information of student joining organization. For example, ('S1', 'O2', 'R3') indicates that student with Id 'S1' joined the organization with i ...

Sql injection on a searchthe way search performs its task

SQL injection on a search The way Search performs its task is by executing the following query (in a php script):          $var=stripslashes($_POST['search']);          $query = "SELECT username from lab1_login where use ...

Analytic reportpurpose the purpose of this task is to

Analytic Report: Purpose: The purpose of this task is to provide students with practical experience in working in teams to write a Data Analytical report to provide useful insights, pattern and trends in the chosen/given ...

Stored procedure please create the following stored

Stored procedure. Please create the following stored routines using CPS3740_2017S database using the tables in dreamhome database. xxxx is your email id 1) Implement a stored procedure p3Q21_xxxx to display the Branch ci ...

Sql assignmentin these exercises youll enter and run your

SQL Assignment In these exercises, you'll enter and run your own SELECT statements. You will use the MyGuitarShop database for these queries. If you do not already have the MyGuitarShop database, the SQL script and the i ...

Q1 given the following file for assignment workercom

Q1. Given the following file for assignment worker.com, identify data anomalies that must be removed before data can be loaded in data warehouse. Worker_assignment ← -----------------on course web site File is available ...

Assignmentqueries functions and triggersdatabase

Assignment Queries, Functions and Triggers Database Systems Aims The aims of this assignment are to: formulate SQL queries; populate an RDBMS with a real dataset, and analyse the data; design test data for testing SQL qu ...

  • 4,153,160 Questions Asked
  • 13,132 Experts
  • 2,558,936 Questions Answered

Ask Experts for help!!

Looking for Assignment Help?

Start excelling in your Courses, Get help with Assignment

Write us your full requirement for evaluation and you will receive response within 20 minutes turnaround time.

Ask Now Help with Problems, Get a Best Answer

Why might a bank avoid the use of interest rate swaps even

Why might a bank avoid the use of interest rate swaps, even when the institution is exposed to significant interest rate

Describe the difference between zero coupon bonds and

Describe the difference between zero coupon bonds and coupon bonds. Under what conditions will a coupon bond sell at a p

Compute the present value of an annuity of 880 per year

Compute the present value of an annuity of $ 880 per year for 16 years, given a discount rate of 6 percent per annum. As

Compute the present value of an 1150 payment made in ten

Compute the present value of an $1,150 payment made in ten years when the discount rate is 12 percent. (Do not round int

Compute the present value of an annuity of 699 per year

Compute the present value of an annuity of $ 699 per year for 19 years, given a discount rate of 6 percent per annum. As