SlideShare a Scribd company logo
1 of 4
CIS 336 Week 7 iLab 7 Devry University
Click this link to get the tutorial:
http://homeworkfox.com/tutorials/general-
questions/4157/cis-336-week-7-ilab-7-devry-university/
LABOVERVIEW

Scenario/Summary

There is a lot more to a database than just tables and the data in them. A very important part of
database security has to do with using and understanding Database Views. Being able to enhance
the efficiency of the database tables by using additional indexes is also a very important aspect of
database development. Finally, being able to create and use Database Sequences to automate
some of the sequential processes in the database can not only save time but improve efficiency.
In Lab 7, you will have a chance to work with all three of these areas.

General Lab Information and Considerations

This lab will utilize the same set of tables found in the script file (LeeBooks.SQL) that were used
for Labs 4 through 6.

Each query in the script file you will create, must be numbered (use either –1 or REM 1
comments for numbering) and 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.
However, 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 scrip file that has queries with errors.

Do number each query using either --1 or REM 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 resulting output file should show both the
query statement and result set for each query.

Deliverables

The deliverable for this lab will include:
Your script file with the seven queries and oneexplanation 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. Be sure that you include your
answer to question #3 as a comment in this file.

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



LABSTEPS



STEP 1:

Create a simple view named CUST_VIEW using the book_customer table that will display the
customer number, first and last name, and the state for every customer currently in the database.
Now insert the following data into the book_customer TABLE using an INSERT statement. (Do
not use the View for this insert.) CUSTOMERID - 1021, FIRSTNAME – EDWARD,
LASTNAME – BLAKE, STATE – TX. Now query your view and display the new record.

STEP 2:

Create a complex view named CUST_ORDER that will list the customer number, last name, and
state from the BOOK_CUSTOMER table, in addition to the order number and order date from
the BOOK_ORDER table. Insert the following data into this view (use the view for the insert
statement): CUSTOMERID - 1022, LASTNAME – smith, STATE – KS, ORDERID - 1021, and
ORDERDATE – 10-OCT-2004.

STEP 3:

In your own words, explain why the insert statement for the view you created in Step 2 did not
work.

STEP 4:

Create a sequence that can be used to assign a publisher ID number to a new publisher. Define
the sequence to start with seven, increment by two, and stop at 1000. Name the sequence
PUBNUM_SEQ.

STEP 5:

Insert two new publishers into the PUBLISHER table, one named Double Week with a contact
name of Jennifer Close at 800-959-6321, and the second one named Specific House with a
contact name of Freddie Farmore at 866-825-3200. Use your new sequence to create the PUBID
for each record. Now, query your PUBLISHER table to see your two new records.

STEP 6:

Using a single query, query the PUBNUM_SEQ to determine what both the current sequence
number is and the next sequence number will be.

STEP 7:

Create a unique index on the combined columns ORDERID and CUSTOMERID in the
BOOK_ORDER table. Give the index a name of BOOK_ORDER_IDX.

STEP 8:

Determine how many objects you currently own in your schema by querying the
USER_OBJECTS view in the Data Dictionary. Your result set should list the different object
types that you find and include a count by object type.

More Related Content

What's hot

Data Warehouse and Business Intelligence - Recipe 7 - A messaging system for ...
Data Warehouse and Business Intelligence - Recipe 7 - A messaging system for ...Data Warehouse and Business Intelligence - Recipe 7 - A messaging system for ...
Data Warehouse and Business Intelligence - Recipe 7 - A messaging system for ...Massimo Cenci
 
Hyperion Essbase integration with ODI
Hyperion Essbase integration with ODIHyperion Essbase integration with ODI
Hyperion Essbase integration with ODIDharmaraj Borse
 
R Class: Set up Social Media API
R Class: Set up Social Media APIR Class: Set up Social Media API
R Class: Set up Social Media APIWeiai Wayne Xu
 
Curiosity Bits Tutorial: Mining Twitter User Profile on Python V2
Curiosity Bits Tutorial: Mining Twitter User Profile on Python V2Curiosity Bits Tutorial: Mining Twitter User Profile on Python V2
Curiosity Bits Tutorial: Mining Twitter User Profile on Python V2Weiai Wayne Xu
 
Dangerous Google searching for secrets
Dangerous Google searching for secretsDangerous Google searching for secrets
Dangerous Google searching for secretsPim Piepers
 

What's hot (8)

Data Warehouse and Business Intelligence - Recipe 7 - A messaging system for ...
Data Warehouse and Business Intelligence - Recipe 7 - A messaging system for ...Data Warehouse and Business Intelligence - Recipe 7 - A messaging system for ...
Data Warehouse and Business Intelligence - Recipe 7 - A messaging system for ...
 
Hyperion Essbase integration with ODI
Hyperion Essbase integration with ODIHyperion Essbase integration with ODI
Hyperion Essbase integration with ODI
 
R Class: Set up Social Media API
R Class: Set up Social Media APIR Class: Set up Social Media API
R Class: Set up Social Media API
 
Easy Program with AppInventor and MySQL
Easy Program with AppInventor and MySQLEasy Program with AppInventor and MySQL
Easy Program with AppInventor and MySQL
 
Rail3 intro 29th_sep_surendran
Rail3 intro 29th_sep_surendranRail3 intro 29th_sep_surendran
Rail3 intro 29th_sep_surendran
 
Project eprom progr
Project eprom progrProject eprom progr
Project eprom progr
 
Curiosity Bits Tutorial: Mining Twitter User Profile on Python V2
Curiosity Bits Tutorial: Mining Twitter User Profile on Python V2Curiosity Bits Tutorial: Mining Twitter User Profile on Python V2
Curiosity Bits Tutorial: Mining Twitter User Profile on Python V2
 
Dangerous Google searching for secrets
Dangerous Google searching for secretsDangerous Google searching for secrets
Dangerous Google searching for secrets
 

Viewers also liked

Cis336 all i labs week 1 to week 7 devry university
Cis336 all i labs week 1 to week 7 devry universityCis336 all i labs week 1 to week 7 devry university
Cis336 all i labs week 1 to week 7 devry universityCIS339
 
Durutta reading
Durutta readingDurutta reading
Durutta readingrsisco
 
Deferred action presentaion (4)
Deferred action presentaion (4)Deferred action presentaion (4)
Deferred action presentaion (4)cmafuso
 
Project#2
Project#2Project#2
Project#2zhuyian
 
Tugas 3 fisika teknik
Tugas 3 fisika teknikTugas 3 fisika teknik
Tugas 3 fisika teknikFhr Amal
 
Cis336 week 4 i lab 4
Cis336 week 4 i lab 4Cis336 week 4 i lab 4
Cis336 week 4 i lab 4CIS339
 

Viewers also liked (6)

Cis336 all i labs week 1 to week 7 devry university
Cis336 all i labs week 1 to week 7 devry universityCis336 all i labs week 1 to week 7 devry university
Cis336 all i labs week 1 to week 7 devry university
 
Durutta reading
Durutta readingDurutta reading
Durutta reading
 
Deferred action presentaion (4)
Deferred action presentaion (4)Deferred action presentaion (4)
Deferred action presentaion (4)
 
Project#2
Project#2Project#2
Project#2
 
Tugas 3 fisika teknik
Tugas 3 fisika teknikTugas 3 fisika teknik
Tugas 3 fisika teknik
 
Cis336 week 4 i lab 4
Cis336 week 4 i lab 4Cis336 week 4 i lab 4
Cis336 week 4 i lab 4
 

Similar to Cis336 week 7 i lab 7

Cis336 week 5 i lab5
Cis336 week 5 i lab5Cis336 week 5 i lab5
Cis336 week 5 i lab5wefsfewf
 
Cis336 week 5 i lab5
Cis336 week 5 i lab5Cis336 week 5 i lab5
Cis336 week 5 i lab5xcvxbdfbdf
 
Cis336 week 5 i lab 5
Cis336 week 5 i lab 5Cis336 week 5 i lab 5
Cis336 week 5 i lab 5CIS339
 
Cis336 week 5 i lab 5
Cis336 week 5 i lab 5Cis336 week 5 i lab 5
Cis336 week 5 i lab 5jackiechaner
 
Cis336 week 4 i lab 4
Cis336 week 4 i lab 4Cis336 week 4 i lab 4
Cis336 week 4 i lab 4jackiechaner
 
ECET 450 Laboratory 2Lab 2 involves two parts.Part A involv.docx
ECET 450 Laboratory 2Lab 2 involves two parts.Part A involv.docxECET 450 Laboratory 2Lab 2 involves two parts.Part A involv.docx
ECET 450 Laboratory 2Lab 2 involves two parts.Part A involv.docxjenkinsmandie
 
CIS 336 (DEVRY) Entire Course NEW
CIS 336 (DEVRY) Entire Course NEWCIS 336 (DEVRY) Entire Course NEW
CIS 336 (DEVRY) Entire Course NEWshyamuopuop
 
ECET 450 Laboratory 2Part BPurposeThis laborato.docx
ECET 450 Laboratory 2Part BPurposeThis laborato.docxECET 450 Laboratory 2Part BPurposeThis laborato.docx
ECET 450 Laboratory 2Part BPurposeThis laborato.docxjack60216
 
Page 3 of 11Delete this text and type your name here This .docx
Page 3 of 11Delete this text and type your name here This .docxPage 3 of 11Delete this text and type your name here This .docx
Page 3 of 11Delete this text and type your name here This .docxalfred4lewis58146
 
Based on the materials for this week, create your own unique Datab.docx
Based on the materials for this week, create your own unique Datab.docxBased on the materials for this week, create your own unique Datab.docx
Based on the materials for this week, create your own unique Datab.docxJASS44
 
Waiting too long for Excel's VLOOKUP? Use SQLite for simple data analysis!
Waiting too long for Excel's VLOOKUP? Use SQLite for simple data analysis!Waiting too long for Excel's VLOOKUP? Use SQLite for simple data analysis!
Waiting too long for Excel's VLOOKUP? Use SQLite for simple data analysis!Amanda Lam
 
Comp 220 ilab 6 of 7
Comp 220 ilab 6 of 7Comp 220 ilab 6 of 7
Comp 220 ilab 6 of 7ashhadiqbal
 

Similar to Cis336 week 7 i lab 7 (20)

Cis336 week 5 i lab5
Cis336 week 5 i lab5Cis336 week 5 i lab5
Cis336 week 5 i lab5
 
Cis336 week 5 i lab5
Cis336 week 5 i lab5Cis336 week 5 i lab5
Cis336 week 5 i lab5
 
Cis336 week 5 i lab5
Cis336 week 5 i lab5Cis336 week 5 i lab5
Cis336 week 5 i lab5
 
Cis336 week 5 i lab5
Cis336 week 5 i lab5Cis336 week 5 i lab5
Cis336 week 5 i lab5
 
Cis336 week 5 i lab5
Cis336 week 5 i lab5Cis336 week 5 i lab5
Cis336 week 5 i lab5
 
Cis336 week 5 i lab 5
Cis336 week 5 i lab 5Cis336 week 5 i lab 5
Cis336 week 5 i lab 5
 
Cis336 week 5 i lab 5
Cis336 week 5 i lab 5Cis336 week 5 i lab 5
Cis336 week 5 i lab 5
 
Cis336 week 5 i lab 5
Cis336 week 5 i lab 5Cis336 week 5 i lab 5
Cis336 week 5 i lab 5
 
Cis336 week 4 i lab 4
Cis336 week 4 i lab 4Cis336 week 4 i lab 4
Cis336 week 4 i lab 4
 
Cis336 week 4 i lab 4
Cis336 week 4 i lab 4Cis336 week 4 i lab 4
Cis336 week 4 i lab 4
 
ECET 450 Laboratory 2Lab 2 involves two parts.Part A involv.docx
ECET 450 Laboratory 2Lab 2 involves two parts.Part A involv.docxECET 450 Laboratory 2Lab 2 involves two parts.Part A involv.docx
ECET 450 Laboratory 2Lab 2 involves two parts.Part A involv.docx
 
CIS 336 (DEVRY) Entire Course NEW
CIS 336 (DEVRY) Entire Course NEWCIS 336 (DEVRY) Entire Course NEW
CIS 336 (DEVRY) Entire Course NEW
 
ECET 450 Laboratory 2Part BPurposeThis laborato.docx
ECET 450 Laboratory 2Part BPurposeThis laborato.docxECET 450 Laboratory 2Part BPurposeThis laborato.docx
ECET 450 Laboratory 2Part BPurposeThis laborato.docx
 
Pl lab solution
Pl lab solutionPl lab solution
Pl lab solution
 
Dbm 438 week 6 ilab
Dbm 438 week 6 ilabDbm 438 week 6 ilab
Dbm 438 week 6 ilab
 
Page 3 of 11Delete this text and type your name here This .docx
Page 3 of 11Delete this text and type your name here This .docxPage 3 of 11Delete this text and type your name here This .docx
Page 3 of 11Delete this text and type your name here This .docx
 
Sql Server 2014 Course Content
Sql Server 2014 Course ContentSql Server 2014 Course Content
Sql Server 2014 Course Content
 
Based on the materials for this week, create your own unique Datab.docx
Based on the materials for this week, create your own unique Datab.docxBased on the materials for this week, create your own unique Datab.docx
Based on the materials for this week, create your own unique Datab.docx
 
Waiting too long for Excel's VLOOKUP? Use SQLite for simple data analysis!
Waiting too long for Excel's VLOOKUP? Use SQLite for simple data analysis!Waiting too long for Excel's VLOOKUP? Use SQLite for simple data analysis!
Waiting too long for Excel's VLOOKUP? Use SQLite for simple data analysis!
 
Comp 220 ilab 6 of 7
Comp 220 ilab 6 of 7Comp 220 ilab 6 of 7
Comp 220 ilab 6 of 7
 

More from CIS339

Cis336 week 2 i lab 2
Cis336 week 2 i lab 2Cis336 week 2 i lab 2
Cis336 week 2 i lab 2CIS339
 
Cis336 week 1 i lab 1
Cis336 week 1 i lab 1Cis336 week 1 i lab 1
Cis336 week 1 i lab 1CIS339
 
Cis336 week 1 i lab 1
Cis336 week 1 i lab 1Cis336 week 1 i lab 1
Cis336 week 1 i lab 1CIS339
 
Acc 460 final exam
Acc 460 final examAcc 460 final exam
Acc 460 final examCIS339
 
Cis336 week 1 i lab 1
Cis336 week 1 i lab 1Cis336 week 1 i lab 1
Cis336 week 1 i lab 1CIS339
 
Cis336 week 1 i lab 1
Cis336 week 1 i lab 1Cis336 week 1 i lab 1
Cis336 week 1 i lab 1CIS339
 
Cis336 week 2 i lab 2
Cis336 week 2 i lab 2Cis336 week 2 i lab 2
Cis336 week 2 i lab 2CIS339
 
Cis336 week 1 i lab 1
Cis336 week 1 i lab 1Cis336 week 1 i lab 1
Cis336 week 1 i lab 1CIS339
 
Cis336 week 1 i lab 1
Cis336 week 1 i lab 1Cis336 week 1 i lab 1
Cis336 week 1 i lab 1CIS339
 

More from CIS339 (9)

Cis336 week 2 i lab 2
Cis336 week 2 i lab 2Cis336 week 2 i lab 2
Cis336 week 2 i lab 2
 
Cis336 week 1 i lab 1
Cis336 week 1 i lab 1Cis336 week 1 i lab 1
Cis336 week 1 i lab 1
 
Cis336 week 1 i lab 1
Cis336 week 1 i lab 1Cis336 week 1 i lab 1
Cis336 week 1 i lab 1
 
Acc 460 final exam
Acc 460 final examAcc 460 final exam
Acc 460 final exam
 
Cis336 week 1 i lab 1
Cis336 week 1 i lab 1Cis336 week 1 i lab 1
Cis336 week 1 i lab 1
 
Cis336 week 1 i lab 1
Cis336 week 1 i lab 1Cis336 week 1 i lab 1
Cis336 week 1 i lab 1
 
Cis336 week 2 i lab 2
Cis336 week 2 i lab 2Cis336 week 2 i lab 2
Cis336 week 2 i lab 2
 
Cis336 week 1 i lab 1
Cis336 week 1 i lab 1Cis336 week 1 i lab 1
Cis336 week 1 i lab 1
 
Cis336 week 1 i lab 1
Cis336 week 1 i lab 1Cis336 week 1 i lab 1
Cis336 week 1 i lab 1
 

Recently uploaded

Tata AIG General Insurance Company - Insurer Innovation Award 2024
Tata AIG General Insurance Company - Insurer Innovation Award 2024Tata AIG General Insurance Company - Insurer Innovation Award 2024
Tata AIG General Insurance Company - Insurer Innovation Award 2024The Digital Insurer
 
How to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerHow to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerThousandEyes
 
What Are The Drone Anti-jamming Systems Technology?
What Are The Drone Anti-jamming Systems Technology?What Are The Drone Anti-jamming Systems Technology?
What Are The Drone Anti-jamming Systems Technology?Antenna Manufacturer Coco
 
A Call to Action for Generative AI in 2024
A Call to Action for Generative AI in 2024A Call to Action for Generative AI in 2024
A Call to Action for Generative AI in 2024Results
 
Presentation on how to chat with PDF using ChatGPT code interpreter
Presentation on how to chat with PDF using ChatGPT code interpreterPresentation on how to chat with PDF using ChatGPT code interpreter
Presentation on how to chat with PDF using ChatGPT code interpreternaman860154
 
Understanding Discord NSFW Servers A Guide for Responsible Users.pdf
Understanding Discord NSFW Servers A Guide for Responsible Users.pdfUnderstanding Discord NSFW Servers A Guide for Responsible Users.pdf
Understanding Discord NSFW Servers A Guide for Responsible Users.pdfUK Journal
 
🐬 The future of MySQL is Postgres 🐘
🐬  The future of MySQL is Postgres   🐘🐬  The future of MySQL is Postgres   🐘
🐬 The future of MySQL is Postgres 🐘RTylerCroy
 
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdfThe Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdfEnterprise Knowledge
 
Scaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organizationScaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organizationRadu Cotescu
 
Workshop - Best of Both Worlds_ Combine KG and Vector search for enhanced R...
Workshop - Best of Both Worlds_ Combine  KG and Vector search for  enhanced R...Workshop - Best of Both Worlds_ Combine  KG and Vector search for  enhanced R...
Workshop - Best of Both Worlds_ Combine KG and Vector search for enhanced R...Neo4j
 
2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...Martijn de Jong
 
Exploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone ProcessorsExploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone Processorsdebabhi2
 
08448380779 Call Girls In Greater Kailash - I Women Seeking Men
08448380779 Call Girls In Greater Kailash - I Women Seeking Men08448380779 Call Girls In Greater Kailash - I Women Seeking Men
08448380779 Call Girls In Greater Kailash - I Women Seeking MenDelhi Call girls
 
The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024Rafal Los
 
Handwritten Text Recognition for manuscripts and early printed texts
Handwritten Text Recognition for manuscripts and early printed textsHandwritten Text Recognition for manuscripts and early printed texts
Handwritten Text Recognition for manuscripts and early printed textsMaria Levchenko
 
The Codex of Business Writing Software for Real-World Solutions 2.pptx
The Codex of Business Writing Software for Real-World Solutions 2.pptxThe Codex of Business Writing Software for Real-World Solutions 2.pptx
The Codex of Business Writing Software for Real-World Solutions 2.pptxMalak Abu Hammad
 
Finology Group – Insurtech Innovation Award 2024
Finology Group – Insurtech Innovation Award 2024Finology Group – Insurtech Innovation Award 2024
Finology Group – Insurtech Innovation Award 2024The Digital Insurer
 
A Year of the Servo Reboot: Where Are We Now?
A Year of the Servo Reboot: Where Are We Now?A Year of the Servo Reboot: Where Are We Now?
A Year of the Servo Reboot: Where Are We Now?Igalia
 
Artificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and MythsArtificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and MythsJoaquim Jorge
 
IAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI SolutionsIAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI SolutionsEnterprise Knowledge
 

Recently uploaded (20)

Tata AIG General Insurance Company - Insurer Innovation Award 2024
Tata AIG General Insurance Company - Insurer Innovation Award 2024Tata AIG General Insurance Company - Insurer Innovation Award 2024
Tata AIG General Insurance Company - Insurer Innovation Award 2024
 
How to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerHow to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected Worker
 
What Are The Drone Anti-jamming Systems Technology?
What Are The Drone Anti-jamming Systems Technology?What Are The Drone Anti-jamming Systems Technology?
What Are The Drone Anti-jamming Systems Technology?
 
A Call to Action for Generative AI in 2024
A Call to Action for Generative AI in 2024A Call to Action for Generative AI in 2024
A Call to Action for Generative AI in 2024
 
Presentation on how to chat with PDF using ChatGPT code interpreter
Presentation on how to chat with PDF using ChatGPT code interpreterPresentation on how to chat with PDF using ChatGPT code interpreter
Presentation on how to chat with PDF using ChatGPT code interpreter
 
Understanding Discord NSFW Servers A Guide for Responsible Users.pdf
Understanding Discord NSFW Servers A Guide for Responsible Users.pdfUnderstanding Discord NSFW Servers A Guide for Responsible Users.pdf
Understanding Discord NSFW Servers A Guide for Responsible Users.pdf
 
🐬 The future of MySQL is Postgres 🐘
🐬  The future of MySQL is Postgres   🐘🐬  The future of MySQL is Postgres   🐘
🐬 The future of MySQL is Postgres 🐘
 
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdfThe Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
 
Scaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organizationScaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organization
 
Workshop - Best of Both Worlds_ Combine KG and Vector search for enhanced R...
Workshop - Best of Both Worlds_ Combine  KG and Vector search for  enhanced R...Workshop - Best of Both Worlds_ Combine  KG and Vector search for  enhanced R...
Workshop - Best of Both Worlds_ Combine KG and Vector search for enhanced R...
 
2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...
 
Exploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone ProcessorsExploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone Processors
 
08448380779 Call Girls In Greater Kailash - I Women Seeking Men
08448380779 Call Girls In Greater Kailash - I Women Seeking Men08448380779 Call Girls In Greater Kailash - I Women Seeking Men
08448380779 Call Girls In Greater Kailash - I Women Seeking Men
 
The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024
 
Handwritten Text Recognition for manuscripts and early printed texts
Handwritten Text Recognition for manuscripts and early printed textsHandwritten Text Recognition for manuscripts and early printed texts
Handwritten Text Recognition for manuscripts and early printed texts
 
The Codex of Business Writing Software for Real-World Solutions 2.pptx
The Codex of Business Writing Software for Real-World Solutions 2.pptxThe Codex of Business Writing Software for Real-World Solutions 2.pptx
The Codex of Business Writing Software for Real-World Solutions 2.pptx
 
Finology Group – Insurtech Innovation Award 2024
Finology Group – Insurtech Innovation Award 2024Finology Group – Insurtech Innovation Award 2024
Finology Group – Insurtech Innovation Award 2024
 
A Year of the Servo Reboot: Where Are We Now?
A Year of the Servo Reboot: Where Are We Now?A Year of the Servo Reboot: Where Are We Now?
A Year of the Servo Reboot: Where Are We Now?
 
Artificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and MythsArtificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and Myths
 
IAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI SolutionsIAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI Solutions
 

Cis336 week 7 i lab 7

  • 1. CIS 336 Week 7 iLab 7 Devry University Click this link to get the tutorial: http://homeworkfox.com/tutorials/general- questions/4157/cis-336-week-7-ilab-7-devry-university/ LABOVERVIEW Scenario/Summary There is a lot more to a database than just tables and the data in them. A very important part of database security has to do with using and understanding Database Views. Being able to enhance the efficiency of the database tables by using additional indexes is also a very important aspect of database development. Finally, being able to create and use Database Sequences to automate some of the sequential processes in the database can not only save time but improve efficiency. In Lab 7, you will have a chance to work with all three of these areas. General Lab Information and Considerations This lab will utilize the same set of tables found in the script file (LeeBooks.SQL) that were used for Labs 4 through 6. Each query in the script file you will create, must be numbered (use either –1 or REM 1 comments for numbering) and 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. However, 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.
  • 2. 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 scrip file that has queries with errors. Do number each query using either --1 or REM 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 resulting output file should show both the query statement and result set for each query. Deliverables The deliverable for this lab will include:
  • 3. Your script file with the seven queries and oneexplanation 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. Be sure that you include your answer to question #3 as a comment in this file. Both documents are to be zipped into a single file before submitting to the iLab Dropbox for Week 7. LABSTEPS STEP 1: Create a simple view named CUST_VIEW using the book_customer table that will display the customer number, first and last name, and the state for every customer currently in the database. Now insert the following data into the book_customer TABLE using an INSERT statement. (Do not use the View for this insert.) CUSTOMERID - 1021, FIRSTNAME – EDWARD, LASTNAME – BLAKE, STATE – TX. Now query your view and display the new record. STEP 2: Create a complex view named CUST_ORDER that will list the customer number, last name, and state from the BOOK_CUSTOMER table, in addition to the order number and order date from the BOOK_ORDER table. Insert the following data into this view (use the view for the insert statement): CUSTOMERID - 1022, LASTNAME – smith, STATE – KS, ORDERID - 1021, and ORDERDATE – 10-OCT-2004. STEP 3: In your own words, explain why the insert statement for the view you created in Step 2 did not work. STEP 4: Create a sequence that can be used to assign a publisher ID number to a new publisher. Define the sequence to start with seven, increment by two, and stop at 1000. Name the sequence PUBNUM_SEQ. STEP 5: Insert two new publishers into the PUBLISHER table, one named Double Week with a contact name of Jennifer Close at 800-959-6321, and the second one named Specific House with a
  • 4. contact name of Freddie Farmore at 866-825-3200. Use your new sequence to create the PUBID for each record. Now, query your PUBLISHER table to see your two new records. STEP 6: Using a single query, query the PUBNUM_SEQ to determine what both the current sequence number is and the next sequence number will be. STEP 7: Create a unique index on the combined columns ORDERID and CUSTOMERID in the BOOK_ORDER table. Give the index a name of BOOK_ORDER_IDX. STEP 8: Determine how many objects you currently own in your schema by querying the USER_OBJECTS view in the Data Dictionary. Your result set should list the different object types that you find and include a count by object type.