Mis582 full course-Normalizing the Database
Mis582 full course-Normalizing the Database
Subject: General Questions / General General Questions Week 2 discussion
DQ1
Normalizing the Database
Consider the following entity and its attributes. INVOICE (Number, Customer Name, Customer Number, Customer Address, Item Number, Item Price, Item Quantity, Sales Person Number, Sales Person Name, Subtotal, Tax, Total Due)
What issue does this entity have that can be solved by normalization?
What functional dependencies exist between the attributes?
How would you apply normalization to break this into more than one entity, each with a single theme?
DQ2
The Different Normal Forms
Many texts and articles will state that normalization to 3NF is sufficient.
Are there database environments that would require normalization to a higher normal form?
How about environments that do better when is there normalization to a lower normal form?
Why do you think there are so many different normal forms to choose from?
Week 3 discussion
DQ1
Data Modeling Patterns
The textbook talks about the relationships between user forms and reports and their underlying database structure. There are well-known structures used in forms and reports that translate into well-known patterns that appear regularly in an ERD (entity relationship diagram) database model.
Describe one of these data modeling patterns, along with an example of when it would be used. Do not use the examples given in the textbook.
Have you seen any of these well-known patterns in forms or reports that you have encountered at work or on the Internet? Give an example and explain what it lets you infer about the underlying structure of the database behind it.
DQ2
Entity Types and Relationships
There are many kinds of entity relationships in a database model. The relationships can be classified by the following things.
Cardinality: maximum and minimum
Degree: binary, ternary, degree 4, and so forth
Entity type: strong, weak, ID-dependent, and supertype/subtype
What are these different types of classifications? Do they overlap, or do they each tell us something unique about the entity relationship? Why is it important to classify each of these types in an ERD (entity relationship diagram) model?
Week 4 discussion
DQ1
Entity and Table Relationships
When creating relationships between tables in our database, we must consider the following entity relationships.
Non-identifying relationships between strong entities
Identifying relationships between ID-dependent entities
Mixed-entity pattern relationships
Supertype and subtype relationships
Recursive relationships
Create an example of entities in one of these relationships and describe how the entity pattern is transformed into database tables.
DQ2
Referential Integrity Actions
Representing minimum cardinality in a physical database design can be tricky depending on whether the parent-child relationship is O-O, M-O, O-M, or M-M. Give an example of one of these minimum cardinalities and how it would affect the physical database design. What are referential integrity actions, and how could you use them in your example?
Week 6 discussion
DQ1
Database Constraints
Business requirements are enforced by implementing database constraints on tables and columns. The database constraints available include the following.
PRIMARY KEY
FOREIGN KEY or REFERENTIAL INTEGRITY
NOT NULL
UNIQUE
CHECK
Give a business requirement and the constraint that could be implemented to enforce it. Explain the constraint you chose, and give the SQL to implement the constraint in the database.
What are the long-term problems when these constraints are not implemented?
DQ2Database Redesign
After your database was put into production, a design flaw was discovered! One of the relationships modeled as a 1:N relationship was really an N:M relationship. The database issue involves the following tables, with PK italicized and underlined.
VEHICLE (VIN, Make, Model, Color, LicenseTag)
DRIVERS (DriverLicenseNo, LastName, FirstName, Address, Zip, VIN)
ZIPCODE (Zipcode, City, State)
Which 1:N relationship should be an N:M relationship? How would you redesign the database to correct the issue? What else must you consider when updating the structure of your database tables?
Week 7 discussion
DQ1
Database Locking
Databases are designed to allow multiple users to have concurrent access to data. Yet this capability presents certain problems. Investigate how databases resolve multiple concurrent data management issues, including lost updates, deadlocks, and different types of lock management styles. Compare the different locking capabilities of Microsoft Access to one other database product.
Post your analysis in the thread. Do not cut and paste from the Internet. You should also respond to other posts to add additional information, clarify points, or answer questions.
DQ2
Databases for Business Intelligence
We’ve been focusing on operational databases, often called online transaction processing (OLTP) systems. These OLTP systems handle the day-to-day business of the company and are accessed by multiple users simultaneously, updating the data in short transactions.
Business intelligence systems are sometimes called online analytical processing (OLAP) systems. These OLAP systems are used to make decisions and are characterized by few users submitting long-running queries that do not update the database to analyze the historic data of the company. What are some other differences between OLTP and OLAP systems? How are data warehouses similar or different from these two database models?
Week 2 quiz
1. (TCO A) The purpose of a database is to _____.
help people keep track of things
store data in tables
maintain data on different things in different tables
create tables of rows and columns
allow Web applications to retrieve data
Question 2.(TCO C) Referential integrity constraints are used to limit the possible values of a _____.
candidate key
surrogate key
foreign key
composite key
dependency
Question 3. (TCO D) In a SQL query, which of the following symbols is used by ANSI SQL to represent all of the columns in a single table?
_ (underscore)
? (question mark)
* (asterisk)
% (percent)
# (pound)
Question 4. (TCO G) An online drugstore, such as Drugstore.com, is an example of a(n) _____.
single-user database application
an ERP application
e-commerce database application
All of the above
Both A and C
Question 5. (TCO C) A relation is in Boyce-Codd normal form if _____.
every determinant is a candidate key
every determinant is a primary key
every attribute is a candidate key
there is more than one candidate key
there is more than one primary key
Question 6. (TCO D) Match the following terms to their definitions.
5
: MAX » SQL built-in function that obtains the largest value in a numeric column
2
: SUM » SQL built-in function that totals values in a numeric column
1
: AVG » SQL built-in function that computes the average of values in a numeric column
4
: MIN » SQL built-in function that obtains the smallest value in a numeric column
3
: COUNT » SQL built-in function that computes the number of rows in a table
Instructor Explanation: General Feedback: See Chapter 2 in the textbook.
Question 7. (TCO C) Explain the relationships among primary keys and functional dependencies.
Week 4 quiz
1. (TCO B) Maximum cardinality refers to _____.
the most instances of one entity class that can be involved in a relationship with one instance of another entity class
the maximum number of entity classes involved in a relationship
whether or not an instance of one entity class is required to be related to an instance of another entity class
whether or not an entity is a weak entity
None of the above
Question 2. (TCO B) The characteristics of a thing are described by its _____.
identifiers
entities
objects
attributes
relationships
Question 3. (TCO C) The identifier of the entity becomes the _____ of the corresponding table.
A. primary key
B. foreign key
C. supertype
D. subtype
Both A and B
Question 4. (TCO C) In a relational database design, all relationships are expressed by _____.
creating a primary key
creating a foreign key
creating a supertype
creating a subtype
creating a line between entities
Question 5. (TCO C) In relational database design, ID-dependent entities are used to _____.
represent N:M relationships
handle associative relationships
handle multivalued attributes
handle archetype/instance relationships
All of the above
Question 6. (TCO B) Match the following terms to their definitions.
4
: ID-dependent entity » an entity whose identifier includes the identifier of another entity
2
: Subtype » an entity that holds specialized attributes that distinguish it from one or more other similar entities
5
: Weak entity » an entity whose existence depends on the presence of another entity but whose identifier does not include the identifier of the other entity
3
: Attribute » describes characteristic of an entity
1
: Entity » something that the users want to track in their environment
Question 7. (TCO C) How would you represent a one-to-many strong entity relationship in a physical relational database design?
Week 6 quiz
1.(TCO E) Which of the following is true about ODBC?
ODBC has experienced little practical success.
ODBC requires developers to have a thorough knowledge of many DBMS native libraries.
ODBC can be used to access data from spreadsheets.
ODBC has an object-oriented interface.
ODBC does not include facilities to return error messages.
Question 2.(TCO E) The characteristics of an object are called _____.
classes
collections
methods
properties
procedures
Question 3.(TCO G) Which of the following is true of JDBC?
Programs must be written in Java.
JDBC only works with open-source products.
JDBC is only available for Unix-like operating systems, such as Linux.
JDBC is actually a DBMS.
A and B
Question 4.(TCO G) Which of the following is not true of PHP?
PHP is easy to learn.
PHP is a competitor to ASP.NET.
PHP is part of the AMP architecture.
PHP is not supported in the Microsoft environment.
PHP is vendor neutral.
Question 5. (TCO F) When increasing cardinalities from 1:N to N:M, which of the following steps are included in the process? (The order the steps are listed below is not relevant.)
Create an intersection table.
Populate the intersection table.
Drop the old foreign key.
A and B
A, B, and C
Question 6.(TCO F) Match the following SQL key words with their definitions.
2
: Used to limit column values to specific values » CHECK
4
: Used in conjunction with the SQL key words PRIMARY KEY and FOREIGN KEY » CONSTRAINT
1
: Used to define an alternate key (x » b) = UNIQUE
3
: Used to name a new table and describe the table’s columns » CREATE
Question 7. (TCO F) When redesigning a database that contains data, how can we check assumptions about functional dependencies?
Week 1 I-lab
Scenario/Summary
This week, you will learn to create and run SQL SELECT queries in the MySQL database. You will need to create a database in MySQL via Omnymbus, run a SQL script to create tables and insert data, create and execute SQL SELECT queries using the STUDENT table.
Please ensure that you can connect to MySQL/Omnymbus via the account your Professor has emailed to you. Please consult with the document titled MySQLOmnymbusSupport.docx ?located in the Doc-Sharing folder titled Omnymbus Tutorial Files for instructions on how to get help for any issues that you are having with the MySQL/Omnymbus Environment.
Listen
Deliverables
NOTE
Submit your assignment to the Dropbox, located at the top of this page. For instructions on how to use the Dropbox, read these step-by-step instructions.
(See the Syllabus section “Due Dates for Assignments & Exams” for due dates.)
SQL file named LastName_Lab1_Query.sql containing SELECT statements
Word document named LastName_Lab1_Output containing queries and output
Zip the files, and upload the zipped file to the Week 1: iLab Dropbox.
Listen
Required Software
Omnymbus – MySQL
Access the software at https://devry.edupe.net:8300
Steps: 1–4
Listen
Lab Steps
Listen
STEP 1: Logging in to Omnymbus
Look at your email account to obtain the MySQL/Omnymbus account and password that your Professor has emailed to you.
To help you log into MySQL Omnymbus environment, download the tutorial Login MySQL Omnymbus Environment in the Doc-Sharing folder titled “Omnymbus Tutorial Files”.
Listen
STEP 2: Create a Database and modify your script to reference your Database
Create a MySQL database:
Download the tutorial Creating a Database in MySQL Omnymbus Environment from the folder in Doc-Sharing titled Omnymbus Tutorial Files. Follow the steps to create a database in MySQL, especially paying attention to the database naming conventions specified in the tutorial.
Download the WeekOneiLabScript.sql file from Doc Sharing in the folder titled iLab Documents
Listen
STEP 3: Running script file in MySQL, create SQL SELECT Queries
Run scripts files in MySQL:
Download the tutorial Running SQL Scripts in MySQL Omnymbus environment from the folder in Doc-Sharing titled Omnymbus Tutorial Files. Follow those steps to help execute the WeekOneiLabScript.sql file needed to create the needed tables and to insert data into them.
Create SQL SELECT Queries:
Using the data in the Student table in the database, create a SQL script file named LastName_Lab1_Query.sql, containing queries to execute each of the tasks below.
To reference, learn and apply MySQL’s own dialect of the SQL language to this iLab, browse through the file M10C_KROE8352_13_SE_WC10C.pdf in the Doc-Sharing folder titled My SQL Documents.
Save each query with a screen shot of the output in a MS Word document named Lastname_Lab1_Output.
Name Task
Query1 Write a SQL statement to display Student’s First and Last Name.
Query2 Write a SQL statement to display the Major of students with no duplications. Do not display student names.
Query3 Write a SQL statement to display the First and Last Name of students who live in the Zip code 82622
Query4 Write a SQL statement to display the First and Last Name of students who live in the Zip code 97912 and have the major of CS.
Query5 Write a SQL statement to display the First and Last Name of students who live in the Zip code 82622 or 37311. Do not use IN.
Query6
Write a SQL statement to display the First and Last Name of students who have the major of Business or Math. Use IN.
Query7 Write a SQL statement to display the First and Last Name of students who have the Class greater than 1 and less than 10. Use the SQL command BETWEEN.
Query8 Write a SQL statement to display the First and Last Name of students who have a last name that starts with an S.
Query9 Write a SQL statement to display the First and Last Name of students having an a in the second position of their first names.
Query10
Write a SQL expression to display each Status and the number of occurrences of each status using the Count(*) function; display the result of the Count(*) function as CountStatus. Group by Status and display the results in descending order of CountStatus.
Listen
STEP 4: Save and Upload to Dropbox
When you are done, zip the files Lastname_Lab1_Query.sql and Lastname_Lab1_Query_Output file and upload them to the Week 1: iLab Dropbox.
Listen
Rubric
Queries that are correct will be awarded the number of points shown below:
4 points: Query 1
5 points: Query 2 – 9
6 points: Query 10
The following rubrics will be used for incorrect queries:
0 points: Query was not turned in with the assignment.
-4 points: Query will not run.
-3 points: Query runs but is incorrect because query required a WHERE clause to meet requirements which was not included.
-2 points: Query runs but is incorrect because WHERE clause contained errors, gives popup for user input, or only meets partial requirements.
Week 3 I-lab
Scenario/Summary
In this assignment, you will learn to create a physical database model in Visio from a liste set of business requirements.
NOTE: Please ensure you can run Visio 2010 either via Citrix or by an installation on your computer. Note that Citrix only supports Visio 2010. Visio is downloadable through the Student Software Store under Course Home in our Shell. If you have Visio 2013, you can use that at well too. There are two tutorials to consult with dependent on which version of Visio you will be using, either DBP-e13-Appendix-F.pdf or kroenke_dbp12e_appendix_f.pdf. Both are housed in the in the folder titled Visio Instructions Documents in Doc-Sharing. Access Visio 2010 at https://lab.devry.edu. If you cannot connect to Citrix, please consult with the Help Desk as specified within the iLab page under Course Home. Note, that the Steps listed below are specific to Visio 2010.
Listen
Deliverables
NOTE
Submit your assignment to the Dropbox, located at the top of this page. For instructions on how to use the Dropbox, read these step-by-step instructions.
(See the Syllabus section “Due Dates for Assignments & Exams” for due dates.)
Name your Visio file using Lab2_, your first initial, and your last name (e.g., Lab2_JSmith.vsd). Create and save your database model in your Visio file. When you are done, submit your database to the Week 3: iLab Course Dropbox.
Create and save your database model in your Visio file. Submit your file to the Week 3: iLab Course Dropbox.
Listen
Required Software
Visio 2010
(Visio 2010 is required for this project. Please ensure that you can run Visio 2010 via Citrix or by having it installed on your computer.)
Access the software at https://lab.devry.edu.
Steps: 1-8
Listen
Lab Steps
Listen
STEP 1: Business Case
Read the following business requirements closely to determine the entities and relationships needed to fulfill the requirements. The nouns in the paragraph will tell you the entities that will be needed. The verbs in the paragraph will help you determine the relationships between the entities.
Muscles Health Club Database Requirements
The Muscles Health Club needs a database to keep track of its members, their personal trainers, and the fitness classes that they are taking.
Employees can act as personal trainers for members. However, only certified employees can act as personal trainers. A member can work with only one personal trainer at a time.
Members can take multiple fitness classes. Fitness classes are taught by employees who can teach multiple classes. Fitness classes are taught in one of the classrooms at one of Muscles Health Club’s several locations.
Each fitness classroom is designed for a different type of class (e.g., spinning, aerobics, water aerobics, weight training, etc.). It is necessary to track what fitness classes are being held in each of the different Muscles Health Club locations.
Listen
STEP 2: Using Visio
Run Visio 2010 either via Citrix or on your workstation.
Click on the Software and Database Template group in the main window.
Double-click on the Database Model Diagram Template to open a new file.
Save the file with a name containing Lab2_, your first initial, and your last name as the file name (e.g., Lab2_JSmith.vsd). You will need to click the Computer icon in the Save As window to see the different drives. Be sure to save the file to a local drive so it will be on your workstation.
Listen
STEP 3: Determine Database Entities
Add an entity for each entity that you identified in the requirements.
Drag the Entity icon onto the drawing area in Visio.
In the Database Properties window, add a physical name to identify it.
Listen
STEP 4: Entity Attributes
For each entity, create a list of attributes that you think would be useful to describe the entity.
Select an entity in the drawing area of Visio.
In the Database Properties window, select the Columns category.
Use the table to add your attributes to the selected entities.
Select one of the attributes to be the primary key (PK).
Listen
STEP 5: Crow’s Feet Notation
Set the diagram to use crow’s feet notation.
On the Database tab, in the Manage group, click Display Options.
In the Database Document Option dialog, select the Relationship tab.
Select the Crow’s Feet check box, and then click OK.
Listen
STEP 6: Entity Relationships
Draw relationships between your entities.
Drag the Relationship icon onto a blank part of the drawing area.
Connect the two ends to each of the two entities in the relationship. The parent entity must have a PK defined. The entity will be outlined in bold red lines when it connects to one end of the relationship.
Listen
STEP 7: Relationship Cardinality
Set the cardinality of your relationships.
Select a relationship line in the drawing area that is connecting two entities.
In the Database Properties window, select the Miscellaneous category.
Select the cardinality for the selected relationship.
Listen
STEP 8: Save and Upload to Dropbox
When you are done, save the file on your local hard drive and upload it to the Week 3 Course Dropbox. Your file should have the following filename format: Lab2_FirstInitialLastName.vsd.
Listen
Rubric
Points will be awarded according to the following rubrics.
10 Points: Visio drawing: E-R model is provided as a Visio diagram.
10 Points: Entities: A minimum of four entities is present.
10 Points: Attributes: There are more than two attributes per entity; in most cases, there should be several.
10 Points: Relationships: A minimum of three relationships is present.
10 Points: Cardinality is specified on each relationship with crow’s foot notation.
Week 5 I-Lab
iLab 3 of 4: Database Construction Using MySQL (100 points)
Note!
Submit your assignment to the Dropbox, located at the top of this page.
(See the Syllabus section “Due Dates for Assignments & Exams” for due dates.)
iLAB OVERVIEW
Scenario/Summary
In this assignment, you will learn to create a Database Schema from a given ERD. To complete this assignment, you will need to be able to run MySQL via Omnymbus.
Using the documentation listed at the bottom of this tutorial, please ensure that you can connect to MySQL/Omnymbus via the account your Professor has e-mailed to you, that you can properly name a database, and that you can run an sql script under that database. Please consult with the document titled MySQLOmnymbusSupport.docx located in the Doc Sharing folder titled Omnymbus Tutorial Files for instructions on how to get help for any issues that you are having with the MySQL/Omnymbus Environment.
Deliverables
SQL script file named LastName_Lab3.sql. Word document named LastName_Lab3_Output. When you are done, zip up these files and submit them to the Week 5: iLab Dropbox.
Required Software
Omnymbus – MySQL
Access the software at https://devry.edupe.net:8300.
Steps 1–8
iLAB STEPS
STEP 1: Entity Relationship Diagram Analysis
Back to Top
Review the ERD below to understand the entities, attributes, primary keys, and relationships that you will create in your MySQL database.
STEP 1: Create a New Database
• Just like you did in the Week 1 iLab, create a new database following the naming conventions we are to use for our databases, as specified in the tutorial file Creating a Database within MySQL.pdf listed in the doc-sharing folder titled “Omnymbus Tutorial Files” in Doc-Sharing. All of our work in this iLab, will be done under this database.
STEP 2: Open MySQL via Omnymbus, Create SQL File, Drop Table
Back to Top
• To reference, learn and apply MySQL’s own dialect of the SQL language to this iLab, browse through the file M10C_KROE8352_13_SE_WC10C.pdf in the Doc Sharing folder titled My SQL Documents.
• Create a script file named LastName_Lab3.sql containing SQL statements created in Steps 3–7 below.
• But first include the following commands at the top of your script:
o SET FOREIGN_KEY_CHECKS=0;
o DROP TABLE IF EXISTS STUDENT;
o DROP TABLE IF EXISTS CAMPUS;
o DROP TABLE IF EXISTS ROOM;
o DROP TABLE IF EXISTS COURSE;
o DROP TABLE IF EXISTS INSTRUCTOR;
o DROP TABLE IF EXISTS APPROVED_INSTRUCTOR;
o DROP TABLE IF EXISTS CLASS;
o DROP TABLE IF EXISTS STUDENT_GRADE;
o SET FOREIGN_KEY_CHECKS=1;
STEP 3: Add Tables, Set Primary Keys and Foreign Keys
Back to Top
Add tables to the MySQL database.
• Add a table for each entity listed in the provided ERD diagram.
• Add a column for each attribute listed in the provided ERD diagram.
• Select primary key for each table as indicated in the provided ERD diagram.
• Identify foreign key relationship between tables as indicated in the provided ERD diagram.
• Enable referential integrity on the relationship.
• Enable cascade updates on the relationship.
STEP 4: Set Data Types for Table Fields
Back to Top
For every column in every table, update the data type as needed to enforce the domain constraints of the data.
• Dates should have a date data type.
• Surrogate keys should be auto-numbered.
• Numeric data should have a numeric data type.
• Character data should have a character data type.
STEP 5: Set Column Constraints
Back to Top
Set the following column constraints in your database.
• Student first and last name cannot be a null value.
• Course credit hours must be between one and four.
• Course name must be unique and cannot be a null value.
• Instructor first and last name cannot be a null value.
• Grade must be one of these values: A, B, C, D, F, I, W, or E. W signifies withdrawn and E signifies enrolled.
STEP 6: Add Data to Tables
Back to Top
Write INSERT statements to add at least 2–3 rows of data to each table in your database. Use any values that you like for each of the columns. Remember that you must add data to parent tables before adding data to child tables, because referential integrity is enabled.
STEP 7: Run the Script
Back to Top
• Include a COMMIT command at the end of the script.
• Include SHOW TABLES command at the end of the script, to show all tables created.
• Include SELECT statements for each table at the end of the script, to show data inserted.
• Give your script a run, by uploading into Omnymbus and executing it just like you did in iLab1.
• Paste a copy of the output in a MS Word document named LastName_Lab3_Output.
Step 8: Save and Upload to Dropbox
Back to Top
When you are done, zip up the following files to the Week 5: iLab Dropbox:
• LastName_Lab3.sql script file.
• LastName_Lab3_Output Word document.
Rubric
Back to Top
Points will be awarded according to the following rubrics.
• 5 points: Table created for each entity in the provided E-R model
• 5 points: Column created for each attribute in the provided E-R model
• 5 points: Primary key added for each table with unique constraints specified as column properties
• 5 points: Data type set for each attribute
o Dates should have a date data type.
o Surrogate keys should be autonumbered.
o Numeric data should have a numeric data type.
o Character data should have a character data type.
• 10 Points: Relationships created as shown on the provided E-R model
o Relationships enabled for referential integrity
o Relationships enabled for cascade updates.
• 10 Points: At least five rows of data added for each table
• 10 Points: Column constraints added as indicated in project description, checked by adding rows to data with invalid values
o Student name cannot be set to null.
o Course credit hours are restricted to between one and four.
o Course name must be unique and cannot be set to null.
o Instructor last name and first name cannot be set to null.
o Grade is restricted to be one of these values: A, B, C, D, F, I, W, or E (enrolled).
Week 7 I-lab
Scenario/Summary
In this assignment, you will learn to create and manipulate a MySQL database using the PHP. To complete this assignment, you will need to be able to run MySQL via Omnymbus. You should review Chapter 11’s coverage on PHP, the tutorial titled “PHP and MySQL” listed in the Webliography and MySQL’s own dialect of the SQL language via the file M10C_KROE8352_13_SE_WC10C.pdf in the Doc-Sharing folder titled My SQL Documents.
Please ensure that you can connect to MySQL/Omnymbus via the account your Professor has emailed to you. Please consult with the document titled MySQLOmnymbusSupport.docx ?located in the Doc-Sharing folder titled Omnymbus Tutorial Files for instructions on how to get help for any issues that you are having with the MySQL/Omnymbus Environment.
Listen
Deliverables
NOTE
Submit your assignment to the Dropbox, located at the top of this page. For instructions on how to use the Dropbox, read these step-by-step instructions.
(See the Syllabus section “Due Dates for Assignments & Exams” for due dates.)
Name your MySQL database Lab4_xxxx where xxxx is your userid. Create and save your MySQL database file. You will be required to submit a web-link to your index.php file, along with 6 php script files and a sql file that will be executed from the Omnymbus public Web page from your Omnymbus account. Please note that your php and sql files will be based upon the templates provided the zip file titled MIS582_Wk7_templates.zip located in the folder titled iLab Documents in Doc Sharing.
You will need to modify the following php scripts and sql file from the MIS582_Wk7_templates.zip file.
index.php
insert.php
insert_data.php
update.php
update_data.php
delete.php
MyAddressBook_CreateTable.sql
When you are done, submit your index.php link and zip file to the Week 7 Course Dropbox.
Listen
Required Software
Omnymbus – MySQL
Access the software at https://devry.edupe.net:8300.
Steps 1-7
Listen
Lab Steps
Listen
STEP 1: Review the Data Dictionary
Review the provided data dictionary below to understand the entity, attributes, and primary key that you will create in your MySQL database.
Table Name
ATTRIBUTE NAME
CONTENTS
TYPE
FORMAT
RANGE
REQUIRED
PK or FK
MyAddressbook
id
Contact ID Number
Auto-Increment
Int(3)
999
000-999
Y
PK
f_name
Contact First Name
VCHAR(25)
Xxxxxx
Y
L_name
Contact Last Name
VCHAR(25)
Xxxxxx
Y
ADDRESS
Contact Address
VCHAR(25)
Xxxxxx
Y
City
Contact City
VCHAR(25)
Xxxxxx
0-9
Y
State
Contact State
CHAR(2)
Xxxxxx
Y
zip
Contact Zip Code
NUMBER(5)
99999
Y
phone
Contact Phone
NUMBER(10)
9999999999
Y
Listen
STEP 2: Create Table, Insert Statement
Run MySQL via Omnymbus.
Modify the table creation script that will be used to create the database with the outlined attributes from the Data Dictionary.
Provide one Insert Statement that will add your contact information to the newly created table.
Save the file with a name containing Lab7_, your first initial, and your last name (e.g., Lab7_JSmith.sql).
Execute your script and ensure that the database is created.
Listen
STEP 3: Build Index PHP Page
Building Your index.php Web Page
In this step, you will complete your php script page to connect to the Lab7 database and display the MyAddressbook table on the Web page.
Complete the MySQL connection for the index.php page. Be sure to fill in appropriate host (127.0.0.1), username, password, and database information in the mysqli field.
Modify the provided php code to display each attribute of your MyAddressbook table. Note that initially, only 1 entry should be present in your table.
Save your index.php file in your public_html folder in Omnymbus file manager.
Please note that you will find your public_html folder down the path zdisk/USERID/public html
Direct your Web browser to your site url (ex. http://devry.edupe.net/~XXXX/index.php).
Note that you’ll replace XXXX with your Omnymbus login ID.
Ensure that your file executes and the database table displays on the screen.
If you have a correct connect command but you get the error message “MySQL ERROR 1045 (28000): Access denied for user” you will have to create a new password with the box “Change password in other modules?” checked.
The following image provides an example of how your index.php page should look with no entries provided in the database. Note: Feel free to add any additional formatting or images to your index.php page.
Listen
STEP 5: Build Update PHP Pages
Building Your update.php and update_data.php Pages
In this step, you will complete two php HTML pages. Your update.php page will provide a form for users to submit data to the database that will be updated. The update_data.php page will provide the actual queries in php to update the data in your database. When this process is complete, your page will redirect the user back to the index.php page.
Review the update_data.php page template.
You will need to modify the php code to add additional input forms for the user to enter all appropriate attributes that will need to be updated.
In the update_data.php file, ensure that your <form action> tag is set equal to update.php
Character data should have a character data type.
When the action is complete, your page should redirect back to index.php.
Listen
STEP 6: Build Delete PHP Page
Building Your delete.php Page
In this step, you will complete the delete.php page. Your delete.php page will process the query that will remove the necessary data for the database. When this process is complete, your page will redirect the user back to the index.php page.
Review the delete.php page template.
You will need to modify the php code to delete the provided entry based on the address id.
When the action is complete, your page should redirect back to index.php.
Listen
STEP 7: Test Links to Update, Delete, and Insert Pages. Submit Deliverables.
Finishing Your Web-Enabled Database
Before submitting, ensure that you have added at least 5 entries to your Addressbook database.
Ensure that all links for update, delete, and insert work properly.
When you are done, submit your web-link to your index.php (e.g. http://devry.edupe.net/~####/index.php), along with the zip file titled Lab4_FirstInitialLastName.zip which should contain your six php code pages and your database script.
Listen
Rubric
Points will be awarded according to the following rubrics.
10 points: Script and Table created for the MyAddressbook entity as described in the Data Dictionary.
10 points: index.php created that correctly displays the contents of the database.
10 points: insert.php and insert_data.php pages created that correctly add data to the database.
10 points: update.php and update_data.php pages created that correctly update the data in the database.
10 Points: delete.php page created that correctly removes an entry from the database.
For a more advanced optional lab experience you can add error checking and comments and better appearance to the code. Use Chapter 11 as a guide.
Week 2 course project
The Course Project will consist of three tasks, each worth 50 points due in Weeks 2, 4, and 6. Successful completion of the iLabs will help you in completing the project tasks.
Week 2: Task1: SQL Queries Using MySQL (50 Points)
Using the same tables that you created by running the script file provided in Doc Sharing for iLab1, write the following 10 queries each worth 5 points.
Name Task
Query1 Write a SQL statement to display the course numbers of classes taught by Hammett Glenn.
Query2 Write a SQL statement to display the course names of the courses taught by an instructor whose id is 415.
Query3 Write a query to display the name and office number of all
instructors who teach Psy101.(USE NATURAL JOIN)
Query4 Write a query to display the semester and the number of courses
offered in that semester. Display only the semesters that offer
more than five courses.
Query5 Write a SQL statement to display the name of each campus and the total number of rooms in that campus.
Query6 Write a SQL statement to display the list of instructors who are approved as well as those who are not approved. (OUTER JOIN)
Query7 Write a SQL statement to display the start date and start time of
all classes taught by instructor Hammett Glenn.
Query8 Write a SQL statement to display the number of students in each major with a status of failing.
Query9 Write a SQL statement to display the credit hours of all courses that Hammett Glenn is approved to teach.
Query10 Get the campus name and phone number of all rooms with
numbers greater than 25.
Deliverables
Create and save your SQL queries and script in a text file named Lastname_Task1_SQL_Script.sql.
Capture the output and paste it into Word Document. Save it as Lastname_Task1_SQL_Result.txt.
When you are done, submit your documents zipped together in a single file to the Week 2: Course Project Week 2 Task 1 Dropbox.
Rubrics
Queries that are correct will be awarded the number of points shown below:
4 points: Query 1
5 points: Query 2–9
6 points: Query 10
The following rubrics will be used for incorrect queries.
0 points: Query was not turned in with the assignment.
-4 points: Query will not run.
-3 points: Query runs but is incorrect because query required a WHERE clause to meet requirements which was not included.
-2 points: Query runs but is incorrect because the WHERE clause contained errors, gives popup for user input, or only meets partial requirements.
Tutorials to Consult With
M10C_KROE8352_13_SE_WC10C.pdf in the folder titled My SQL Documents in Doc Sharing for all things to do with MySQL including example SQL.
Login MySQL Omnymbus Environment.docx in the folder titled Omnymbus Tutorial Files in Doc Sharing for how to log into the Omnymbus Environment.
Creating a Database in MySQL Omnymbus Environment.docx in the folder titled Omnymbus Tutorial Files in Doc Sharing for how to create a Database in the Omnymbus Environment. Remember, all work must be done under a database you first create.
Running SQL Scripts in MySQL Omnymbus Environment.docx in the folder titled Omnymbus Tutorial Files in Doc Sharing for how to create and run your SQL Scripts.
Week 4 course project
MIS582 COURSE PROJECT
The Course Project will consist of three tasks, each worth 50 points due in Weeks 2, 4, and 6. Successful completion of the iLabs will help you in completing the project tasks.
Week 4: Task 2: Data Modeling Using Visio (50 Points)
NOTE: Visio 2010 is required for this project. Please ensure you can run Visio 2010 via Citrix or by having it installed on your computer. In case you are to run Visio 2013, there is a tutorial listed at the bottom of this document for that version of Visio, as well as a tutorial for Visio 2010.
PROJECT OVERVIEW:
Scenario and Summary
In this assignment, you will learn to create a physical database model in Visio from business requirements. To complete this assignment, you will need to be able to run Visio 2010, either through Citrix or installed on your workstation or laptop.
Deliverables
Name your Visio file as Lastname_Task2.vsd. Create and save your database model in your Visio file. When you are done, submit your document to the Week 4: Course Project Task 2 Dropbox.
STEP 1
Read the following business requirements closely to determine the entities and relationships needed to fulfill the requirements. The nouns in the paragraph will tell you the entities that will be needed. The adjectives that describe those nouns are the attributes of that entity. The verbs in the paragraph will help you determine the relationships between the entities.
ABC Company Order Inventory System
Database Requirements
The ABC company has many stores in many locations that are divided in regions. The company supplies products to these stores. For the purposes of this database you may think that it is an American company in terms of regions such as Midwest.
Each store is their customer/client. The company recognizes these stores by their store ID. They also keep track of the store name, address, and contact name.
Stores may place orders online, or by phone/fax. Each order must be uniquely identified by an order number. Each order has a date on which the order was made, a date when the order was shipped, an employee who took the order (or it could be an online order), and the mode of payment.
To make sure that the stores get their order on time, the stores are assigned to different warehouses in different regions. Currently, there is one warehouse for every region. Each warehouse is identified by its warehouse number. The company also tracks the address of the warehouse as well as a contact phone number.
There are five regions: West, Midwest, Southwest, Southeast, and Northwest. Each region is identified by its unique name and unique number.
Each warehouse holds many products for this company. A product may be found in many warehouses. The company keeps track of this inventory. At any point in time, the company must be able to find which warehouses carry this item, the quantity in stock, reorder point and whether this item is out of stock.
Each product has a unique id, a description, a price. Each product could be on many orders, and an order may have multiple products on it. The company needs to track what quantity was ordered for each product and the total price for those products.
Phone/Fax orders are processed by the employees of the company. The company keeps track of the employee’s id, first and last names, position, hire date, department they work for, their supervisor, and their salary.
STEP 2
• Run Visio 2010 either via Citrix or on your workstation.
• Click on the Software and Database template group in the main window.
• Double-click on the Database Model Diagram template to open a new file.
• Save the file with the name Lastname_Task2.vsd. You will need to click the computer icon in the Save As window to see the different drives. Be sure to save the file to a local drive so it will be on your workstation.
STEP 3
Add an entity for each entity you identified in the requirements.
• Drag the entity icon onto the drawing area in Visio.
• In the Database Properties window, add a physical name to identify it.
STEP 4
For each entity, create a list of attributes you think would be useful to describe the entity.
• Select an entity in the drawing area of Visio.
• In the Database Properties window, select the Columns category.
• Use the table to add your attributes to the selected entities.
• Select the primary key (PK).
STEP 5
Set the diagram to use crow’s feet notation.
• On the Database tab, in the Manage group, click Display Options.
• In the Database Document Option dialog, select the Relationship tab.
• Select the Crow’s Feet check box, and then click OK.
STEP 6
Draw relationships between your entities.
• Drag the relationship icon onto a blank part of the drawing area.
• Connect the two ends to each of the two entities in the relationship. The parent entity must have a PK defined. The entity will be outlined in bold red lines when it connects to one end of the relationship.
STEP 7
Set the cardinality of your relationships.
• Select a relationship line in the drawing area that is connecting two entities.
• In the Database Properties window, select the Miscellaneous category.
• Select the cardinality for the selected relationship.
STEP 8
When you are done, save the file on your local hard drive and upload it to the Week 4: Course Project Week 4 Task 2 Dropbox. Your file should have the following filename format: Lastname_Task2.vsd.
For instructions on how to copy files between the Citrix server and your local machine, watch the iLab tutorial, Copying Files From Citrix, located in the iLab menu tab under Course Home.
Rubrics
Points for will be awarded according to the following rubrics.
• 10 Points: Visio drawing: E-R model is provided as a Visio diagram.
• 10 Points: Entities: A minimum of six entities are present.
• 10 Points: Attributes: There are more than two attributes per entity; in most cases there should be several.
• 10 Points: Relationships: A minimum of six correct relationships are present.
• 10 Points: Correct cardinality is specified on each relationship with crow’s foot notation.
Tutorials to Consult With
DBP-e13-Appendix-F.pdf in the folder titled Visio Instructions Documents in Doc Sharing for how to use Visio 2013.
kroenke_dbp12e_appendix_f.pdf in the folder titled Visio Instructions Documents in Doc Sharing for how to use Visio 2010.
Week 6 course project
MIS582 COURSE PROJECT
The Course Project will consist of three tasks, each worth 50 points due in Weeks 2, 4, and 6. Successful completion of the iLabs will help you in completing the project tasks.
Week 6: Task 3: Database Construction Using MySQL (50 Points)
NOTE: MySQL is required for this project. Please ensure you can run MySQL via Omnymbus.
PROJECT OVERVIEW:
Scenario and Summary
In this assignment, you will create and populate a MySQL database based on the ERD you created in task2. Update the ERD you submitted for task2 with the corrections required by your instructor. To help you with this task, your instructor will provide you with the data dictionary of the database. This will provide you information on every table that you must create for the ABC Company database. Every entity can be found listed in the data dictionary along with the PK/FK information as well as the data types for the attributes. These data types are MySQL data types so they can go directly in the create table statements. Using the corrected ERD and the data dictionary provided, write the necessary MySQL statements to create the ABC company database. To complete this assignment, you will need to be able to run MySQL via Omnymbus.
Deliverables
1. Corrected ERD based on the instructor feedback and data dictionary. The data dictionary titled COURSE PROJECT Week6Task3DataDictonary.xlsx can be found in the folder titled Course Project Documents. Save your file as Lastname_Task3_revisedERD.vsd.
2. Script file as Lastname_task3.sql which includes all the drop, create, alter, and insert statements needed to create the ABC Company database.
3. Word document showing the run result of the script file saved as Lastname_task3Result.docx.
4. When you are done, upload a zip file containing the three files to the Week 6: Course Project Week 6 Task 3 Dropbox.
STEP 1
Revise the ERD you submitted for the previous task with the feedback provided by your instructor and the help of the given data dictionary document.
STEP 2
• Write create table statements for each table in the database in a file. Use the data types given in the data dictionary. Make sure every table has primary key(s), foreign keys if required, and not nulls if required. (Refer to data dictionary for this information)
• Save the file with the name Lastname_Task3.sql.
• Login to your MySQL account via Omnymbus.
• Create the database following the naming convention which is databaseName_loginId. You may use MIS582Project_####, replace the #### with your four-digit username.
• Click on the database name you just created.
• Run the script file by choosing Run SQL from file button. Select From uploaded file and find your file by clicking on the browse button. Once you find the file, click on the Execute button.
• If there are no errors, all tables will be successfully created. You may check them by adding SHOW TABLES at the end of your script file.
• If you have errors, correct those errors and execute the script again until it is error free.
• You may test each create table statement individually by clicking the Execute SQL button and pasting the create statement in the window.
• Be sure to drop all tables before running the script file to create all tables at once.
STEP 3
Adding data to your database.
• Write insert statements to successfully insert data into each table.
• A minimum of 3 rows are required for each table.
• Check the data in each table by running a SELECT * FROM table query.
• You may add these statements to your script file and run everything together.
Rubrics
Points for will be awarded according to the following rubrics.
• 10 Points: Visio drawing: Revised E-R model provided as a Visio diagram.
• 15 Points: CREATE STATEMENTS: Successfully creating all tables.
• 5 Points: PRIMARY KEYS: Correct primary keys created for all tables.
• 5 Points: FOREIGN KEYS: All required foreign keys created.
• 5 Points: ALTER STATEMENT: Any alter statements required.
• 10 Points: INSERT STATEMENTS: Minimum three rows per table found.
Tutorials to Consult With
M10C_KROE8352_13_SE_WC10C.pdf in the folder titled My SQL Documents in Doc Sharing for all things to do with MySQL including example SQL.
Login MySQL Omnymbus Environment.docx in the folder titled Omnymbus Tutorial Files in Doc Sharing for how to log into the Omnymbus Environment.
Creating a Database in MySQL Omnymbus Environment.docx in the folder titled Omnymbus Tutorial Files in Doc Sharing for how to create a Database the Omnymbus Environment. Remember, all work must be done under a database your first create.
Running SQL Scripts in MySQL Omnymbus Environment.docx in the folder titled Omnymbus Tutorial Files in Doc Sharing for how to create and run your SQL Scripts.
DBP-e13-Appendix-F.pdf in the folder titled Visio Instructions Documents in Doc Sharing for how to use Visio 2013.
kroenke_dbp12e_appendix_f.pdf in the folder titled Visio Instructions Documents in Doc Sharing for how to use Visio 2010.
COURSE PROJECT Week6Task3DataDictonary.xlsx in the folder titled Course Project Documents in Doc Sharing.
