100% satisfaction guarantee Immediately available after payment Both online and in PDF No strings attached 4.2 TrustPilot
logo-home
Other

DAD-220 Module 3 Lab Submission

Rating
4.6
(5)
Sold
13
Pages
17
Uploaded on
14-03-2021
Written in
2020/2021

Completed Lab submission with source code and screenshots for references.











Whoops! We can’t load your doc right now. Try again or contact support.

Document information

Uploaded on
March 14, 2021
Number of pages
17
Written in
2020/2021
Type
Other
Person
Unknown

Content preview

Module Three Lab Three: Table Joins
1.In this lab, we continue working with our database we established in module 1 and furthered in module 2. Our goal is to practice the applications of JOIN clauses. We must change our file permissions through the shell script provided. The ‘chmod +x’ makes ‘change_perm.sh’ change the permissions on itself to make it executable as a program. And the ./change_perm.sh executes the script. Then we launch MySQL as usual by entering ‘mysql’ and pressing Enter.
Continuing we connect to the established database
USE delehant
and perform a SELECT Statement to verify we have connected to the right information.
SELECT * FROM Employee; 2.My next task was updating the “Branches” table name to match the chosen name of “Department” for this assignment. The assigned method of doing this is through an ALTER/RENAME statement.
ALTER TABLE Branches
RENAME TO Department;
3.With the Department table newly named, I then set about adding fields to the empty table. Without this, we would be unable to perform the necessary joins to satisfy the proper output.
a.To add our data, we will be using an INSERT statement. In this instance, the code is already provided.
INSERT INTO Department VALUES (1, 'Accounting'), (2, 'Human Resources'), (3, 'Information Systems'), (4, 'Marketing');
b.I then validate by a SELECT statement to check the table results. SELECT * FROM Department;
4.With our tables populated, we look to create joins between the Department and Employee
tables. Using our SELECT statement, it will join records of Departmet_Name with the first and last names of the employees that belong to each corresponding Department_ID we select. a.Starting with Department 1 = Accounting.
SELECT First_Name, Last_Name, Department.Department_Name FROM Employee INNER JOIN Department ON Employee.Department_ID = Department.Department_ID WHERE Employee.Department_ID = 1; b.Someone once said a good programmer is a lazy programmer. Not sure if I agree, but copy and paste can be practical if used with diligence. Identical select statements will work moving forward by simply changing Department_ID = to the corresponding number. Department 2 = Human Resources
SELECT First_Name, Last_Name, Department.Department_Name
$5.48
Get access to the full document:
Purchased by 13 students

100% satisfaction guarantee
Immediately available after payment
Both online and in PDF
No strings attached

Reviews from verified buyers

Showing all 5 reviews
1 year ago

1 year ago

2 year ago

4 year ago

4 year ago

4.6

5 reviews

5
3
4
2
3
0
2
0
1
0
Trustworthy reviews on Stuvia

All reviews are made by real Stuvia users after verified purchases.

Get to know the seller

Seller avatar
Reputation scores are based on the amount of documents a seller has sold for a fee and the reviews they have received for those documents. There are three levels: Bronze, Silver and Gold. The better the reputation, the more your can rely on the quality of the sellers work.
Riveneye Southern New Hampshire University
View profile
Follow You need to be logged in order to follow users or courses
Sold
379
Member since
4 year
Number of followers
225
Documents
51
Last sold
4 months ago

4.2

66 reviews

5
43
4
10
3
2
2
4
1
7

Recently viewed by you

Why students choose Stuvia

Created by fellow students, verified by reviews

Quality you can trust: written by students who passed their tests and reviewed by others who've used these notes.

Didn't get what you expected? Choose another document

No worries! You can instantly pick a different document that better fits what you're looking for.

Pay as you like, start learning right away

No subscription, no commitments. Pay the way you're used to via credit card and download your PDF document instantly.

Student with book image

“Bought, downloaded, and aced it. It really can be that simple.”

Alisha Student

Frequently asked questions