SYM 400 Expanding the Scope of Queries COMPLETE

docx

School

Grand Canyon University *

*We aren’t endorsed by this school

Course

400

Subject

Computer Science

Date

Jan 9, 2024

Type

docx

Pages

5

Uploaded by PeanutButterEater102

Report
Expanding the Scope of Queries 1 SYM 400 Introduction to Database Structures
Expanding the Scope of Queries 2 The first step is to access LopesCloud, click on the second box with this week’s assignment name and start up the VM Now that I have connected to the SQL Server I need to provide a list of all of the records pertaining to the FirstName "John" in the Person table that includes the full name and number of records. To do this I input the following query: SELECT CONCAT(FirstName, ‘ ‘, MiddleName, ‘ ‘, LastName) AsEmployees_Named_John From Person.Person Where FirstName = John There was 58 results for employees named John altogether. To get the column count I used the following query: SELECT*FROM Person.Person Where FirstName = ‘John’ SELECT Count (*) From Person.Person Where FirstName = ‘John’
Expanding the Scope of Queries 3 Now I need to delete a specific record for John T. Moore from the database using his business entity ID since he was an was an erroneous entry. To do this I use the following SQL transaction: Delete * From Person.Person Where BusinessEntity = ‘18327’ :
Your preview ends here
Eager to read complete document? Join bartleby learn and gain access to the full version
  • Access to all documents
  • Unlimited textbook solutions
  • 24/7 expert homework help
Expanding the Scope of Queries 4 Next the human resources manager has requested a full list of the e-mail address for each employee. To do this I used this query: SELECT CONCAT (FirstName, ‘ ‘, LastName) as FullName, pe.EmailAddress From Person.Person as pp Inner Join Person.EmailAddress as pe ON pp.BusinessEntityID = pe.EmailAddressID Now I need to identify the full name of the employee using email address ana17@adventure-works.com while using a WHERE clause. To do this I added one more line to the query used in question 3: SELECT CONCAT (FirstName, ‘ ‘, LastName) as FullName, pe.EmailAddress From Person.Person as pp Inner Join Person.EmailAddress as pe ON pp.BusinessEntityID = pe.EmailAddressID WHERE EmailAddress = ‘ana17@adventure-Works.com
Expanding the Scope of Queries 5 This shows that David Coleman was the employee with this specific email and adding this WHERE clause line saved me from having to filter through 19167 results manually finding the employee using this email.