Explain the sql statement errors

Assignment Help Database Management System
Reference no: EM131666263

Assignment

In this assignment, you will delve deeply into Structured Query Language (SQL) statements. You will review existing SQL statements and troubleshoot them. You would need to determine why the given statements are not functioning properly. At the conclusion of this assignment, you should be able to examine and troubleshoot basic SQL statements.

Scenario:

A good friend of yours is starting a fantasy football league and has created a small database to track the team owners, teams, players, and games. Your friend knows that you are taking a database fundamentals class and has asked you to help. Your friend is not able to figure out why the database is not getting modified in any way. Your friend has given you a copy of the following:

• A database schema diagram. Access the database schema diagram.

• A Microsoft Access database. Access the Microsoft Access database.

• The following list of what he or she is trying to do:

1. Add a new owner named Alice Wonderland with an owner ID of 1205 and a contact e-mail of [email protected]

INSERT INTO Owner

VALUES (1205, 'Wonderland', 'Alice', '[email protected]')

2. Update player 323's salary to $1,800,000

UPDATE Player
salary = 1800000
WHERE player_id = 323

3. Display all players whose salary is greater than $1,000,000

SELECT FROM Player
WHERE salary > 1000000

4. Delete owner Jerry Jones from the database

DELETE FROM Owner
last_name = "Jones" AND first_name = "Jerry"

5. Update game 0105 with the final score

UPDATE Game
SET home_score = 17,
visitors_score = 23

Note: For this assignment, you will use Microsoft Access 2010 to open the database file provided. If you do not have Microsoft Access 2010, you may download a free trial version of Microsoft Office 2010, which includes Microsoft Access 2010, from the Microsoft website.

Tasks:

1. Open the Microsoft Access file "Football.accdb" by double-clicking on it. You will see the small database created for the fantasy football league.

2. Familiarize yourself with the database by opening and examining the data in each table.

3. There are two queries included with the database that will display some of the information contained in the tables. Double-click each of these to see the results of the query.

Once you are familiar with the database, proceed to the next section.

1. Examine and Correct the Faulty SQL Statements

1. For each SQL statement listed above, identify the SQL statement errors.

2. Once you have identified the errors, rewrite the SQL statements so that they will work.

Note: Take special precautions with Statement 5 above. If you run the statement as it is written above, you will overwrite the scores of all of the existing games in the database.

I. Execute the Statements

1. On the Create tab, in the Queries group, click Query Design.

2. When prompted to add tables, click the Close button.

3. On the Query Tools Design tab, in the Results group, click on the down arrow below the word View and select SQL View. This is where you will compose your SQL statements. Feel free to type the statements above into the SQL View window and run them (see Step 4) to view the errors. (Note: Take special precautions with Statement 5 above. If you run the statement as it is written above, you will overwrite the scores of all of the existing games in the database.)

4. To run your SQL statements against the database, click the Runbutton in the Results group. You will be prompted to confirm that you want to modify data in your database. Click Yes. Close the query and save it as "Statement n", where n is the statement number listed above. For example, you will save the first statement as "Statement 1".

5. Repeat this process for each SQL statement provided above.

6. Once you have completed correcting the SQL statements, save and exit the database.

II. Explain the SQL Statement Errors

1. Create a Microsoft Word document explaining what was wrong with each of the five originally written SQL statements. Include any additional comments that you might have about the statements.

Attachment:- Database-Schema-Diagram.pdf

Reference no: EM131666263

Questions Cloud

Defined a criminal justice agency or administration : What does this term mean and how does it relate to the ethical issue of lying within a criminal justice agency or administration
Could we study geography without maps : Why are maps arguably the most important tools of geographers? Could we study geography without maps?
Define the various types of child abuse and their prevalence : Briefly describe the various types of child abuse and their prevalence in the United States
Growth and spread of humans on earth : Class, can you explain why the onset of the Holocene Epoch led to the growth and spread of humans on Earth.
Explain the sql statement errors : Explain the SQL Statement Errors. Include any additional comments that you might have about the statements. When prompted to add tables, click the Close button.
Physical geography of the earth : Describe one effect that humans have had on the physical geography of the Earth. Is this a beneficial or detrimental effect? Why?
Limousine charges between the clients in seattle and denver : How should Grimes allocate the $90 limousine charges between the clients in Seattle and Denver?
Stages of dune formation and the nature of airflow : Class, can you discuss the early stages of dune formation and the nature of airflow during this time.
Discuss you reaction to these proposed amendments : Discuss you reaction to these proposed amendments. What are the pros and cons of each proposal and would these proposals be constitutional

Reviews

Write a Review

Database Management System Questions & Answers

  Knowledge and data warehousing

Design a dimensional model for analysing Purchases for Adventure Works Cycles and implement it as cubes using SQL Server Analysis Services. The AdventureWorks OLTP sample database is the data source for you BI analysis.

  Design a database schema

Design a Database schema

  Entity-relationship diagram

Create an entity-relationship diagram and design accompanying table layout using sound relational modeling practices and concepts.

  Implement a database of courses and students for a school

Implement a database of courses and students for a school.

  Prepare the e-r diagram for the movie database

Energy in the home, personal energy use and home energy efficiency and Efficient use of ‘waste' heat and renewable heat sources

  Design relation schemas for the entire database

Design relation schemas for the entire database.

  Prepare the relational schema for database

Prepare the relational schema for database

  Data modeling and normalization

Data Modeling and Normalization

  Use cases perform a requirements analysis for the case study

Use Cases Perform a requirements analysis for the Case Study

  Knowledge and data warehousing

Knowledge and Data Warehousing

  Stack and queue data structure

Identify and explain the differences between a stack and a queue data structure

  Practice on topic of normalization

Practice on topic of Normalization

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