Question

In: Computer Science

Need SQL commands for these questions based on the bowling league database; When was the first...

Need SQL commands for these questions based on the bowling league database; When was the first tournament date and where was it played? What are the number of tournaments per location?

Solutions

Expert Solution

Here Taking a sample data as shown below.

TOURNAMENTS is a table which has these list of attributes ID, NAME, DAY, LOCATION.

To find the fist tournament date and location, we need to sort with respect to the day and the top one will be the first tournament. So here we are using ORDER BY DAY as well as the LIMIT as 1

SELECT * FROM TOURNAMENTS T ORDER BY T.DAY LIMIT 1;

To find the number of tournaments per location, Need to group those records based on the location. So here using the GROUP BY
SELECT T.LOCATION, COUNT(*) AS NO_TOURNAMENT FROM TOURNAMENTS T GROUP BY T.LOCATION;


Related Solutions

Use the following information to create SQL commands to retrieve data from Henry Books database :...
Use the following information to create SQL commands to retrieve data from Henry Books database : For each book, list the book code, book title, publisher code, and publisher name. Order the results by publisher name. For each book published by Plume, list the book code, book title, and price. List the book title, book code, and price of each book published by Plume that has a book price of at least $14. List the book code, book title, and...
This is t a relational database please write SQL queries to solve the listed questions. The...
This is t a relational database please write SQL queries to solve the listed questions. The database is a variation of the “Movie Database” . There are several differences in it, so look it over carefully before writing your SQL queries Notes: TheaterNum, MovieNum, and ActorNum are numeric primary key fields in their respective tables. Movie and actor names are not assumed to be unique unless specified otherwise in a question. In the THEATER table, Capacity is the number of...
Using your downloaded DBMS (MS SQL Server), create a new database. Create the database tables based...
Using your downloaded DBMS (MS SQL Server), create a new database. Create the database tables based on your entities defining The attributes within each table The primary and foreign keys within each table *****Show your database tables, tables attributes, primary and foreign keys***** Do not forget to check the lesson slides and videos that show you how to convert an ER/EER into a database schema, and how to create a database and tables using MS SQL Server.
Database questions: USE THE FOLLOWING SQL CODE TO SOLVE NEXT QUESTIONS: CREATE TABLE ROBOT ( Serial_no...
Database questions: USE THE FOLLOWING SQL CODE TO SOLVE NEXT QUESTIONS: CREATE TABLE ROBOT ( Serial_no INT NOT NULL, Model VARCHAR(20) NOT NULL, Manufacturer VARCHAR(20) NOT NULL, Price INT NOT NULL, PRIMARY KEY (Serial_no) ); INSERT INTO ROBOT VALUES (1, 'Scara','Epson', 23200); INSERT INTO ROBOT VALUES (2, 'ASSISTA','Mitsubishi', 17500); INSERT INTO ROBOT VALUES (3, 'Lego Mindstorm','NXT', 650); INSERT INTO ROBOT VALUES (4, 'Yumi','ABB', 40000); INSERT INTO ROBOT VALUES (5, 'Pepper','Foxconn', 1600); INSERT INTO ROBOT VALUES (6, 'Humanoid','Honda', 30000); SELECT *...
Need answers for Normalization, Physical Design, Sql, And Security exam. 1. The database you're creating will...
Need answers for Normalization, Physical Design, Sql, And Security exam. 1. The database you're creating will be installed on a group of three servers. What feature of an enterprise RDBMS will allow one server to pick up the processing work if the main server becomes nonoperational? A. Failover B. Business intelligence C. Data warehouse D. Load balancing 2. What type of clause must you always use with DELETE or UPDATE to avoid inadvertently changing data elsewhere in the database? A....
Create first draft for online shopping database (SQL): Things to do: Identify the entities Identify the...
Create first draft for online shopping database (SQL): Things to do: Identify the entities Identify the attributes Constraints Relations First Normal form Second Normal Form Third Normal Form Test Query to: Add a new item as a seller Query for total number of sold item in past month Query for total income in US DOLLARS
SQL Assignment: Provide a made-up scenario about when a database trigger could be used. There is...
SQL Assignment: Provide a made-up scenario about when a database trigger could be used. There is no need to provide the syntax to create the trigger, as this would differ depending upon the actual design of the database. Only provide the scenario of when a trigger could be used.
Create the following SQL queries using the lyrics database below 1. List the first name, last...
Create the following SQL queries using the lyrics database below 1. List the first name, last name, and region of members who do not have an email. 2. List the first name, last name, and region of members who do not have an email and they either have a homephone ending with a 2 or a 3. 3. List the number of track titles that begin with the letter 's' and the average length of these tracks in seconds 4....
Use adventure works 2014 database to solve the following questions in SQL management studio. 1. Create...
Use adventure works 2014 database to solve the following questions in SQL management studio. 1. Create a stored procedure that will receive parameters (all non-nullable fields should be supplied except the primary key which should be auto created still) to add a customer, single email, and single phone. The procedure should run it's code in a transaction and if any part of the add fails then the transaction should rollback. 2. Provide this query from previous assignments written with an...
Based on "Fraud in Collegiate Athletics"Case When Major League Money Meets Little League Controls ( Adapted...
Based on "Fraud in Collegiate Athletics"Case When Major League Money Meets Little League Controls ( Adapted from an article in Fraud Magazine, January/February 2012) By Herbert W. Snyder 1. Identify some of the weaknesses in KU's internal controls that allowed fraud to occur in the athletic department. Explain your answer. 2. Do you think that the sentences given to the perpetrators were appropriate? or too harsh? or too lenient? Explain your answer. Fraud in Collegiate Athletics When Major League Money...
ADVERTISEMENT
ADVERTISEMENT
ADVERTISEMENT