SlideShare a Scribd company logo
Based on the materials for this week, create your
own unique Database table using MySQL.
The table should contain at least 6 columns (use different data
type, as appropriate for your application).
The table should have a Primary Key and one other constraint of
your choice.
You should populate the table with 5 records.
Then Query the table to display all columns for all records.
You should provide the SQL script and screen captures of you
successfully running the script.
Respond to other students by supplying scripts that add
additional records, modiify or query data from the tables.
Demonstrate your modifications worked by providing the screen
shots of your scripts successfully running.
Business-level strategies are intended to help an organization
take advantage of opportunities in its environment to create
value for stakeholders. Low-cost and differentiation strategies
are the two primary approaches used by organizations to gain
competitive advantage at the business level. Describe the two
types of strategies. Using the example of a chain of women’s
clothing stores, analyze how such an organization might employ
each type of strategy. How would the organization design its
structure under each type of business-level strategy? How would
the culture of the organization differ under each type of
business-level strategy?
Should be at least 300 words. Does not have to be in paper
format this is only a post
Name: William Clements
Class: SDEV 300
Section: 6380
Date: 6/15/2016
Lab 7
Screen Shot:
1
Introduction to MySQL
Overview
This lab walks you through using MySQL. MySQL is a
relational database that can be used as part of Web
and other applications. This lab serves as a primer for using
MySQL and will serve as a foundation when
we discuss SQL injection attacks and possible mitigations.
Learning Outcomes:
At the completion of the lab you should be able to:
1. Connect to a MySQL database and show the tables within the
Ubuntu virtual machine
2. Create MySQL tables containing popular data types and
constraints
3. Insert, update and delete data from MySQL database tables
4. Create and execute SQL Select statements and simple joins
on MySQL tables
Lab Submission Requirements:
After completing this lab, you will submit a word (or PDF)
document that meets all of the requirements in
the description at the end of this document. In addition, your
MySQL file should be submitted. You can
submit multiple files in a zip file.
Virtual Machine Account Information
Your Virtual Machine has been preconfigured with all of the
software you will need for this class. The
default username and password are:
Username : umucsdev
Password: umuc$d8v
MySQL Username: sdev_owner
MySQL password: sdev300
MySQL database: sdev
Part 1 – Connect to a MySQL database and show the tables
within the Ubuntu virtual machine
The Virtual Machine already has MySQL installed. A MySQL
username has also been created along with a
database to use for your applications and testing. Although
there are SQL editors available, for
simplicity, we will use gedit to create the MySQL scripts. To
run the scripts we will just copy and paste
from the editor to the MySQL prompt.
1. Assuming you have already launched and logged into your
SDEV32Bit Virtual Machine (VM)
from the Oracle VirtualBox, open up the terminal by clicking on
the terminal icon.
2
2. To start the MySQL database type the following the terminal
prompt:
mysql -u sdev_owner -p
When prompted for the password enter sdev300
3
3. To display the available databases type the following at the
mysql prompt:
show databases;
4. The database we will be using for this course is sdev. To use
this database, type the following at
the mysql prompt:
use sdev;
4
5. To display the current tables in the sdev database, type the
following command at the mysql
prompt:
show tables;
You may already have some tables in your database. If so, the
names of those tables would be
displayed. If not, you would see Empty set as illustrated above.
6. To exit the MySQL application. Type exit at the mysql
prompt:
5
Part 2 Create MySQL tables containing popular data types and
constraints
The reading for this week covered the foundations for creating
and dropping tables using a variety of
data types and constraints. In this exercise we will create three
tables along that could be used to
represent a very simple student and course registration system.
The tables all have primary keys. One
table provides foreign keys to the other two tables.
When creating SQL commands to be executed in MySQL, it is
always recommended to prepare them in a
text editor and then either run the script or copy and paste into
the MySQL application. Since this isn’t a
course in database design, we will just copy and paste from the
gedit text editor.
1. Create a folder named sql to hold your sql scripts in the
home/umucsdev directory. Copy and
paste the following SQL code into a file named CreateTables.sql
use sdev;
// Create a student table
CREATE TABLE Students (
PSUsername varchar(30) primary key,
FirstName varchar(30),
LastName varchar(30),
EMail varchar(60)
);
CREATE TABLE Courses(
CourseID int primary key,
CourseDisc varchar(4),
CourseNum varchar(4),
CourseTitle varchar(75)
);
CREATE TABLE StudentCourses (
StudentCourseID int primary key,
CourseID int references Courses(CourseID),
PSUsername varchar(30) references Students(PSUsername)
);
6
2. Open a terminal and launch mysql using the following
command:
mysql -u sdev_owner -p
When prompted type the sdev password
7
3. At the mysql prompt begin copying and pasting the SQL
code. You can copy it all at once.
4. The Query OK output from MySQL is an indicator your SQL
execution was successful. In addition
your can type the following at the mysql prompt to show the
tables:
show tables;
5. You can also describe each table:
8
desc Courses;
desc StudentCourses;
desc Students;
On the Linux Operating system, MySQL table data and names
are case sensitive. Hence (Students is
not the same as students or STUDENTS). This is critical when
you start running your queries for your
applications.
You should experiment in MySQL by creating one or two of
your own tables. Be sure to use several data
types and add a primary key for each table and other constraints
as needed.
Part 3 Insert, update and delete data from MySQL database
tables
Once tables have been created your can insert records and then
update the record or even delete the
record. This exercise discusses how to use MySQL to populate
and modify the records in your database.
We will once again, create the database scripts using the gedit
text editor.
1. Copy and paste the following SQL code into a file named
InsertUpdateDeleteTables.sql
-- Insert students
insert into Students
values ('jsmith', 'John','Smith','[email protected]');
insert into Students
9
values ('mjones', 'Mary','Jones','[email protected]');
insert into Students
values ('jparsons', 'Jeff','Parsons','[email protected]');
-- Insert Courses
insert into Courses
values (1, 'SDEV','300','Secure Web Development');
insert into Courses
values (2, 'SDEV','360','Secure Software LifeCycle');
-- Insert student courses
insert into StudentCourses
values (1,1,'jsmith');
insert into StudentCourses
values (2,1,'mjones');
-- Update the Student data
update Students set Email = '[email protected]'
where PSUsername = 'jsmith';
update Students set Email = '[email protected]'
where PSUsername = 'mjones';
update Students set Email = '[email protected]'
where PSUsername = 'jparsons';
-- delete the Parsons record
delete from Students
where PSUsername = 'jparsons';
10
2. Start MySQL on your virtual machine, login as sdev_owner
and then be sure to use the sdev
database.
3. Copy and paste the SQL statements into the mysql prompt
and your data will be inserted and
modified.
As you review the script and experiment by inserting, updating
and deleting your own unique records,
you should note following:
11
a. The primary key is a critical element and used to find records
to update as well as delete. Notice
the where clause is based on the primary key. When you build
your own statements, be sure to
consider this model.
b. The update statement uses the set clause. If you wanted to
update multiple columns you would
just use a comma between each new update. (e.g. set
Email=’NewEmail,
lastname=’NewLastname’)
c. Be cautious with both deletes and updates. Be sure you use
where clauses to filter to the
specific rows or rows you want to modify or delete. Disastrous
consequences could occur if you
don’t take caution here. For example, if you don’t put the where
clause for the updates, you
could potentially change every record with your new data.
Part 4 Create and execute SQL Select statements and simple
joins on MySQL tables
Once tables have been created and data populated, you can
query the tables using the Select
statement. The Select statement has many clauses, the examples
below will emphasis the where and
order by clauses.
1. Copy and paste the following SQL code into a file named
QueryTables.sql
-- Select all records and columns
select * from Students;
select * from Courses;
select * from StudentCourses;
-- Use the Where clause
select Email from Students
where PSUsername = 'jsmith';
select * from Courses
where CourseDisc Like ('SD%');
select PSUsername from StudentCourses
where CourseID = 1;
-- Order by
select * from Students
Order by LastName;
select * from StudentCourses
order by CourseID;
-- Joins to get more details
select A.PSUsername, CourseDisc from
StudentCourses A, Courses B, Students C
where A.PSUsername =C.PSUsername
and A.CourseID = B.CourseID;
select A.PSUsername, CourseDisc,CourseNum, CourseTitle
from
StudentCourses A, Courses B, Students C
12
where A.PSUsername =C.PSUsername
and A.CourseID = B.CourseID
order by B.CourseID,A.PSUsername;
2. Start MySQL on your virtual machine, login as sdev_owner
and then be sure to use the sdev
database.
3. Copy and paste from the QueryTables.sql file to your mysql
prompt. Executing one or two
queries at a time is recommended so you can experiment and
analyze the results for each
query.
13
As you experiment and analyze the SQL statements and results
note the following:
a. Where clauses are critical to filtering and returning the exact
rows you want.
b. If you use the Like clause you can also use the wild card
character (‘%’) to provide results for any
character.
c. You can use the Order by clause with multiple columns by
using a comma between each
column.
d. Joins can be tricky. For this course, we will work to keep no
more than 3 table joins. Notice the
pattern you need to join each table on the column that has the
identical column. (e.g.
PSUsername is found in both Students and StudentCourses).
You may need to reference the
14
alias (e.g. A or B in this case) to remove redundant namings.
This is why we had to use order by
B.CourseID, A.PSUsername. If we just used CourseID or
PSUsername, the query would not know
which table column to use. Joins Query statements may take
some extra practice to become
comfortable with.
Lab submission details:
As part of the submission for this Lab, you will design your
own tables and populate them with data
based on the following requirements. For each of the
requirements, be sure to save the specific SQL
statements that you used. Please label each SQL statement
corresponding to the numbered
requirements below:
1. Create a table named Faculty to store FacultyID( Primary
key), FirstName, LastName, Email, Date
of birth and number of courses taught to date. You should select
the appropriate data types and
constraints for the table.
2. Create a table named Courses to store CourseID (Primary
key), Discipline Name (e.g. SDEV),
Course Number (e.g. 300), Number of Credits (e.g. 3), Year
first offered (e.g. 2010) and Course
Title. You should select the appropriate data types and
constraints for the table.
3. Create a table named FacultyCourses to store the Faculty and
the Courses they have taught. You
should design the table based on the Faculty and Courses tables
you previously created.
4. Use Insert statements to populate at least 10 faculty records,
5 Course records, and 25
FacultyCourses records
5. Use update statements to update all Courses to 4 credits
6. Use update statements to update any Faculty who have taught
more than 4 courses to modify
the number to 5 courses taught
7. Delete any Faculty record whose LastName starts with the
letter ‘Z’
8. Delete any Course record that was first offered in 1999
9. Use select statements to display all records in all 3 tables.
Order by the Faculty lastname, and
Course title as appropriate. Note you should use 3 separate
select statements to satisfy this
requirement.
10. Use Select statements to display all Faculty who have not
taught any courses
11. Use Select statements to display all Courses offered before
1984
12. Use Select and appropriate joins to display all columns from
the Faculty and Course tables for
each Faculty and Course in the FacultyCourse table. Note: this
will be a 3-table join.
Create screen shots showing the successful running of each your
scripts.
For your deliverables, you should submit a zip file containing
your word document (or PDF file) with
screen shots of the application running successfully along with
your SQL script file. You do not need
separate files for each script. You can include them in one SQL
script.
Include your full name, class number and section and date in the
document.

More Related Content

Similar to Based on the materials for this week, create your own unique Datab.docx

Passing java arrays in oracle stored procedure from mule esb flow
Passing java arrays in oracle stored procedure from mule esb flowPassing java arrays in oracle stored procedure from mule esb flow
Passing java arrays in oracle stored procedure from mule esb flow
Priyobroto Ghosh (Mule ESB Certified)
 
Tutorial mvc (pelajari ini jika ingin tahu mvc) keren
Tutorial mvc (pelajari ini jika ingin tahu mvc) kerenTutorial mvc (pelajari ini jika ingin tahu mvc) keren
Tutorial mvc (pelajari ini jika ingin tahu mvc) keren
Sony Suci
 
Lab 2 Work with Dictionary and Create Relational Database (60 pts.).docx
Lab 2 Work with Dictionary and Create Relational Database (60 pts.).docxLab 2 Work with Dictionary and Create Relational Database (60 pts.).docx
Lab 2 Work with Dictionary and Create Relational Database (60 pts.).docx
VinaOconner450
 
PHP with MYSQL
PHP with MYSQLPHP with MYSQL
ppt
pptppt
Getting Started with MySQL I
Getting Started with MySQL IGetting Started with MySQL I
Getting Started with MySQL I
Sankhya_Analytics
 
Simple ado program by visual studio
Simple ado program by visual studioSimple ado program by visual studio
Simple ado program by visual studio
Aravindharamanan S
 
Simple ado program by visual studio
Simple ado program by visual studioSimple ado program by visual studio
Simple ado program by visual studio
Aravindharamanan S
 
Create column store index on all supported tables in sql server 2014 copy
Create column store index on all supported tables in sql server 2014    copyCreate column store index on all supported tables in sql server 2014    copy
Create column store index on all supported tables in sql server 2014 copy
Mustafa EL-Masry
 
Using Mysql.pptx
Using Mysql.pptxUsing Mysql.pptx
Using Mysql.pptx
StephenEfange3
 
Sql Server 2014 Course Content
Sql Server 2014 Course ContentSql Server 2014 Course Content
Sql Server 2014 Course Content
Mercury Solutions Limited
 
My sql1
My sql1My sql1
My sql1
Akash Gupta
 
SQL PPT.pptx
SQL PPT.pptxSQL PPT.pptx
SQL PPT.pptx
Kulbir4
 
Jsp project module
Jsp project moduleJsp project module
Master MCSA Administración de SQL Server 2012
Master MCSA Administración de SQL Server 2012Master MCSA Administración de SQL Server 2012
Master MCSA Administración de SQL Server 2012
Cas Trainining
 
Sql installation
Sql installationSql installation
Sql installation
Balakumaran Arunachalam
 
Getting Started with MySQL II
Getting Started with MySQL IIGetting Started with MySQL II
Getting Started with MySQL II
Sankhya_Analytics
 
UAE MySQL Users Group Meet-up : MySQL Shell Document Store & more...
UAE MySQL Users Group Meet-up : MySQL Shell Document Store & more...UAE MySQL Users Group Meet-up : MySQL Shell Document Store & more...
UAE MySQL Users Group Meet-up : MySQL Shell Document Store & more...
Frederic Descamps
 
MySQL JDBC Tutorial
MySQL JDBC TutorialMySQL JDBC Tutorial
MySQL JDBC Tutorial
webhostingguy
 
Asp .Net Database Connectivity Presentation.pptx
Asp .Net Database Connectivity Presentation.pptxAsp .Net Database Connectivity Presentation.pptx
Asp .Net Database Connectivity Presentation.pptx
sridharu1981
 

Similar to Based on the materials for this week, create your own unique Datab.docx (20)

Passing java arrays in oracle stored procedure from mule esb flow
Passing java arrays in oracle stored procedure from mule esb flowPassing java arrays in oracle stored procedure from mule esb flow
Passing java arrays in oracle stored procedure from mule esb flow
 
Tutorial mvc (pelajari ini jika ingin tahu mvc) keren
Tutorial mvc (pelajari ini jika ingin tahu mvc) kerenTutorial mvc (pelajari ini jika ingin tahu mvc) keren
Tutorial mvc (pelajari ini jika ingin tahu mvc) keren
 
Lab 2 Work with Dictionary and Create Relational Database (60 pts.).docx
Lab 2 Work with Dictionary and Create Relational Database (60 pts.).docxLab 2 Work with Dictionary and Create Relational Database (60 pts.).docx
Lab 2 Work with Dictionary and Create Relational Database (60 pts.).docx
 
PHP with MYSQL
PHP with MYSQLPHP with MYSQL
PHP with MYSQL
 
ppt
pptppt
ppt
 
Getting Started with MySQL I
Getting Started with MySQL IGetting Started with MySQL I
Getting Started with MySQL I
 
Simple ado program by visual studio
Simple ado program by visual studioSimple ado program by visual studio
Simple ado program by visual studio
 
Simple ado program by visual studio
Simple ado program by visual studioSimple ado program by visual studio
Simple ado program by visual studio
 
Create column store index on all supported tables in sql server 2014 copy
Create column store index on all supported tables in sql server 2014    copyCreate column store index on all supported tables in sql server 2014    copy
Create column store index on all supported tables in sql server 2014 copy
 
Using Mysql.pptx
Using Mysql.pptxUsing Mysql.pptx
Using Mysql.pptx
 
Sql Server 2014 Course Content
Sql Server 2014 Course ContentSql Server 2014 Course Content
Sql Server 2014 Course Content
 
My sql1
My sql1My sql1
My sql1
 
SQL PPT.pptx
SQL PPT.pptxSQL PPT.pptx
SQL PPT.pptx
 
Jsp project module
Jsp project moduleJsp project module
Jsp project module
 
Master MCSA Administración de SQL Server 2012
Master MCSA Administración de SQL Server 2012Master MCSA Administración de SQL Server 2012
Master MCSA Administración de SQL Server 2012
 
Sql installation
Sql installationSql installation
Sql installation
 
Getting Started with MySQL II
Getting Started with MySQL IIGetting Started with MySQL II
Getting Started with MySQL II
 
UAE MySQL Users Group Meet-up : MySQL Shell Document Store & more...
UAE MySQL Users Group Meet-up : MySQL Shell Document Store & more...UAE MySQL Users Group Meet-up : MySQL Shell Document Store & more...
UAE MySQL Users Group Meet-up : MySQL Shell Document Store & more...
 
MySQL JDBC Tutorial
MySQL JDBC TutorialMySQL JDBC Tutorial
MySQL JDBC Tutorial
 
Asp .Net Database Connectivity Presentation.pptx
Asp .Net Database Connectivity Presentation.pptxAsp .Net Database Connectivity Presentation.pptx
Asp .Net Database Connectivity Presentation.pptx
 

More from JASS44

BEAUTIFUL CHURCH ___________________ SIX STEPS TO.docx
BEAUTIFUL CHURCH ___________________ SIX STEPS  TO.docxBEAUTIFUL CHURCH ___________________ SIX STEPS  TO.docx
BEAUTIFUL CHURCH ___________________ SIX STEPS TO.docx
JASS44
 
Be sure to include in your reply specific commentary examining the.docx
Be sure to include in your reply specific commentary examining the.docxBe sure to include in your reply specific commentary examining the.docx
Be sure to include in your reply specific commentary examining the.docx
JASS44
 
Be sure that your report answers the following questions 1. W.docx
Be sure that your report answers the following questions 1. W.docxBe sure that your report answers the following questions 1. W.docx
Be sure that your report answers the following questions 1. W.docx
JASS44
 
Be sure your paper touches on the key elements of each as they per.docx
Be sure your paper touches on the key elements of each as they per.docxBe sure your paper touches on the key elements of each as they per.docx
Be sure your paper touches on the key elements of each as they per.docx
JASS44
 
Beasts of No Nation EssayTimelineWeek of April 10-13 Watch .docx
Beasts of No Nation EssayTimelineWeek of April 10-13  Watch .docxBeasts of No Nation EssayTimelineWeek of April 10-13  Watch .docx
Beasts of No Nation EssayTimelineWeek of April 10-13 Watch .docx
JASS44
 
BCJ 4385, Workplace Security 1 UNIT IV STUDY GUIDE I.docx
BCJ 4385, Workplace Security 1 UNIT IV STUDY GUIDE I.docxBCJ 4385, Workplace Security 1 UNIT IV STUDY GUIDE I.docx
BCJ 4385, Workplace Security 1 UNIT IV STUDY GUIDE I.docx
JASS44
 
BCJ 4385, Workplace Security 1 UNIT II STUDY GUIDE T.docx
BCJ 4385, Workplace Security 1 UNIT II STUDY GUIDE T.docxBCJ 4385, Workplace Security 1 UNIT II STUDY GUIDE T.docx
BCJ 4385, Workplace Security 1 UNIT II STUDY GUIDE T.docx
JASS44
 
Be sure to read Chopins Desirees Baby very carefully.Its un.docx
Be sure to read Chopins Desirees Baby very carefully.Its un.docxBe sure to read Chopins Desirees Baby very carefully.Its un.docx
Be sure to read Chopins Desirees Baby very carefully.Its un.docx
JASS44
 
BBA 3301 Unit V AssignmentInstructions Enter all answers dire.docx
BBA 3301 Unit V AssignmentInstructions Enter all answers dire.docxBBA 3301 Unit V AssignmentInstructions Enter all answers dire.docx
BBA 3301 Unit V AssignmentInstructions Enter all answers dire.docx
JASS44
 
BBA 3361, Professionalism in the Workplace 1 Course Desc.docx
BBA 3361, Professionalism in the Workplace 1 Course Desc.docxBBA 3361, Professionalism in the Workplace 1 Course Desc.docx
BBA 3361, Professionalism in the Workplace 1 Course Desc.docx
JASS44
 
Be sure to listen to all of the pieces first, then answer the ques.docx
Be sure to listen to all of the pieces first, then answer the ques.docxBe sure to listen to all of the pieces first, then answer the ques.docx
Be sure to listen to all of the pieces first, then answer the ques.docx
JASS44
 
BCJ 2002, Theory and Practices of Corrections 1 Cour.docx
BCJ 2002, Theory and Practices of Corrections  1  Cour.docxBCJ 2002, Theory and Practices of Corrections  1  Cour.docx
BCJ 2002, Theory and Practices of Corrections 1 Cour.docx
JASS44
 
BBA 3651, Leadership 1 Course Description Leadershi.docx
BBA 3651, Leadership 1 Course Description  Leadershi.docxBBA 3651, Leadership 1 Course Description  Leadershi.docx
BBA 3651, Leadership 1 Course Description Leadershi.docx
JASS44
 
Basics of QuotingA guideline for good quoting is to integrate.docx
Basics of QuotingA guideline for good quoting is to integrate.docxBasics of QuotingA guideline for good quoting is to integrate.docx
Basics of QuotingA guideline for good quoting is to integrate.docx
JASS44
 
BDM Scheme of Work.docScheme of WorkBTEC HND in Busine.docx
BDM Scheme of Work.docScheme of WorkBTEC HND in Busine.docxBDM Scheme of Work.docScheme of WorkBTEC HND in Busine.docx
BDM Scheme of Work.docScheme of WorkBTEC HND in Busine.docx
JASS44
 
BCJ 4385, Workplace Security 1 UNIT V STUDY GUIDE Ri.docx
BCJ 4385, Workplace Security 1 UNIT V STUDY GUIDE Ri.docxBCJ 4385, Workplace Security 1 UNIT V STUDY GUIDE Ri.docx
BCJ 4385, Workplace Security 1 UNIT V STUDY GUIDE Ri.docx
JASS44
 
BBA 3310 Unit VI AssignmentInstructions Enter all answers dir.docx
BBA 3310 Unit VI AssignmentInstructions Enter all answers dir.docxBBA 3310 Unit VI AssignmentInstructions Enter all answers dir.docx
BBA 3310 Unit VI AssignmentInstructions Enter all answers dir.docx
JASS44
 
BBA 3310 Unit VI AssignmentInstructions Enter all answers.docx
BBA 3310 Unit VI AssignmentInstructions Enter all answers.docxBBA 3310 Unit VI AssignmentInstructions Enter all answers.docx
BBA 3310 Unit VI AssignmentInstructions Enter all answers.docx
JASS44
 
BBA 3301 Unit V AssignmentInstructions Enter all answers direct.docx
BBA 3301 Unit V AssignmentInstructions Enter all answers direct.docxBBA 3301 Unit V AssignmentInstructions Enter all answers direct.docx
BBA 3301 Unit V AssignmentInstructions Enter all answers direct.docx
JASS44
 
Basic Guide to Program Evaluation (Including Outcomes Evaluation).docx
Basic Guide to Program Evaluation (Including Outcomes Evaluation).docxBasic Guide to Program Evaluation (Including Outcomes Evaluation).docx
Basic Guide to Program Evaluation (Including Outcomes Evaluation).docx
JASS44
 

More from JASS44 (20)

BEAUTIFUL CHURCH ___________________ SIX STEPS TO.docx
BEAUTIFUL CHURCH ___________________ SIX STEPS  TO.docxBEAUTIFUL CHURCH ___________________ SIX STEPS  TO.docx
BEAUTIFUL CHURCH ___________________ SIX STEPS TO.docx
 
Be sure to include in your reply specific commentary examining the.docx
Be sure to include in your reply specific commentary examining the.docxBe sure to include in your reply specific commentary examining the.docx
Be sure to include in your reply specific commentary examining the.docx
 
Be sure that your report answers the following questions 1. W.docx
Be sure that your report answers the following questions 1. W.docxBe sure that your report answers the following questions 1. W.docx
Be sure that your report answers the following questions 1. W.docx
 
Be sure your paper touches on the key elements of each as they per.docx
Be sure your paper touches on the key elements of each as they per.docxBe sure your paper touches on the key elements of each as they per.docx
Be sure your paper touches on the key elements of each as they per.docx
 
Beasts of No Nation EssayTimelineWeek of April 10-13 Watch .docx
Beasts of No Nation EssayTimelineWeek of April 10-13  Watch .docxBeasts of No Nation EssayTimelineWeek of April 10-13  Watch .docx
Beasts of No Nation EssayTimelineWeek of April 10-13 Watch .docx
 
BCJ 4385, Workplace Security 1 UNIT IV STUDY GUIDE I.docx
BCJ 4385, Workplace Security 1 UNIT IV STUDY GUIDE I.docxBCJ 4385, Workplace Security 1 UNIT IV STUDY GUIDE I.docx
BCJ 4385, Workplace Security 1 UNIT IV STUDY GUIDE I.docx
 
BCJ 4385, Workplace Security 1 UNIT II STUDY GUIDE T.docx
BCJ 4385, Workplace Security 1 UNIT II STUDY GUIDE T.docxBCJ 4385, Workplace Security 1 UNIT II STUDY GUIDE T.docx
BCJ 4385, Workplace Security 1 UNIT II STUDY GUIDE T.docx
 
Be sure to read Chopins Desirees Baby very carefully.Its un.docx
Be sure to read Chopins Desirees Baby very carefully.Its un.docxBe sure to read Chopins Desirees Baby very carefully.Its un.docx
Be sure to read Chopins Desirees Baby very carefully.Its un.docx
 
BBA 3301 Unit V AssignmentInstructions Enter all answers dire.docx
BBA 3301 Unit V AssignmentInstructions Enter all answers dire.docxBBA 3301 Unit V AssignmentInstructions Enter all answers dire.docx
BBA 3301 Unit V AssignmentInstructions Enter all answers dire.docx
 
BBA 3361, Professionalism in the Workplace 1 Course Desc.docx
BBA 3361, Professionalism in the Workplace 1 Course Desc.docxBBA 3361, Professionalism in the Workplace 1 Course Desc.docx
BBA 3361, Professionalism in the Workplace 1 Course Desc.docx
 
Be sure to listen to all of the pieces first, then answer the ques.docx
Be sure to listen to all of the pieces first, then answer the ques.docxBe sure to listen to all of the pieces first, then answer the ques.docx
Be sure to listen to all of the pieces first, then answer the ques.docx
 
BCJ 2002, Theory and Practices of Corrections 1 Cour.docx
BCJ 2002, Theory and Practices of Corrections  1  Cour.docxBCJ 2002, Theory and Practices of Corrections  1  Cour.docx
BCJ 2002, Theory and Practices of Corrections 1 Cour.docx
 
BBA 3651, Leadership 1 Course Description Leadershi.docx
BBA 3651, Leadership 1 Course Description  Leadershi.docxBBA 3651, Leadership 1 Course Description  Leadershi.docx
BBA 3651, Leadership 1 Course Description Leadershi.docx
 
Basics of QuotingA guideline for good quoting is to integrate.docx
Basics of QuotingA guideline for good quoting is to integrate.docxBasics of QuotingA guideline for good quoting is to integrate.docx
Basics of QuotingA guideline for good quoting is to integrate.docx
 
BDM Scheme of Work.docScheme of WorkBTEC HND in Busine.docx
BDM Scheme of Work.docScheme of WorkBTEC HND in Busine.docxBDM Scheme of Work.docScheme of WorkBTEC HND in Busine.docx
BDM Scheme of Work.docScheme of WorkBTEC HND in Busine.docx
 
BCJ 4385, Workplace Security 1 UNIT V STUDY GUIDE Ri.docx
BCJ 4385, Workplace Security 1 UNIT V STUDY GUIDE Ri.docxBCJ 4385, Workplace Security 1 UNIT V STUDY GUIDE Ri.docx
BCJ 4385, Workplace Security 1 UNIT V STUDY GUIDE Ri.docx
 
BBA 3310 Unit VI AssignmentInstructions Enter all answers dir.docx
BBA 3310 Unit VI AssignmentInstructions Enter all answers dir.docxBBA 3310 Unit VI AssignmentInstructions Enter all answers dir.docx
BBA 3310 Unit VI AssignmentInstructions Enter all answers dir.docx
 
BBA 3310 Unit VI AssignmentInstructions Enter all answers.docx
BBA 3310 Unit VI AssignmentInstructions Enter all answers.docxBBA 3310 Unit VI AssignmentInstructions Enter all answers.docx
BBA 3310 Unit VI AssignmentInstructions Enter all answers.docx
 
BBA 3301 Unit V AssignmentInstructions Enter all answers direct.docx
BBA 3301 Unit V AssignmentInstructions Enter all answers direct.docxBBA 3301 Unit V AssignmentInstructions Enter all answers direct.docx
BBA 3301 Unit V AssignmentInstructions Enter all answers direct.docx
 
Basic Guide to Program Evaluation (Including Outcomes Evaluation).docx
Basic Guide to Program Evaluation (Including Outcomes Evaluation).docxBasic Guide to Program Evaluation (Including Outcomes Evaluation).docx
Basic Guide to Program Evaluation (Including Outcomes Evaluation).docx
 

Recently uploaded

ISO/IEC 27001, ISO/IEC 42001, and GDPR: Best Practices for Implementation and...
ISO/IEC 27001, ISO/IEC 42001, and GDPR: Best Practices for Implementation and...ISO/IEC 27001, ISO/IEC 42001, and GDPR: Best Practices for Implementation and...
ISO/IEC 27001, ISO/IEC 42001, and GDPR: Best Practices for Implementation and...
PECB
 
What is Digital Literacy? A guest blog from Andy McLaughlin, University of Ab...
What is Digital Literacy? A guest blog from Andy McLaughlin, University of Ab...What is Digital Literacy? A guest blog from Andy McLaughlin, University of Ab...
What is Digital Literacy? A guest blog from Andy McLaughlin, University of Ab...
GeorgeMilliken2
 
Pride Month Slides 2024 David Douglas School District
Pride Month Slides 2024 David Douglas School DistrictPride Month Slides 2024 David Douglas School District
Pride Month Slides 2024 David Douglas School District
David Douglas School District
 
Cognitive Development Adolescence Psychology
Cognitive Development Adolescence PsychologyCognitive Development Adolescence Psychology
Cognitive Development Adolescence Psychology
paigestewart1632
 
DRUGS AND ITS classification slide share
DRUGS AND ITS classification slide shareDRUGS AND ITS classification slide share
DRUGS AND ITS classification slide share
taiba qazi
 
Hindi varnamala | hindi alphabet PPT.pdf
Hindi varnamala | hindi alphabet PPT.pdfHindi varnamala | hindi alphabet PPT.pdf
Hindi varnamala | hindi alphabet PPT.pdf
Dr. Mulla Adam Ali
 
Executive Directors Chat Leveraging AI for Diversity, Equity, and Inclusion
Executive Directors Chat  Leveraging AI for Diversity, Equity, and InclusionExecutive Directors Chat  Leveraging AI for Diversity, Equity, and Inclusion
Executive Directors Chat Leveraging AI for Diversity, Equity, and Inclusion
TechSoup
 
Exploiting Artificial Intelligence for Empowering Researchers and Faculty, In...
Exploiting Artificial Intelligence for Empowering Researchers and Faculty, In...Exploiting Artificial Intelligence for Empowering Researchers and Faculty, In...
Exploiting Artificial Intelligence for Empowering Researchers and Faculty, In...
Dr. Vinod Kumar Kanvaria
 
Film vocab for eal 3 students: Australia the movie
Film vocab for eal 3 students: Australia the movieFilm vocab for eal 3 students: Australia the movie
Film vocab for eal 3 students: Australia the movie
Nicholas Montgomery
 
MARY JANE WILSON, A “BOA MÃE” .
MARY JANE WILSON, A “BOA MÃE”           .MARY JANE WILSON, A “BOA MÃE”           .
MARY JANE WILSON, A “BOA MÃE” .
Colégio Santa Teresinha
 
The simplified electron and muon model, Oscillating Spacetime: The Foundation...
The simplified electron and muon model, Oscillating Spacetime: The Foundation...The simplified electron and muon model, Oscillating Spacetime: The Foundation...
The simplified electron and muon model, Oscillating Spacetime: The Foundation...
RitikBhardwaj56
 
BBR 2024 Summer Sessions Interview Training
BBR  2024 Summer Sessions Interview TrainingBBR  2024 Summer Sessions Interview Training
BBR 2024 Summer Sessions Interview Training
Katrina Pritchard
 
How to Setup Warehouse & Location in Odoo 17 Inventory
How to Setup Warehouse & Location in Odoo 17 InventoryHow to Setup Warehouse & Location in Odoo 17 Inventory
How to Setup Warehouse & Location in Odoo 17 Inventory
Celine George
 
How to Add Chatter in the odoo 17 ERP Module
How to Add Chatter in the odoo 17 ERP ModuleHow to Add Chatter in the odoo 17 ERP Module
How to Add Chatter in the odoo 17 ERP Module
Celine George
 
A Independência da América Espanhola LAPBOOK.pdf
A Independência da América Espanhola LAPBOOK.pdfA Independência da América Espanhola LAPBOOK.pdf
A Independência da América Espanhola LAPBOOK.pdf
Jean Carlos Nunes Paixão
 
RPMS TEMPLATE FOR SCHOOL YEAR 2023-2024 FOR TEACHER 1 TO TEACHER 3
RPMS TEMPLATE FOR SCHOOL YEAR 2023-2024 FOR TEACHER 1 TO TEACHER 3RPMS TEMPLATE FOR SCHOOL YEAR 2023-2024 FOR TEACHER 1 TO TEACHER 3
RPMS TEMPLATE FOR SCHOOL YEAR 2023-2024 FOR TEACHER 1 TO TEACHER 3
IreneSebastianRueco1
 
PIMS Job Advertisement 2024.pdf Islamabad
PIMS Job Advertisement 2024.pdf IslamabadPIMS Job Advertisement 2024.pdf Islamabad
PIMS Job Advertisement 2024.pdf Islamabad
AyyanKhan40
 
South African Journal of Science: Writing with integrity workshop (2024)
South African Journal of Science: Writing with integrity workshop (2024)South African Journal of Science: Writing with integrity workshop (2024)
South African Journal of Science: Writing with integrity workshop (2024)
Academy of Science of South Africa
 
How to Manage Your Lost Opportunities in Odoo 17 CRM
How to Manage Your Lost Opportunities in Odoo 17 CRMHow to Manage Your Lost Opportunities in Odoo 17 CRM
How to Manage Your Lost Opportunities in Odoo 17 CRM
Celine George
 
Your Skill Boost Masterclass: Strategies for Effective Upskilling
Your Skill Boost Masterclass: Strategies for Effective UpskillingYour Skill Boost Masterclass: Strategies for Effective Upskilling
Your Skill Boost Masterclass: Strategies for Effective Upskilling
Excellence Foundation for South Sudan
 

Recently uploaded (20)

ISO/IEC 27001, ISO/IEC 42001, and GDPR: Best Practices for Implementation and...
ISO/IEC 27001, ISO/IEC 42001, and GDPR: Best Practices for Implementation and...ISO/IEC 27001, ISO/IEC 42001, and GDPR: Best Practices for Implementation and...
ISO/IEC 27001, ISO/IEC 42001, and GDPR: Best Practices for Implementation and...
 
What is Digital Literacy? A guest blog from Andy McLaughlin, University of Ab...
What is Digital Literacy? A guest blog from Andy McLaughlin, University of Ab...What is Digital Literacy? A guest blog from Andy McLaughlin, University of Ab...
What is Digital Literacy? A guest blog from Andy McLaughlin, University of Ab...
 
Pride Month Slides 2024 David Douglas School District
Pride Month Slides 2024 David Douglas School DistrictPride Month Slides 2024 David Douglas School District
Pride Month Slides 2024 David Douglas School District
 
Cognitive Development Adolescence Psychology
Cognitive Development Adolescence PsychologyCognitive Development Adolescence Psychology
Cognitive Development Adolescence Psychology
 
DRUGS AND ITS classification slide share
DRUGS AND ITS classification slide shareDRUGS AND ITS classification slide share
DRUGS AND ITS classification slide share
 
Hindi varnamala | hindi alphabet PPT.pdf
Hindi varnamala | hindi alphabet PPT.pdfHindi varnamala | hindi alphabet PPT.pdf
Hindi varnamala | hindi alphabet PPT.pdf
 
Executive Directors Chat Leveraging AI for Diversity, Equity, and Inclusion
Executive Directors Chat  Leveraging AI for Diversity, Equity, and InclusionExecutive Directors Chat  Leveraging AI for Diversity, Equity, and Inclusion
Executive Directors Chat Leveraging AI for Diversity, Equity, and Inclusion
 
Exploiting Artificial Intelligence for Empowering Researchers and Faculty, In...
Exploiting Artificial Intelligence for Empowering Researchers and Faculty, In...Exploiting Artificial Intelligence for Empowering Researchers and Faculty, In...
Exploiting Artificial Intelligence for Empowering Researchers and Faculty, In...
 
Film vocab for eal 3 students: Australia the movie
Film vocab for eal 3 students: Australia the movieFilm vocab for eal 3 students: Australia the movie
Film vocab for eal 3 students: Australia the movie
 
MARY JANE WILSON, A “BOA MÃE” .
MARY JANE WILSON, A “BOA MÃE”           .MARY JANE WILSON, A “BOA MÃE”           .
MARY JANE WILSON, A “BOA MÃE” .
 
The simplified electron and muon model, Oscillating Spacetime: The Foundation...
The simplified electron and muon model, Oscillating Spacetime: The Foundation...The simplified electron and muon model, Oscillating Spacetime: The Foundation...
The simplified electron and muon model, Oscillating Spacetime: The Foundation...
 
BBR 2024 Summer Sessions Interview Training
BBR  2024 Summer Sessions Interview TrainingBBR  2024 Summer Sessions Interview Training
BBR 2024 Summer Sessions Interview Training
 
How to Setup Warehouse & Location in Odoo 17 Inventory
How to Setup Warehouse & Location in Odoo 17 InventoryHow to Setup Warehouse & Location in Odoo 17 Inventory
How to Setup Warehouse & Location in Odoo 17 Inventory
 
How to Add Chatter in the odoo 17 ERP Module
How to Add Chatter in the odoo 17 ERP ModuleHow to Add Chatter in the odoo 17 ERP Module
How to Add Chatter in the odoo 17 ERP Module
 
A Independência da América Espanhola LAPBOOK.pdf
A Independência da América Espanhola LAPBOOK.pdfA Independência da América Espanhola LAPBOOK.pdf
A Independência da América Espanhola LAPBOOK.pdf
 
RPMS TEMPLATE FOR SCHOOL YEAR 2023-2024 FOR TEACHER 1 TO TEACHER 3
RPMS TEMPLATE FOR SCHOOL YEAR 2023-2024 FOR TEACHER 1 TO TEACHER 3RPMS TEMPLATE FOR SCHOOL YEAR 2023-2024 FOR TEACHER 1 TO TEACHER 3
RPMS TEMPLATE FOR SCHOOL YEAR 2023-2024 FOR TEACHER 1 TO TEACHER 3
 
PIMS Job Advertisement 2024.pdf Islamabad
PIMS Job Advertisement 2024.pdf IslamabadPIMS Job Advertisement 2024.pdf Islamabad
PIMS Job Advertisement 2024.pdf Islamabad
 
South African Journal of Science: Writing with integrity workshop (2024)
South African Journal of Science: Writing with integrity workshop (2024)South African Journal of Science: Writing with integrity workshop (2024)
South African Journal of Science: Writing with integrity workshop (2024)
 
How to Manage Your Lost Opportunities in Odoo 17 CRM
How to Manage Your Lost Opportunities in Odoo 17 CRMHow to Manage Your Lost Opportunities in Odoo 17 CRM
How to Manage Your Lost Opportunities in Odoo 17 CRM
 
Your Skill Boost Masterclass: Strategies for Effective Upskilling
Your Skill Boost Masterclass: Strategies for Effective UpskillingYour Skill Boost Masterclass: Strategies for Effective Upskilling
Your Skill Boost Masterclass: Strategies for Effective Upskilling
 

Based on the materials for this week, create your own unique Datab.docx

  • 1. Based on the materials for this week, create your own unique Database table using MySQL. The table should contain at least 6 columns (use different data type, as appropriate for your application). The table should have a Primary Key and one other constraint of your choice. You should populate the table with 5 records. Then Query the table to display all columns for all records. You should provide the SQL script and screen captures of you successfully running the script. Respond to other students by supplying scripts that add additional records, modiify or query data from the tables. Demonstrate your modifications worked by providing the screen shots of your scripts successfully running. Business-level strategies are intended to help an organization take advantage of opportunities in its environment to create value for stakeholders. Low-cost and differentiation strategies are the two primary approaches used by organizations to gain competitive advantage at the business level. Describe the two types of strategies. Using the example of a chain of women’s clothing stores, analyze how such an organization might employ each type of strategy. How would the organization design its structure under each type of business-level strategy? How would the culture of the organization differ under each type of business-level strategy?
  • 2. Should be at least 300 words. Does not have to be in paper format this is only a post Name: William Clements Class: SDEV 300 Section: 6380 Date: 6/15/2016 Lab 7 Screen Shot: 1 Introduction to MySQL Overview This lab walks you through using MySQL. MySQL is a relational database that can be used as part of Web and other applications. This lab serves as a primer for using MySQL and will serve as a foundation when we discuss SQL injection attacks and possible mitigations. Learning Outcomes:
  • 3. At the completion of the lab you should be able to: 1. Connect to a MySQL database and show the tables within the Ubuntu virtual machine 2. Create MySQL tables containing popular data types and constraints 3. Insert, update and delete data from MySQL database tables 4. Create and execute SQL Select statements and simple joins on MySQL tables Lab Submission Requirements: After completing this lab, you will submit a word (or PDF) document that meets all of the requirements in the description at the end of this document. In addition, your MySQL file should be submitted. You can submit multiple files in a zip file. Virtual Machine Account Information Your Virtual Machine has been preconfigured with all of the software you will need for this class. The default username and password are: Username : umucsdev Password: umuc$d8v
  • 4. MySQL Username: sdev_owner MySQL password: sdev300 MySQL database: sdev Part 1 – Connect to a MySQL database and show the tables within the Ubuntu virtual machine The Virtual Machine already has MySQL installed. A MySQL username has also been created along with a database to use for your applications and testing. Although there are SQL editors available, for simplicity, we will use gedit to create the MySQL scripts. To run the scripts we will just copy and paste from the editor to the MySQL prompt. 1. Assuming you have already launched and logged into your SDEV32Bit Virtual Machine (VM) from the Oracle VirtualBox, open up the terminal by clicking on the terminal icon. 2
  • 5. 2. To start the MySQL database type the following the terminal prompt: mysql -u sdev_owner -p When prompted for the password enter sdev300 3 3. To display the available databases type the following at the mysql prompt: show databases; 4. The database we will be using for this course is sdev. To use this database, type the following at the mysql prompt: use sdev;
  • 6. 4 5. To display the current tables in the sdev database, type the following command at the mysql prompt: show tables; You may already have some tables in your database. If so, the names of those tables would be displayed. If not, you would see Empty set as illustrated above. 6. To exit the MySQL application. Type exit at the mysql prompt: 5 Part 2 Create MySQL tables containing popular data types and constraints The reading for this week covered the foundations for creating and dropping tables using a variety of
  • 7. data types and constraints. In this exercise we will create three tables along that could be used to represent a very simple student and course registration system. The tables all have primary keys. One table provides foreign keys to the other two tables. When creating SQL commands to be executed in MySQL, it is always recommended to prepare them in a text editor and then either run the script or copy and paste into the MySQL application. Since this isn’t a course in database design, we will just copy and paste from the gedit text editor. 1. Create a folder named sql to hold your sql scripts in the home/umucsdev directory. Copy and paste the following SQL code into a file named CreateTables.sql use sdev; // Create a student table CREATE TABLE Students ( PSUsername varchar(30) primary key, FirstName varchar(30), LastName varchar(30), EMail varchar(60) );
  • 8. CREATE TABLE Courses( CourseID int primary key, CourseDisc varchar(4), CourseNum varchar(4), CourseTitle varchar(75) ); CREATE TABLE StudentCourses ( StudentCourseID int primary key, CourseID int references Courses(CourseID), PSUsername varchar(30) references Students(PSUsername) ); 6 2. Open a terminal and launch mysql using the following command:
  • 9. mysql -u sdev_owner -p When prompted type the sdev password 7 3. At the mysql prompt begin copying and pasting the SQL code. You can copy it all at once. 4. The Query OK output from MySQL is an indicator your SQL execution was successful. In addition your can type the following at the mysql prompt to show the tables: show tables; 5. You can also describe each table: 8
  • 10. desc Courses; desc StudentCourses; desc Students; On the Linux Operating system, MySQL table data and names are case sensitive. Hence (Students is not the same as students or STUDENTS). This is critical when you start running your queries for your applications. You should experiment in MySQL by creating one or two of your own tables. Be sure to use several data types and add a primary key for each table and other constraints as needed. Part 3 Insert, update and delete data from MySQL database tables Once tables have been created your can insert records and then update the record or even delete the record. This exercise discusses how to use MySQL to populate and modify the records in your database. We will once again, create the database scripts using the gedit text editor.
  • 11. 1. Copy and paste the following SQL code into a file named InsertUpdateDeleteTables.sql -- Insert students insert into Students values ('jsmith', 'John','Smith','[email protected]'); insert into Students 9 values ('mjones', 'Mary','Jones','[email protected]'); insert into Students values ('jparsons', 'Jeff','Parsons','[email protected]'); -- Insert Courses insert into Courses values (1, 'SDEV','300','Secure Web Development'); insert into Courses values (2, 'SDEV','360','Secure Software LifeCycle');
  • 12. -- Insert student courses insert into StudentCourses values (1,1,'jsmith'); insert into StudentCourses values (2,1,'mjones'); -- Update the Student data update Students set Email = '[email protected]' where PSUsername = 'jsmith'; update Students set Email = '[email protected]' where PSUsername = 'mjones'; update Students set Email = '[email protected]' where PSUsername = 'jparsons'; -- delete the Parsons record delete from Students where PSUsername = 'jparsons';
  • 13. 10 2. Start MySQL on your virtual machine, login as sdev_owner and then be sure to use the sdev database. 3. Copy and paste the SQL statements into the mysql prompt and your data will be inserted and modified. As you review the script and experiment by inserting, updating and deleting your own unique records, you should note following: 11 a. The primary key is a critical element and used to find records to update as well as delete. Notice the where clause is based on the primary key. When you build your own statements, be sure to consider this model.
  • 14. b. The update statement uses the set clause. If you wanted to update multiple columns you would just use a comma between each new update. (e.g. set Email=’NewEmail, lastname=’NewLastname’) c. Be cautious with both deletes and updates. Be sure you use where clauses to filter to the specific rows or rows you want to modify or delete. Disastrous consequences could occur if you don’t take caution here. For example, if you don’t put the where clause for the updates, you could potentially change every record with your new data. Part 4 Create and execute SQL Select statements and simple joins on MySQL tables Once tables have been created and data populated, you can query the tables using the Select statement. The Select statement has many clauses, the examples below will emphasis the where and order by clauses. 1. Copy and paste the following SQL code into a file named QueryTables.sql -- Select all records and columns select * from Students; select * from Courses;
  • 15. select * from StudentCourses; -- Use the Where clause select Email from Students where PSUsername = 'jsmith'; select * from Courses where CourseDisc Like ('SD%'); select PSUsername from StudentCourses where CourseID = 1; -- Order by select * from Students Order by LastName; select * from StudentCourses order by CourseID; -- Joins to get more details
  • 16. select A.PSUsername, CourseDisc from StudentCourses A, Courses B, Students C where A.PSUsername =C.PSUsername and A.CourseID = B.CourseID; select A.PSUsername, CourseDisc,CourseNum, CourseTitle from StudentCourses A, Courses B, Students C 12 where A.PSUsername =C.PSUsername and A.CourseID = B.CourseID order by B.CourseID,A.PSUsername; 2. Start MySQL on your virtual machine, login as sdev_owner and then be sure to use the sdev database. 3. Copy and paste from the QueryTables.sql file to your mysql prompt. Executing one or two queries at a time is recommended so you can experiment and analyze the results for each
  • 17. query. 13 As you experiment and analyze the SQL statements and results note the following: a. Where clauses are critical to filtering and returning the exact rows you want. b. If you use the Like clause you can also use the wild card character (‘%’) to provide results for any character. c. You can use the Order by clause with multiple columns by using a comma between each column. d. Joins can be tricky. For this course, we will work to keep no more than 3 table joins. Notice the pattern you need to join each table on the column that has the identical column. (e.g. PSUsername is found in both Students and StudentCourses). You may need to reference the 14
  • 18. alias (e.g. A or B in this case) to remove redundant namings. This is why we had to use order by B.CourseID, A.PSUsername. If we just used CourseID or PSUsername, the query would not know which table column to use. Joins Query statements may take some extra practice to become comfortable with. Lab submission details: As part of the submission for this Lab, you will design your own tables and populate them with data based on the following requirements. For each of the requirements, be sure to save the specific SQL statements that you used. Please label each SQL statement corresponding to the numbered requirements below: 1. Create a table named Faculty to store FacultyID( Primary key), FirstName, LastName, Email, Date of birth and number of courses taught to date. You should select the appropriate data types and constraints for the table. 2. Create a table named Courses to store CourseID (Primary key), Discipline Name (e.g. SDEV), Course Number (e.g. 300), Number of Credits (e.g. 3), Year
  • 19. first offered (e.g. 2010) and Course Title. You should select the appropriate data types and constraints for the table. 3. Create a table named FacultyCourses to store the Faculty and the Courses they have taught. You should design the table based on the Faculty and Courses tables you previously created. 4. Use Insert statements to populate at least 10 faculty records, 5 Course records, and 25 FacultyCourses records 5. Use update statements to update all Courses to 4 credits 6. Use update statements to update any Faculty who have taught more than 4 courses to modify the number to 5 courses taught 7. Delete any Faculty record whose LastName starts with the letter ‘Z’ 8. Delete any Course record that was first offered in 1999 9. Use select statements to display all records in all 3 tables. Order by the Faculty lastname, and Course title as appropriate. Note you should use 3 separate select statements to satisfy this requirement.
  • 20. 10. Use Select statements to display all Faculty who have not taught any courses 11. Use Select statements to display all Courses offered before 1984 12. Use Select and appropriate joins to display all columns from the Faculty and Course tables for each Faculty and Course in the FacultyCourse table. Note: this will be a 3-table join. Create screen shots showing the successful running of each your scripts. For your deliverables, you should submit a zip file containing your word document (or PDF file) with screen shots of the application running successfully along with your SQL script file. You do not need separate files for each script. You can include them in one SQL script. Include your full name, class number and section and date in the document.