Lab 6: Adding, Changing and Deleting Records

Agnessalidvl
AGLab05.docx

Laboratory Report DeVry University College of Engineering and Information Sciences

Course Number: DBM405A

Professor:

Laboratory Number: 5

Laboratory Title: Connecting to the Database

Submittal Date: 4/7/2019

Note: There is no limit on how much information you will enter under the three topics below. It is important to be clear and complete with your comments. Like a scientist, you are documenting your progress in this week’s lab experiment.

Objectives: In your own words, what was this lab designed to accomplish? What was its purpose?

This lab is designed to accomplish the hands on practice on creating views in my sql. Moreover the second objective of this lab is to let us know how can we back up the file and restore it.

Results: Discuss the steps you used to complete your lab. Were you successful? What did you learn? What were the results? Explain what you did to accomplish each step. You can include screen shots, code listings, etc. to clearly explain what you did.

Step 1: View of the database showing the Team Name and the Players last name for all Players in the system

Using Query

CREATE VIEW `playersInTeam` AS SELECT `LastName`,`TName` FROM `players`, `teams`

Screenshot

Step 2 - View of the database showing the current schedule. The view should show the HomeTeam name (TName) and the AwayTeam name (TName) and the PlayDate. The listing should be in chronological order

Using Query

CREATE VIEW `scheduled_matches` AS SELECT t1.TName as 'Home Team', t2.TName as 'Away Team', playDate

from season, teams as t1, teams as t2

where t1.TeamCode=season.hometeam and t2.TeamCode=season.AwayTeam

Screenshot

Step 3 – Backup the database

Step 4 – Restoring backup

It can be restored by using the imposrt option and then selecting the backup file by browsing it in computer.

Conclusions: After completing this lab, in your own words, what conclusions can you draw from this experience?)

This lab gave us a very good practical experience in using views and backup and restoring the database.

Student:

Name

Program

Signature