SlideShare a Scribd company logo
CIS 336 Week 4 iLab 4 Devry University
Click this link to get the tutorial:
http://homeworkfox.com/tutorials/general-
questions/4152/cis-336-week-4-ilab-4-devry-university/
Lab 4 of 7: Building the Physical Model (28 points)

Submit your assignment to the Dropbox located on the silver tab at the top of this page. For
instructions on how to use the Dropbox, please click here.

(See Syllabus/"Due Dates for Assignments & Exams" for due dates.)

LABOVERVIEW

Scenario/Summary

Lab #4 will introduce the various aspects of the SQL select statement and the methods of
retrieving data from the database tables. The lab will utilize a set of tables found in the script file
(LeeBooks.sql) found in the Doc Sharing area of the website. You will need to download the file,
then run the script in your SQL*Plus session. These tables will be used for the remaining labs in
this class.

The SELECT statement is the primary means of extracting data from database tables, and allows
you to determine exactly which data you want to extract by means of different comparison
operators used in the WHERE clause. This includes the use of specific "wild card" characters
which allow you to search for character or number patterns within the data. You can also
perform mathematical expressions within the SELECT statement to create derived output. The
ORDER BY clause allows you to sort the output data in either ascending (the default) or
descending order. Lab #4 will explore all of these applications of the SELECT statement.

General Lab Information and Considerations

Each query in the script file you will create must be numbered (use - -1 comments for
numbering) and listed in order. The SQL for the following exercises should be written using
Notepad and run in SQL*Plus. Read each problem carefully and follow the directions as stated.

A Clean Script File:

A script file is meant to be like a program. The file can be run every time the code needs to be
executed without having to retype the code again each time. For this reason, it is important that
there are no errors in the code inside the file. You can go back and forth between Notepad and
Oracle when creating your script file to check your queries and verify if they work or not, but
you do not want to create your final output file until after you have verified that everything in
your script is correct by running it, in its entirety at least once and viewing the output. Once this
has been done, you can create your final output file, with echo on to create the document you can
turn in with your lab. Remember in using a spool session, you must type "SPOOL OFF" at the
SQL> prompt after your script stops spooling to capture all of your data!

Lab Do's and Don’t's

Do Not include the LEEBOOKS.SQL as part of your lab script.

Do use Notepad to write your query script file.

Do Not write your queries in Word.

Do test each query before moving on to the next.

Do Not include extra queries for a problem unless the problem explicitly asks for more than one
query.

Do test your queries before creating your final output file.

Do Not turn in a script file that has queries with errors.

Do number each query using - -1 comment notation.

Do Not start your query on the same line as the comment.

Do remember to check your final output and script file for accuracy.

Do Not turn in your lab without first checking your output file to verify that it is correct.

Things to keep in mind:

If you are not sure of the table names in your user schema, you can use the following select
statement to list them.

SELECT * FROM TAB;

If you want to know the name of the columns in a particular table, you can use the following
command to list them.

DESC

Making a script file containing a series of describe statements for each table and then spooling
the output will give you a listing of all the tables with column names.
Be sure to review and verify your final output when you are finished. DO NOT assume anything.

Write queries for each of the stated problems in the steps below that will return a result set of
data to satisfy the requirements. When finished, your script file should have a total of 13 queries
and your resulting output file should show both the query and result set for each.

Deliverables

The deliverable for this lab will include:

Your script file with the 13 queries in it. Be sure your name, course number, and lab number are
in a comment area at the top of your file.

An output file created using SET ECHO ON showing both the SQL code and the results.

Both documents are to be zipped into a single file before submitting to the iLab Dropbox for
Week 4.

LABSTEPS

STEP 1:

Using the BOOKS table, write a query that will list the categories for the books in inventory. List
each category only once in your result set.

STEP 2:

Using the BOOKS table, write a query that will list the title and publisher ID for each book in the
table. Use the column heading of "Publisher ID" for the pubid field.

STEP 3:

Using the BOOKS table, write a query that will list the book title, retail price, and the amount of
markup for each book. The amount of markup is the retail price minus the cost. Use the column
heading “Price Markup” for the arithmetic expression column.

STEP 4:

Using the BOOK_CUSTOMER table, write a query that will list the customer’s first name, last
name, and city for those customers living in zip code 31206.

STEP 5:

Using the BOOK_ORDER table, write a query that will list everything about the orders placed
prior to April 2, 2009.
STEP 6:

Using the BOOK_ORDER table, write a query that will list everything about the orders that have
not been shipped yet.

STEP 7:

Using the BOOK_CUSTOMER table, write a query using the AND and OR operators that will
list the customer information for those customers living in either Florida or New Jersey who
have not been referred by another customer.

STEP 8:

Using the BOOKS table, write a query that will list all information about those books that are not
computer books and do not cost more than $30.00 retail.

STEP 9:

Using the AUTHOR table, write a query that will list all information about authors whose first
name ends with an “A”. Put the results in descending order of last name, and then ascending
order by first name. This should be done using a single query.

STEP 10:

Using the BOOK_ORDER table, write a query using the > and < operators that will list the
orders that were placed between April 1, 2009 and April 4, 2009. Only show the orders for April
2nd and 3rd in your result set.

STEP 11:

Using the BOOK_ORDER table, write a query that will list the orders that were placed between
April 2, 2009 and April 4, 2009 including those placed on the 2nd and 4th. Use a different
approach (operator) in writing this query than used in the query for #10, that is, do not use > and
< signs in your query.

STEP 12:

Using the BOOKS table, write a query that will list the book title, publisher ID, and published
date for all books that were published by publisher 4 or after January 1, 2001. Order the results in
ascending order by publisher ID and give the publish date and publisher ID columns meaningful
titles.

STEP 13:

Many organizations use percentage of markup (e.g., profit margin) when analyzing financial
data. To determine the percentage of markup for a particular item, simply subtract the cost for
the item from the retail price to obtain the dollar amount of profit, and then divide the profit by
the cost of the item. The resulting solution is then multiplied by 100 to determine the percent of
markup. Using a SELECT statement, display the title of each book and its percent of markup.
For the column displaying the percent of markup, use “Markup %” as the column heading.

This is the end of lab #4

More Related Content

DOCX
Cis336 week 5 i lab5
DOCX
Cis 336 cis336 week 5 i lab 5 devry university
DOCX
Cis 336 ilab 5 of 7
DOC
Cis336 week 5 i lab 5
DOCX
CIS/336 ilab 5 of 7
DOCX
How to create lists in millennium july 2011
PPT
Generate Excel documents with Rational Publishing Engine 1.1.2 and Reporting ...
PPTX
RefWorks, Intro
Cis336 week 5 i lab5
Cis 336 cis336 week 5 i lab 5 devry university
Cis 336 ilab 5 of 7
Cis336 week 5 i lab 5
CIS/336 ilab 5 of 7
How to create lists in millennium july 2011
Generate Excel documents with Rational Publishing Engine 1.1.2 and Reporting ...
RefWorks, Intro

What's hot (10)

PPTX
RefWorks How to version 1
PPTX
RefWorks Basics
PDF
DOCX
Getting Started with SharePoint Status Indicators - EPC Group
PPT
EndNote X2 Workshop for FASS Graduate Students
PPTX
Phpmyadmin administer mysql
PPT
Abap
PPT
Ref Works Training Staff1
PPT
6 ref works 2.0 search online databases in refworks 2.0
 
PPT
Oracle 10g Forms Lesson 9
RefWorks How to version 1
RefWorks Basics
Getting Started with SharePoint Status Indicators - EPC Group
EndNote X2 Workshop for FASS Graduate Students
Phpmyadmin administer mysql
Abap
Ref Works Training Staff1
6 ref works 2.0 search online databases in refworks 2.0
 
Oracle 10g Forms Lesson 9
Ad

Viewers also liked (20)

PDF
Προκαταρκτικό Πρόγραμμα Ημερίδας
DOCX
Unit 73 ig1 assignment computer game audio cut sequence production 2013_y2
PPT
Programma in italia
DOC
Apa itu artritis gout
PPTX
Search engines
PDF
Ο Τοκετός Σήμερα. Πού και Πώς;
PPTX
Audience Research Questions - Results
PDF
Wagon tippler
PPTX
DJ Mag/Mixmag Case Studies
PPTX
Bulgaria
PPT
PPTX
Students Perceptions of a Grading Contract Model
PDF
WJPR 4588
PPS
Project reclamation
ODP
Mauçapémasos le village
ODP
L'évolution de la langue française
PPT
Chimney one go
PPT
Le Pluriel Des Noms
PPTX
Presentation on well point system
PPTX
Thermal Power Plant Basic to Knowledge
Προκαταρκτικό Πρόγραμμα Ημερίδας
Unit 73 ig1 assignment computer game audio cut sequence production 2013_y2
Programma in italia
Apa itu artritis gout
Search engines
Ο Τοκετός Σήμερα. Πού και Πώς;
Audience Research Questions - Results
Wagon tippler
DJ Mag/Mixmag Case Studies
Bulgaria
Students Perceptions of a Grading Contract Model
WJPR 4588
Project reclamation
Mauçapémasos le village
L'évolution de la langue française
Chimney one go
Le Pluriel Des Noms
Presentation on well point system
Thermal Power Plant Basic to Knowledge
Ad

Similar to Cis336 week 4 i lab 4 (20)

DOCX
Cis336 week 5 i lab5
DOCX
Cis336 week 5 i lab5
DOCX
Cis336 week 5 i lab5
DOCX
Cis336 week 5 i lab5
DOCX
Cis336 week 5 i lab5
DOC
Cis336 week 5 i lab 5
DOC
Cis336 week 5 i lab 5
DOC
Cis336 week 5 i lab 5
DOC
Cis336 week 7 i lab 7
DOCX
ECET 450 Laboratory 2Lab 2 involves two parts.Part A involv.docx
PPTX
Using macros.pptx
PDF
POS/409 ENTIRE CLASS UOP TUTORIALS
PPT
Bis 345-week-4-i lab-new
DOCX
CIS 336 (DEVRY) Entire Course NEW
PDF
Illustrated Microsoft Office 365 and Office 2016 Fundamentals 1st Edition Hun...
PPTX
Luke Cushanick Admin Tips and Tricks for Salesforce Trailblazer Community Chr...
DOCX
BUSI 301 Book Review RubricScoreCommentsResearch 25.docx
DOCX
ECET 450 Laboratory 2Part BPurposeThis laborato.docx
PDF
Illustrated Microsoft Office 365 and Office 2016 Fundamentals 1st Edition Hun...
PPTX
Advanced Spreadsheet Skills-1.pptx
Cis336 week 5 i lab5
Cis336 week 5 i lab5
Cis336 week 5 i lab5
Cis336 week 5 i lab5
Cis336 week 5 i lab5
Cis336 week 5 i lab 5
Cis336 week 5 i lab 5
Cis336 week 5 i lab 5
Cis336 week 7 i lab 7
ECET 450 Laboratory 2Lab 2 involves two parts.Part A involv.docx
Using macros.pptx
POS/409 ENTIRE CLASS UOP TUTORIALS
Bis 345-week-4-i lab-new
CIS 336 (DEVRY) Entire Course NEW
Illustrated Microsoft Office 365 and Office 2016 Fundamentals 1st Edition Hun...
Luke Cushanick Admin Tips and Tricks for Salesforce Trailblazer Community Chr...
BUSI 301 Book Review RubricScoreCommentsResearch 25.docx
ECET 450 Laboratory 2Part BPurposeThis laborato.docx
Illustrated Microsoft Office 365 and Office 2016 Fundamentals 1st Edition Hun...
Advanced Spreadsheet Skills-1.pptx

More from 7Fase1 (10)

DOC
Doc1
DOC
Doc1
DOC
Doc1
DOC
Cis336 week 2 i lab 2
DOC
Cis336 week 1 i lab 1
DOC
Cis336 all i labs week 1 to week 7 devry university
DOC
Cmgt410
DOC
Cmgt 410 week 4 individual assignment project controls
DOC
Cmgt 410 week 2 individual assignment project task
DOC
Doc1
Doc1
Doc1
Doc1
Cis336 week 2 i lab 2
Cis336 week 1 i lab 1
Cis336 all i labs week 1 to week 7 devry university
Cmgt410
Cmgt 410 week 4 individual assignment project controls
Cmgt 410 week 2 individual assignment project task
Doc1

Recently uploaded (20)

PDF
Machine learning based COVID-19 study performance prediction
PDF
cuic standard and advanced reporting.pdf
PDF
Electronic commerce courselecture one. Pdf
PDF
Architecting across the Boundaries of two Complex Domains - Healthcare & Tech...
PPTX
KOM of Painting work and Equipment Insulation REV00 update 25-dec.pptx
PDF
Blue Purple Modern Animated Computer Science Presentation.pdf.pdf
PPTX
1. Introduction to Computer Programming.pptx
PPTX
Spectroscopy.pptx food analysis technology
PPTX
SOPHOS-XG Firewall Administrator PPT.pptx
PPTX
MYSQL Presentation for SQL database connectivity
PDF
Dropbox Q2 2025 Financial Results & Investor Presentation
PDF
gpt5_lecture_notes_comprehensive_20250812015547.pdf
PDF
Build a system with the filesystem maintained by OSTree @ COSCUP 2025
PDF
Building Integrated photovoltaic BIPV_UPV.pdf
PDF
Accuracy of neural networks in brain wave diagnosis of schizophrenia
PDF
A comparative analysis of optical character recognition models for extracting...
PDF
7 ChatGPT Prompts to Help You Define Your Ideal Customer Profile.pdf
PPTX
20250228 LYD VKU AI Blended-Learning.pptx
PDF
Assigned Numbers - 2025 - Bluetooth® Document
PPT
Teaching material agriculture food technology
Machine learning based COVID-19 study performance prediction
cuic standard and advanced reporting.pdf
Electronic commerce courselecture one. Pdf
Architecting across the Boundaries of two Complex Domains - Healthcare & Tech...
KOM of Painting work and Equipment Insulation REV00 update 25-dec.pptx
Blue Purple Modern Animated Computer Science Presentation.pdf.pdf
1. Introduction to Computer Programming.pptx
Spectroscopy.pptx food analysis technology
SOPHOS-XG Firewall Administrator PPT.pptx
MYSQL Presentation for SQL database connectivity
Dropbox Q2 2025 Financial Results & Investor Presentation
gpt5_lecture_notes_comprehensive_20250812015547.pdf
Build a system with the filesystem maintained by OSTree @ COSCUP 2025
Building Integrated photovoltaic BIPV_UPV.pdf
Accuracy of neural networks in brain wave diagnosis of schizophrenia
A comparative analysis of optical character recognition models for extracting...
7 ChatGPT Prompts to Help You Define Your Ideal Customer Profile.pdf
20250228 LYD VKU AI Blended-Learning.pptx
Assigned Numbers - 2025 - Bluetooth® Document
Teaching material agriculture food technology

Cis336 week 4 i lab 4

  • 1. CIS 336 Week 4 iLab 4 Devry University Click this link to get the tutorial: http://homeworkfox.com/tutorials/general- questions/4152/cis-336-week-4-ilab-4-devry-university/ Lab 4 of 7: Building the Physical Model (28 points) Submit your assignment to the Dropbox located on the silver tab at the top of this page. For instructions on how to use the Dropbox, please click here. (See Syllabus/"Due Dates for Assignments & Exams" for due dates.) LABOVERVIEW Scenario/Summary Lab #4 will introduce the various aspects of the SQL select statement and the methods of retrieving data from the database tables. The lab will utilize a set of tables found in the script file (LeeBooks.sql) found in the Doc Sharing area of the website. You will need to download the file, then run the script in your SQL*Plus session. These tables will be used for the remaining labs in this class. The SELECT statement is the primary means of extracting data from database tables, and allows you to determine exactly which data you want to extract by means of different comparison operators used in the WHERE clause. This includes the use of specific "wild card" characters which allow you to search for character or number patterns within the data. You can also perform mathematical expressions within the SELECT statement to create derived output. The ORDER BY clause allows you to sort the output data in either ascending (the default) or descending order. Lab #4 will explore all of these applications of the SELECT statement. General Lab Information and Considerations Each query in the script file you will create must be numbered (use - -1 comments for numbering) and listed in order. The SQL for the following exercises should be written using Notepad and run in SQL*Plus. Read each problem carefully and follow the directions as stated. A Clean Script File: A script file is meant to be like a program. The file can be run every time the code needs to be executed without having to retype the code again each time. For this reason, it is important that there are no errors in the code inside the file. You can go back and forth between Notepad and Oracle when creating your script file to check your queries and verify if they work or not, but
  • 2. you do not want to create your final output file until after you have verified that everything in your script is correct by running it, in its entirety at least once and viewing the output. Once this has been done, you can create your final output file, with echo on to create the document you can turn in with your lab. Remember in using a spool session, you must type "SPOOL OFF" at the SQL> prompt after your script stops spooling to capture all of your data! Lab Do's and Don’t's Do Not include the LEEBOOKS.SQL as part of your lab script. Do use Notepad to write your query script file. Do Not write your queries in Word. Do test each query before moving on to the next. Do Not include extra queries for a problem unless the problem explicitly asks for more than one query. Do test your queries before creating your final output file. Do Not turn in a script file that has queries with errors. Do number each query using - -1 comment notation. Do Not start your query on the same line as the comment. Do remember to check your final output and script file for accuracy. Do Not turn in your lab without first checking your output file to verify that it is correct. Things to keep in mind: If you are not sure of the table names in your user schema, you can use the following select statement to list them. SELECT * FROM TAB; If you want to know the name of the columns in a particular table, you can use the following command to list them. DESC Making a script file containing a series of describe statements for each table and then spooling the output will give you a listing of all the tables with column names.
  • 3. Be sure to review and verify your final output when you are finished. DO NOT assume anything. Write queries for each of the stated problems in the steps below that will return a result set of data to satisfy the requirements. When finished, your script file should have a total of 13 queries and your resulting output file should show both the query and result set for each. Deliverables The deliverable for this lab will include: Your script file with the 13 queries in it. Be sure your name, course number, and lab number are in a comment area at the top of your file. An output file created using SET ECHO ON showing both the SQL code and the results. Both documents are to be zipped into a single file before submitting to the iLab Dropbox for Week 4. LABSTEPS STEP 1: Using the BOOKS table, write a query that will list the categories for the books in inventory. List each category only once in your result set. STEP 2: Using the BOOKS table, write a query that will list the title and publisher ID for each book in the table. Use the column heading of "Publisher ID" for the pubid field. STEP 3: Using the BOOKS table, write a query that will list the book title, retail price, and the amount of markup for each book. The amount of markup is the retail price minus the cost. Use the column heading “Price Markup” for the arithmetic expression column. STEP 4: Using the BOOK_CUSTOMER table, write a query that will list the customer’s first name, last name, and city for those customers living in zip code 31206. STEP 5: Using the BOOK_ORDER table, write a query that will list everything about the orders placed prior to April 2, 2009.
  • 4. STEP 6: Using the BOOK_ORDER table, write a query that will list everything about the orders that have not been shipped yet. STEP 7: Using the BOOK_CUSTOMER table, write a query using the AND and OR operators that will list the customer information for those customers living in either Florida or New Jersey who have not been referred by another customer. STEP 8: Using the BOOKS table, write a query that will list all information about those books that are not computer books and do not cost more than $30.00 retail. STEP 9: Using the AUTHOR table, write a query that will list all information about authors whose first name ends with an “A”. Put the results in descending order of last name, and then ascending order by first name. This should be done using a single query. STEP 10: Using the BOOK_ORDER table, write a query using the > and < operators that will list the orders that were placed between April 1, 2009 and April 4, 2009. Only show the orders for April 2nd and 3rd in your result set. STEP 11: Using the BOOK_ORDER table, write a query that will list the orders that were placed between April 2, 2009 and April 4, 2009 including those placed on the 2nd and 4th. Use a different approach (operator) in writing this query than used in the query for #10, that is, do not use > and < signs in your query. STEP 12: Using the BOOKS table, write a query that will list the book title, publisher ID, and published date for all books that were published by publisher 4 or after January 1, 2001. Order the results in ascending order by publisher ID and give the publish date and publisher ID columns meaningful titles. STEP 13: Many organizations use percentage of markup (e.g., profit margin) when analyzing financial data. To determine the percentage of markup for a particular item, simply subtract the cost for
  • 5. the item from the retail price to obtain the dollar amount of profit, and then divide the profit by the cost of the item. The resulting solution is then multiplied by 100 to determine the percent of markup. Using a SELECT statement, display the title of each book and its percent of markup. For the column displaying the percent of markup, use “Markup %” as the column heading. This is the end of lab #4