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 =...
Write the following SQL queries based on hbsoe database from Mode: Select all the employee information...
Write the following SQL queries based on hbsoe database from Mode: Select all the employee information and list them for first 100 only. Select all the order information from country Germany. How many distinct orders are made from each country? List the names of employees who made orders from country Germany. List the names of companies which supplies chai or tofu
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...
Introduction to Database Oracle Assingment Use any table of your choice for solving 1. Display all...
Introduction to Database Oracle Assingment Use any table of your choice for solving 1. Display all the information of the EMP table? 2. Display unique Jobs from EMP table? 3. List the emps in the asc order of their Salaries? 4. List the details of the emps in asc order of the Dptnos and desc of Jobs? 5. Display all the unique job groups in the descending order? 6. Display all the details of all ‘Mgrs’ 7. List the emps...
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...
ADVERTISEMENT
Need Online Homework Help?

Get Answers For Free
Most questions answered within 1 hours.

Ask a Question
ADVERTISEMENT