Question

Use the bowling_league database. Select the BowlerLastName and BowlerFirstName as FirstBowler, BowlerZip, and BowlerLastName and BowlerFirstName...

Use the bowling_league database. Select the BowlerLastName and BowlerFirstName as FirstBowler, BowlerZip, and BowlerLastName and BowlerFirstName as SecondBowler (all from Bowler table) where the two bowlers share the same BowlerZip and the BowlerLastName of the two bowlers are not equal. Limit to 6 results.

Homework Answers

Answer #1

We can Join the table to itself. Self join is used to query hierarchical data or to compare a row with other rows within the same table.

We use Concat to combine First and last name under one header FirstBowler from

SELECT concat(A.BowlerLastName,' ', A.BowlerFirstName) as FirstBowler,

concat (B.BowlerZip,' ', B.BowlerLastName,' ', B.BowlerFirstName) as SecondBowler

FROM Bowler A

INNER JOIN Bowler B ON

A.BowlerZip = B.BowlerZip

AND

A.BowlerLastName = B.BowlerLastName

Know the answer?
Your Answer:

Post as a guest

Your Name:

What's your source?

Earn Coins

Coins can be redeemed for fabulous gifts.

Not the answer you're looking for?
Ask your own homework help question
Similar Questions
In the movies database and actor table, label all values in the last_name field that start...
In the movies database and actor table, label all values in the last_name field that start with a, b or c as "A,B,C start" or "Other" and name it LastName, and do the same with all the values in the first_name field and name it FirstName. Group by FirstName and LastName, and return the count as total but only return grouping where the FirstName and the Lastname are equal. Order by total desc.
In the northwind database and orders table, select the ShipCountry, ShipVia, and EmployeeID as a group...
In the northwind database and orders table, select the ShipCountry, ShipVia, and EmployeeID as a group and compute the count as Total. The group can only include where the ShipVia is less than the EmployeeID and either ShipCountry does not end in "y" or "%%l" or EmployeeID = 4. The grouping total must be greater than 7 and sort by total descending.
Many health care organizations and other businesses use database software to manage the flow of information...
Many health care organizations and other businesses use database software to manage the flow of information and make important decisions. This assignment requires Level 2 Writing Guidelines. Assume you have been asked to serve on a project team for end-users of database software. Your current employer or a fictitious local medical office wants to use an electronic method to store demographic information (person’s name, address, contact information, insurance information, etc) as well as personal health history (clinical diagnosis, tests results,...
Consider the Goldstar database. Choose the query that will display all of the position titles and...
Consider the Goldstar database. Choose the query that will display all of the position titles and the number of employees that hold that position. SELECT title, COUNT(ssn) AS TotalEmployees FROM position, employee WHERE position.location_id = employee.position_id GROUP BY title; SELECT title, SUM(ssn) AS TotalEmployees FROM position, employee WHERE position.position_id = employee.position_id GROUP BY title; SELECT title, COUNT(ssn) AS TotalEmployees FROM position, employee WHERE position.position_id = employee.position_id GROUP BY title; SELECT title, SUM(ssn) AS TotalEmployees FROM position, employee WHERE position.location_id =...
CS 203 Discrete Structure 2 Create a Microsoft Access Database consisting of the following two tables:...
CS 203 Discrete Structure 2 Create a Microsoft Access Database consisting of the following two tables: Part_needs and Parts_Inventory Can you provide the database and query on Microsoft access? Part_needs Supplier Part_number Project 23 1092 1 23 1101 3 23 9048 4 31 4975 3 31 3477 2 32 6984 4 32 9191 2 33 1001 1 Parts_Inventory Part_number Project Quantity Color_code 1001 1 14 8 1092 1 2 2 1101 3 1 1 3477 2 25 2 4975 3...
Consider the Goldstar database. Choose the query that displays the average salary for all positions in...
Consider the Goldstar database. Choose the query that displays the average salary for all positions in the city of Chicago. SELECT title, AVG(max_salary) AS AverageSalary FROM position, employee, location WHERE location.location_id = employee.location_id AND position.position_id = employee.position_id AND city = "Chicago" GROUP BY title; SELECT title, AVG(salary) AS AverageSalary FROM position, employee, location WHERE position.position_id = employee.position_id AND location.location_id = employee.location_id AND city = "Chicago" GROUP BY title; SELECT title, AVG(salary) AS AverageSalary FROM position, employee, location WHERE location.location_id =...
Consider the Goldstar database and the query below. What will the query display? SELECT city, COUNT(performance)...
Consider the Goldstar database and the query below. What will the query display? SELECT city, COUNT(performance) AS TotalEmployees FROM location, employee WHERE location.location_id = employee.location_id GROUP BY city; ? The total number of employees in each city that have NOT received performance ratings The total number of employees in each city The total number of employees in each city that have received performance ratings None of the other answers provided is correct
Create 2 stored procedures: sp_AddNewUser and sp_AddNewRole. Use the ManyToMany script as your base table structures....
Create 2 stored procedures: sp_AddNewUser and sp_AddNewRole. Use the ManyToMany script as your base table structures. The stored procedure should accept the parameters needed to input the data for each table. NOTE: You do not need to input the UserID or RoleID. These are surrogate keys and the system automatically inserts them when you insert a row in the tables.   On execution, the stored procedure should check the database to see if the user exists, if so, return a message...
1. Most database applications require a host programming language to communicate with the database using SQL....
1. Most database applications require a host programming language to communicate with the database using SQL. A wide range of programming languages can be used with SQL,from traditional languages such as COBOL, FORTRAN, and Assembler to more modern languages such as C/C++, Java, and Visual Basic. Your choice of host programming language can impact the way you will have to code SQL. True or False? 2. It is an entity name guideline: a. Do not pluralize the name; use singular...
Oracel Database: Execute dbms_stats.gather_schema_stats(user); Select table_name, blocks from user_tables; What does this tell you about basic...
Oracel Database: Execute dbms_stats.gather_schema_stats(user); Select table_name, blocks from user_tables; What does this tell you about basic compression and DML?
ADVERTISEMENT
Need Online Homework Help?

Get Answers For Free
Most questions answered within 1 hours.

Ask a Question
ADVERTISEMENT