25.05.2017 Views

CIS336 (Introduction to Database wLAB – Oracle) Complete Class

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

<strong>CIS336</strong> (<strong>Introduction</strong> <strong>to</strong> <strong>Database</strong> w/LAB <strong>–</strong> <strong>Oracle</strong>) <strong>Complete</strong> <strong>Class</strong><br />

https://homeworklance.com/downloads/cis336-introduction-<strong>to</strong>-database-wlab-oracle-complete-class/<br />

<strong>CIS336</strong> (<strong>Introduction</strong> <strong>to</strong> <strong>Database</strong> w/LAB <strong>–</strong> <strong>Oracle</strong>) <strong>Complete</strong> <strong>Class</strong><br />

cis336 Full courses ( Discussion + ilab +Quiz+ Courses Project and Final Exam)<br />

<strong>CIS336</strong>A Week 1 Discussion DQ 1 & DQ 2<br />

DQ 1<br />

Normal<br />

Forms and<br />

Entity<br />

Relationship<br />

Diagrams<br />

(graded)<br />

We hear the term database all the time. Give some examples of databases that you interact with on a regular basis.<br />

What makes a database relational? What is a file s<strong>to</strong>rage system? How does a relational database differ from a file<br />

s<strong>to</strong>rage system?<br />

DQ 2<br />

Lab<br />

Forum<br />

(graded)<br />

This area is used <strong>to</strong> discuss the lab assignments and techniques. Please post any questions you have about the labs<br />

or tips that you have discovered during your learning process. At a minimum, post at least three notes that highlight<br />

your experience or problems with this week’s lab.<br />

<strong>CIS336</strong>A Week 2 Discussion DQ 1 & DQ 2<br />

DQ 1<br />

Developing<br />

a Good<br />

Data Model<br />

(graded)<br />

The database data model is the communication link between the designer, applications programmer, and user.<br />

Contribute your views on what constitutes a good data model and why.<br />

DQ 2


Lab<br />

Forum<br />

(graded)<br />

This area is used <strong>to</strong> discuss the lab assignments and techniques. Please post any questions you have about the labs<br />

or tips that you have discovered during your learning process. At a minimum, post at least three notes that highlight<br />

your experience or problems with this week’s lab.<br />

<strong>CIS336</strong>A Week 3 Discussion DQ 1 & DQ 2<br />

DQ 1<br />

Building<br />

the<br />

Physical<br />

Model<br />

(graded)<br />

What is the importance of constraints in a physical model? What role do different constraints play in maintaining<br />

referential integrity and data integrity?<br />

DQ 2<br />

Lab<br />

Forum<br />

(graded)<br />

This area is used <strong>to</strong> discuss the lab assignments and techniques. Please post any questions you have about the labs<br />

or tips that you have discovered during your learning process. At a minimum, post at least three notes that highlight<br />

your experience or problems with this week’s lab.<br />

<strong>CIS336</strong>A Week 4 Discussion DQ 1 & DQ 2<br />

DQ 1<br />

Understanding<br />

the SELECT<br />

statement<br />

(graded)<br />

Reports are generated using queries <strong>to</strong> a database. The SELECT statement is used <strong>to</strong> retrieve data from one or<br />

many tables in a database. Just as in other programming languages, understanding the syntax of a select statement<br />

is key. Let’s first discuss the key clauses in a SELECT statement and the purpose of each.


DQ 2<br />

Lab<br />

Forum<br />

(graded)<br />

This area is used <strong>to</strong> discuss the lab assignments and techniques. Please post any questions you have about the labs<br />

or tips that you have discovered during your learning process. At a minimum, post at least three notes that highlight<br />

your experience or problems with this week’s lab.<br />

<strong>CIS336</strong>A Week 5 Discussion DQ 1 & DQ 2<br />

DQ 1<br />

Getting<br />

Data<br />

From<br />

Multiple<br />

Tables<br />

(graded)<br />

It is not uncommon <strong>to</strong> have <strong>to</strong> retrieve data that resides in several tables, especially when formulating a report.<br />

Discuss some of the performance issues when querying three or four tables at a time.<br />

DQ 2<br />

Lab<br />

Forum<br />

(graded)<br />

This area is used <strong>to</strong> discuss the lab assignments and techniques. Please post any questions you have about the labs<br />

or tips that you have discovered during your learning process. At a minimum, post at least three notes that highlight<br />

your experience or problems with this week’s lab.<br />

<strong>CIS336</strong>A Week 6 Discussion DQ 1 & DQ 2<br />

DQ 1<br />

How<br />

Group<br />

Functions<br />

Differ


From<br />

Single-<br />

Row<br />

Functions<br />

(graded)<br />

What are some examples of group functions, and how do they differ from single-row functions?<br />

DQ 2<br />

Lab<br />

Forum<br />

(graded)<br />

This area is used <strong>to</strong> discuss the lab assignments and techniques. Please post any questions you have about the labs<br />

or tips that you have discovered during your learning process. At a minimum, post at least three notes that highlight<br />

your experience or problems with this week’s lab.<br />

<strong>CIS336</strong>A Week 7 Discussion DQ 1 & DQ 2<br />

DQ 1<br />

<strong>Database</strong><br />

Views<br />

(graded)<br />

What are the advantages of selecting data from a view over selecting data from a base table?<br />

DQ 2<br />

Lab<br />

Forum<br />

(graded)<br />

This area is used <strong>to</strong> discuss the lab assignments and techniques. Please post any questions you have about the labs<br />

or tips that you have discovered during your learning process. At a minimum, post at least three notes that highlight<br />

your experience or problems with this week’s lab.<br />

cis336 week ALL ilab<br />

devry cis336 week 1 ilab laest 2016 march<br />


iLab> Required Software<br />

Lab 1 of 7: Normal Forms and Entity Relationship Diagrams (xx points)<br />

Listen<br />

What’s this?<br />

iLab Overview<br />

Scenario/Summary<br />

Download the iLab instructions and the Answer Sheet for the necessary steps <strong>to</strong> be completed for this lab. They can<br />

be found below. You will notice that the readings, including lectures, the examples we worked on during the lecture,<br />

and other audio and visual aids provided, will help you tackle this week’s lab. Remember <strong>to</strong> always follow the<br />

instructions <strong>to</strong> get maximum credit, and use the weekly discussion related <strong>to</strong> the iLab and the Q & A Forum for<br />

additional help. Be specific and state the problem you are having clearly, including what you have done <strong>to</strong> resolve it,<br />

in the discussion.<br />

Microsoft Visio Tu<strong>to</strong>rial—Important Information<br />

Important: Before starting, be sure <strong>to</strong> review the Logical Modeling Part 1video under Video Library <strong>to</strong> familiarize<br />

you with how <strong>to</strong> use MS Visio <strong>to</strong> draw Entity Relationship Diagrams.<br />

Deliverables<br />

NOTE<br />

Submit your assignment <strong>to</strong> the Dropbox, located at the <strong>to</strong>p of this page. For instructions on how <strong>to</strong> use the Dropbox,<br />

read thesestep-by-step instructions.<br />

(See the Syllabus section “Due Dates for Assignments & Exams” for due dates.)<br />

The deliverable for this lab is a single MS Word document named lab1_solutions_yourname.docx with the answers<br />

included for Steps 1<strong>–</strong>4.<br />

Required Software<br />

Microsoft Office: Word and Visio 2010<br />

Use a personal copy or access the software athttps://lab.devry.edu.<br />

All Steps<br />

Lab Steps<br />

STEP 1: Download the Week 1 Lab Instructions<br />

Follow the instructions <strong>to</strong> complete the lab by downloading the following files:<br />

<strong>CIS336</strong>Lab1_Instructions.docx<br />

<strong>CIS336</strong>Lab1_StudentAnswerSheet.docx<br />

STEP 2: Submit Your Answers on the Lab 1 Student Answer Sheet<br />

Use Visio or Word <strong>to</strong> draw the dependency diagrams for Steps 1<strong>–</strong>3. Use Visio <strong>to</strong> draw the ERD for Step 4.<br />

This is the end of iLab #1<br />

devry cis336 week 2 ilab<br />

iLab> Lab Steps<br />

Lab 2 of 7: The Expanded Entity Relationship Diagram<br />

What’s this?<br />

iLab Overview<br />

Scenario/Summary<br />

Download the iLab instructions and the Answer Sheet for the necessary steps <strong>to</strong> be completed for this lab. They can<br />

be found below. You will notice that the readings, including lectures, the examples we worked on during the lecture,<br />

and other audio and visual aids provided, will help you tackle this week’s lab. Remember <strong>to</strong> always follow the<br />

instructions <strong>to</strong> get maximum credit, and use the weekly discussion related <strong>to</strong> the iLab and the Q & A Forum for


additional help. Be specific and state the problem you are having clearly, including what you have done <strong>to</strong> resolve it,<br />

in the discussion.<br />

Deliverables<br />

NOTE<br />

Submit your assignment <strong>to</strong> the Dropbox, located at the <strong>to</strong>p of this page. For instructions on how <strong>to</strong> use the Dropbox,<br />

read thesestep-by-step instructions.<br />

(See the Syllabus section “Due Dates for Assignments & Exams” for due dates.)<br />

The deliverable for this lab will be your completed ERD as a single MS Word document using copy/paste from the MS<br />

Visio application and namedlab2_solutions_yourname.docx<br />

Required Software<br />

Microsoft Office: Word<br />

Use a personal copy or access the software athttps://lab.devry.edu.<br />

All Steps<br />

Microsoft Office: Visio<br />

Use a personal copy or access the software athttps://lab.devry.edu.<br />

All Steps<br />

Lab Steps<br />

STEP 1: Download the Week 2 Lab Instructions.<br />

Follow the instructions <strong>to</strong> complete the lab by downloading the following files:<br />

<strong>CIS336</strong>Lab2_Instructions.docx<br />

STEP 2: Submit Your Answers<br />

Use Visio <strong>to</strong> create your ERD. Copy and paste <strong>to</strong> a Word document as indicated in the lab instructions.<br />

This is the end of lab #2<br />

devry cis336 week 3 ilab<br />

iLab> Lab Steps<br />

Lab 3 of 7: Building the Physical Model<br />

Listen<br />

What’s this?<br />

iLab Overview<br />

Scenario/Summary<br />

Beginning with this lab, and continuing through the remaining weeks you will be doing all of your work in the MySQL<br />

EDUPE Environment. By now you have received your logon ID and password and should have at least made sure<br />

you can connect. If for any reason you have not done so, please do so now before continuing any further. If for any<br />

reason you cannot connect, then you need <strong>to</strong> let the instruc<strong>to</strong>r know ASAP so that any problems can be resolved.<br />

In this lab you will transform a logical database design (data model) in<strong>to</strong> a physical model (tables, constraints, and<br />

relationships). Your job will be <strong>to</strong> take the relationship diagram along with the meta data defined in the data dictionary<br />

and define the table structures and constraints <strong>to</strong> create the physical tables. Once this has been done, you will<br />

populate the tables with data. Lastly, you will write SELECT statements <strong>to</strong> query the tables and verify the data was<br />

populated.<br />

Deliverables<br />

NOTE<br />

Submit your assignment <strong>to</strong> the Dropbox, located at the <strong>to</strong>p of this page. For instructions on how <strong>to</strong> use the Dropbox,<br />

read thesestep-by-step instructions.<br />

(See the Syllabus section “Due Dates for Assignments & Exams” for due dates.)


1. Your script file. Create this file in Notepad,notWord. Make sure your name is in a comment area at the <strong>to</strong>p of<br />

the script file. Use a double dash <strong>to</strong> create a one-line comment.<br />

—Jacob Smith<br />

—Lab 3<br />

Required Software<br />

MySQL<br />

Access the software athttps://devry.edupe.net:8300<br />

Lab Steps<br />

STEP 1: Download the Week 3 Lab Instructions<br />

<strong>Complete</strong> the lab by downloading the following files this week:<br />

<br />

<strong>CIS336</strong>Lab3_Instructions.docx<br />

<br />

<strong>CIS336</strong>Lab3_Files.zip<br />

STEP 2: Submit Your SQL Command File<br />

Use Notepad <strong>to</strong> write the SQL statements and submit according the lab instructions.<br />

This is the end of Lab #3<br />

devry cis336 week 4 ilab<br />

<br />

<br />

iLab> STEP 2: Download the Week 4 Lab Instructions and Answer Sheet<br />

Lab 4 of 7: Building the Physical Model<br />

Listen<br />

What’s this?<br />

iLab Overview<br />

Scenario/Summary<br />

Lab 4 will introduce the various aspects of the SQL SELECT statement and the methods of retrieving data from the<br />

database tables. The lab will utilize a database with a set of tables that you will create and populate using the<br />

instructions and script file found below. These tables will be used for the remaining labs in this class.<br />

Deliverables<br />

NOTE<br />

Submit your assignment <strong>to</strong> the Dropbox, located at the <strong>to</strong>p of this page. For instructions on how <strong>to</strong> use the Dropbox,<br />

read thesestep-by-step instructions.<br />

(See the Syllabus section “Due Dates for Assignments & Exams” for due dates.)<br />

The deliverable for this lab will include the following.<br />

The Student Answer Sheet file below provides a place for each query and the output of the query. You will<br />

copy and paste this information from your MySQL environment. Be sure your name, course number, and lab number<br />

are in your file which will be submitted <strong>to</strong> the iLab Dropbox for Week 4.<br />

Required Software<br />

Microsoft Office: Word<br />

Use a personal copy or access the software athttps://lab.devry.edu.<br />

All Steps<br />

MySQL<br />

Access the software athttps://devry.edupe.net:8300<br />

Lab Steps<br />

STEP 1: Create the <strong>Database</strong> and Tables<br />

Create the database and tables (that will be used in labs 4<strong>–</strong>7) by downloading the following files.<br />

CreateOMTables.docx(Instructions)


create_OM_db.sql(<strong>Database</strong> Script)<br />

STEP 2: Download the Week 4 Lab Instructions and Answer Sheet<br />

Follow the instructions <strong>to</strong> complete the lab by downloading the following files.<br />

<strong>CIS336</strong>Lab4_Instructions.docx<br />

<strong>CIS336</strong>Lab4_StudentAnswerSheet.docx<br />

Be sure <strong>to</strong> refer <strong>to</strong> the ERD for the database inOM_ERD.docxwhen creating your queries.<br />

STEP 3: Submit Your Answer sheet<br />

<strong>Complete</strong> the Answer Sheet <strong>to</strong> show your queries and results and submit according <strong>to</strong> the lab instructions.<br />

This is the end of Lab#4.<br />

devry cis336 week 5 ilab<br />

<br />

<br />

<br />

iLab> STEP 1: Download the Week 5 Lab Instructions and Answer Sheet<br />

Lab 5 of 7: Retrieving Data From Multiple Tables (39 points)<br />

Listen<br />

What’s this?<br />

iLab Overview<br />

Scenario/Summary<br />

Lab 5 deals with writing queries using multiple tables as covered in the reading and lecture material this week. In<br />

some cases, you will be given the option <strong>to</strong> choose the JOIN syntax <strong>to</strong> use, in other cases, you will be asked <strong>to</strong> take a<br />

specific approach. Using the incorrect process when the process is specified will result in points being taken off for<br />

that problem.<br />

Deliverables<br />

NOTE<br />

Submit your assignment <strong>to</strong> the Dropbox, located at the <strong>to</strong>p of this page. For instructions on how <strong>to</strong> use the Dropbox,<br />

read thesestep-by-step instructions.<br />

(See the Syllabus section “Due Dates for Assignments & Exams” for due dates.)<br />

The deliverable for this lab will include:<br />

The Student Answer Sheet file that you will download below provides a place for each query and the output of the<br />

query. You will copy and paste this information from your MySQL environment. Be sure your name, course number,<br />

and lab number are in your file which will be submitted <strong>to</strong> the iLab Dropbox for Week 5.<br />

Required Software<br />

Microsoft Office: Word<br />

Use a personal copy or access the software athttps://lab.devry.edu.<br />

All Steps<br />

MySQL<br />

Access the software athttps://devry.edupe.net:8300<br />

Lab Steps<br />

PRELIMINARY STEP: If You Have Not Created the <strong>Database</strong> Yet, Please <strong>Complete</strong>.<br />

This lab will utilize the tables that were created in Lab 4. If you have not yet created these tables,you can create the<br />

database and tables (used in labs 4<strong>–</strong>7) by downloading the following files.<br />

CreateOMTables.docx(Instructions)<br />

create_OM_db.sql(<strong>Database</strong> Script)<br />

STEP 1: Download the Week 5 Lab Instructions and Answer Sheet<br />

Follow the instructions <strong>to</strong> complete the lab by downloading the following files.<br />

<strong>CIS336</strong>Lab5_Instructions.docx


<strong>CIS336</strong>Lab5_StudentAnswerSheet.docx<br />

Be sure <strong>to</strong> refer <strong>to</strong> the ERD for the database inOM_ERD.docxwhen creating your queries.<br />

STEP 2: Submit Your Answer sheet<br />

<strong>Complete</strong> the Answer Sheet <strong>to</strong> show your queries and results and submit according <strong>to</strong> the lab instructions.<br />

This is the end of Lab #5.<br />

devry cis336 week 6 ilab<br />

<br />

<br />

<br />

<br />

iLab> STEP 1: Download the Week 6 Lab Instructions and Answer Sheet<br />

Lab 6 of 7: Group Functions and Subqueries<br />

Listen<br />

What’s this?<br />

iLab Overview<br />

Scenario/Summary<br />

Lab 6 will introduce group or aggregate functions and subqueries. Make sure <strong>to</strong> follow the instructions provided by<br />

each step.<br />

Deliverables<br />

NOTE<br />

Submit your assignment <strong>to</strong> the Dropbox, located at the <strong>to</strong>p of this page. For instructions on how <strong>to</strong> use the Dropbox,<br />

read thesestep-by-step instructions.<br />

(See the Syllabus section “Due Dates for Assignments & Exams” for due dates.)<br />

The deliverable for this lab will include the following.<br />

The Student Answer Sheet file that you will download below provides a place for each query and the output of the<br />

query. You will copy and paste this information from your MySQL environment. Be sure your name, course number,<br />

and lab number are in your file which will be submitted <strong>to</strong> the iLab Dropbox for Week 5.<br />

Required Software<br />

Microsoft Office: Word<br />

Use a personal copy or access the software athttps://lab.devry.edu.<br />

All Steps<br />

MySQL<br />

Access the software athttps://devry.edupe.net:8300<br />

Lab Steps<br />

PRELIMINARY STEP: If You Have Not Created the <strong>Database</strong> Yet, Please <strong>Complete</strong>.<br />

This lab will utilize the tables that were created in Lab 4. If you have not yet created these tables, you can create the<br />

database and tables (used in labs 4<strong>–</strong>7) by downloading the following files.<br />

CreateOMTables.docx (Instructions)<br />

create_OM_db.sql (<strong>Database</strong> Script)<br />

STEP 1: Download the Week 6 Lab Instructions and Answer Sheet<br />

Follow the instructions <strong>to</strong> complete the lab by downloading the following files.<br />

<strong>CIS336</strong>Lab6_Instructions.docx<br />

<strong>CIS336</strong>Lab6_StudentAnswerSheet.docx<br />

Be sure <strong>to</strong> refer <strong>to</strong> the ERD for the database inOM_ERD.docx when creating your queries.<br />

STEP 2: Submit Your Answer Sheet<br />

<strong>Complete</strong> the answer sheet <strong>to</strong> show your queries and results, and submit according <strong>to</strong> the lab instructions.<br />

This is the end of Lab #6


Devry <strong>CIS336</strong> All Week Quiz<br />

Devry <strong>CIS336</strong> Week 2 Quiz Latest 2016 March<br />

Devry <strong>CIS336</strong> Week 2 Quiz Latest<br />

Question 1. Question : (TCO 2) Which statement is FALSE regarding a primary key?<br />

Only parent tables must have a primary key.<br />

The values must be unique.<br />

It can be made up of multiple attributes.<br />

The value cannot be NULL.<br />

Question 2. Question : (TCO 2) _____ integrity insures that the value of a foreign key must match a primary key<br />

value in the table <strong>to</strong> which it is related, or be null.<br />

Referential<br />

Entity<br />

Data<br />

Logical<br />

Question 3. Question : (TCO 2) A verb associating two nouns in a business rule usually translates <strong>to</strong> a(n) ____ in<br />

the data model.<br />

entity<br />

attribute<br />

relationship<br />

constraint<br />

Question 4. Question : (TCO 4) A(n) _____ provides a graphical description of a data model.<br />

entity relationship diagram<br />

data dictionary<br />

business rule<br />

pseudocode<br />

Question 5. Question : (TCO 2) A _____ primary key is made up of more than one attribute.<br />

composite<br />

foreign<br />

bridge<br />

linking<br />

Question 6. Question : (TCO 4) In the figure below, the OrderLineItems entity is there <strong>to</strong> implement what type of<br />

relationship between Orders and Products?<br />

One <strong>to</strong> one<br />

One <strong>to</strong> many<br />

Many <strong>to</strong> many


No relationship<br />

Question 7. Question : (TCO 2) When designing a database, you should _____.<br />

make sure entities are in normal form before table structures are created<br />

create table structures then normalize the database<br />

only normalize the database when performance problems occur<br />

consider more important issues, such as performance, before normalizing<br />

Question 8. Question : (TCO 2) A table that is in 1NF and includes no partial dependencies only is said <strong>to</strong> be in<br />

_____.<br />

1NF<br />

2NF<br />

3NF<br />

BCNF<br />

Question 9. Question : (TCO 2) A table is not in 1NF if _____.<br />

it has a primary key defined<br />

all of the key attributes are defined<br />

there are repeating groups in the table<br />

all attributes are dependent on the primary key<br />

Question 10. Question : (TCO 2) Entity attributes and primary keys are not present in the _____ data model.<br />

logical<br />

physical<br />

conceptual<br />

network<br />

Devry <strong>CIS336</strong> Week 3 Quiz<br />

Devry <strong>CIS336</strong> Week 3 Quiz Latest 2016 March<br />

1. Question : (TCO 3) The _____ column attribute will au<strong>to</strong>matically generate unique numbers in sequence.<br />

DEFAULT<br />

AUTO_INCREMENT<br />

AUTO_SEQUENCE<br />

NOT NULL<br />

Question 2. Question : (TCO 5) The _____ keyword is used in an ALTER statement <strong>to</strong> remove a column from an<br />

existing table.<br />

MODIFY COLUMN<br />

ADD COLUMN<br />

DELETE COLUMN<br />

DROP COLUMN<br />

Question 3. Question : (TCO 3) Which uses the least amount of s<strong>to</strong>rage?<br />

“Example” s<strong>to</strong>red in a column of type CHAR(20)<br />

“Exam” s<strong>to</strong>red in a column of type CHAR(20)


“Ex” s<strong>to</strong>red in a column of type CHAR(20)<br />

They all use the same amount of s<strong>to</strong>rage.<br />

Question 4. Question : (TCO 3) The TIME data type in MySQL can s<strong>to</strong>re _____.<br />

dates only<br />

times only<br />

dates and times<br />

None of the above<br />

Question 5. Question : (TCO 3) Which statement is false regarding the creation of a foreign key constraint at table<br />

level or with an ALTER statement?<br />

The parent table must already exist.<br />

The field must already be defined in the table.<br />

The PK and FK fields must have the same name.<br />

The PK and FK fields may have different names.<br />

Question 6. Question : (TCO 3) A foreign key constraint can only reference a column in another table that has been<br />

assigned a(n) _____ constraint.<br />

NOT NULL<br />

UNIQUE<br />

PRIMARY KEY<br />

DEFAULT<br />

Question 7. Question : (TCO 3) You are creating a table called Department, with fields for the primary key DeptID<br />

(Integer) and department name (VARCHAR). What (if anything) is wrong with the following code?<br />

CREATE TABLE Department<br />

(<br />

deptID Primary Key INTEGER ,<br />

deptName NOT NULL VARCHAR(10)<br />

);<br />

You must use curly braces, not parentheses.<br />

The data type must immediately follow the field name.<br />

The keywords cannot be in upper case.<br />

Nothing is wrong.<br />

Question 8. Question : (TCO 3) What datatype is best <strong>to</strong> s<strong>to</strong>re a person’s age?<br />

INTEGER<br />

VARCHAR<br />

DECIMAL<br />

FLOAT<br />

Question 9. Question : (TCO 5) Which statement will remove the field STATUS from the CUSTOMERS table?<br />

ALTER TABLE cus<strong>to</strong>mers REMOVE status;<br />

ALTER TABLE cus<strong>to</strong>mers DROP status;<br />

ALTER TABLE cus<strong>to</strong>mers DROP COLUMN status;<br />

ALTER TABLE cus<strong>to</strong>mers DELETE status;<br />

Question 10. Question : (TCO 8) When you write an INSERT statement with a column list, which columns can be<br />

omitted from the column list?


AUTO_INCREMENT only<br />

DEFAULT only<br />

NOT NULL only<br />

AUTO_INCREMENT, DEFAULT, and fields that allow NULL<br />

Devry <strong>CIS336</strong> Week 4 Quiz Latest<br />

Devry <strong>CIS336</strong> Week 4 Quiz Latest 2016 March<br />

Question 1. Question : (TCO 6) To retrieve all fields from a table, use<br />

SELECT ALL.<br />

SELECT ANY.<br />

SELECT ().<br />

SELECT *.<br />

Question 2. Question : (TCO 6) Which opera<strong>to</strong>r would be most appropriate <strong>to</strong> determine books with a retail price in<br />

the range of $50 <strong>to</strong> $100?<br />

LIKE<br />

IN<br />

BETWEEN<br />

><br />

Question 3. Question : (TCO 6) Which code returns the date field HIREDATE in the format: Friday, April 5th, 2015?<br />

DATE_FORMAT(HIREDATE, ‘%W, %m %d, %Y’)<br />

DATE_FORMAT(HIREDATE, ‘%a, %M %D, %Y’)<br />

DATE_FORMAT(HIREDATE, ‘%W, %M %D, %Y’)<br />

DATE_FORMAT(HIREDATE, ‘%a, %m %d, %y’)<br />

Question 4. Question : (TCO 6) Given a cus<strong>to</strong>mer table with fields for firstname and lastname, which of the following<br />

will display the cus<strong>to</strong>mer name as a single field in the format “Jones, Tom” with a heading?<br />

SELECT CONCAT(lastname, firstname) as “Name” FROM cus<strong>to</strong>mer;<br />

SELECT CONCAT(firstname, lastname) as “Name” FROM cus<strong>to</strong>mer;<br />

SELECT CONCAT(lastname, ‘, ‘, firstname) as “Name” FROM cus<strong>to</strong>mer;<br />

SELECT CONCAT lastname ‘, ‘ firstname as “Name” FROM cus<strong>to</strong>mer;<br />

Question 5. Question : (TCO 8) The column <strong>to</strong> be updated by the UPDATE command is specified in the _____<br />

clause.<br />

WHERE<br />

MODIFY<br />

ALTER<br />

SET<br />

Question 6. Question : (TCO 6) Given a table orders with fields for orderid, orderdate, and shipdate, which query<br />

will display the ordered for only those orders that have not shipped?<br />

SELECT orderid FROM orders WHERE shipdate = orderdate;<br />

SELECT orderid FROM orders WHERE shipdate IS NOT NULL;


SELECT orderid FROM orders WHERE shipdate IS NULL;<br />

SELECT orderid FROM orders;<br />

Question 7. Question : (TCO 6) Which WHERE clause will return data on all employees with a last name beginning<br />

with ‘S’?<br />

WHERE lastname = ‘S’<br />

WHERE lastname = ‘S%’<br />

WHERE lastname LIKE ‘S’<br />

WHERE lastname LIKE ‘S%’<br />

Question 8. Question : (TCO 6) Given a books table with fields of title, cost, and retail, what if anything is wrong with<br />

the following query (assuming all fields exist)?<br />

SELECT * FROM books WHERE cost > 20 ORDER BY retail;<br />

You must sort and filter on the same field.<br />

You cannot use ORDER BY and WHERE in the same query.<br />

The WHERE clause must always be last.<br />

Nothing is wrong.<br />

Question 9. Question : (TCO 8) You can delete one or more rows in a table by using the _____ command.<br />

UPDATE<br />

DROP<br />

DELETE<br />

ALTER<br />

Question 10. Question : (TCO 6) Given a books table with fields: title, category (such as ‘SPORTS’), cost, retail;<br />

what condition will return ‘COMPUTER’ books with a retail price between $50 and $100 ?<br />

WHERE retail > 50 AND < 100 AND category = ‘COMPUTER’<br />

WHERE category = ‘COMPUTER’ AND (retail BETWEEN 100 and 50)<br />

WHERE category = ‘COMPUTER’ AND retail < 50 AND retail > 100<br />

WHERE category = ‘COMPUTER’ AND ( retail BETWEEN 50 AND 100)<br />

Devry <strong>CIS336</strong> Week 5 Quiz<br />

Devry <strong>CIS336</strong> Week 5 Quiz Latest 2016 March<br />

1. Question : (TCO 7) The implicit inner join syntax is defined as _____.<br />

NATURAL JOIN<br />

JOIN ON<br />

JOIN USING<br />

WHERE clause<br />

Question 2. Question : (TCO 7) To join four tables would require _____ join conditions.<br />

4<br />

3<br />

2<br />

Cannot tell without an ERD.


Question 3. Question : (TCO 7) Given the two tables described below, which of the following JOIN queries (if any) is<br />

not correct?<br />

cus<strong>to</strong>mer: with the fields cus<strong>to</strong>merid(PK), lastname, firstname<br />

order: with the fields orderid(PK), orderdate, cus<strong>to</strong>merid(FK)<br />

SELECT lastname, orderdate from cus<strong>to</strong>mer JOIN order ON cus<strong>to</strong>mer.cus<strong>to</strong>merid = order.cus<strong>to</strong>merid;<br />

SELECT lastname, orderdate from cus<strong>to</strong>mer JOIN order USING (cus<strong>to</strong>merid);<br />

SELECT lastname, orderdate from cus<strong>to</strong>mer, orders;<br />

All of the above<br />

Question 4. Question : (TCO 7) In a join, column names need <strong>to</strong> be qualified only<br />

in inner joins.<br />

in outer joins.<br />

when the code is confusing.<br />

when the same column names exist in both tables.<br />

Question 5. Question : (TCO 7) A left join returns<br />

rows in the left table that don’t satisfy the join condition.<br />

unmatched rows from both the left and right tables.<br />

rows in the right table that don’t satisfy the join condition.<br />

the Cartesian product of the two tables.<br />

Question 6. Question : (TCO 7) When you use the USING keyword for a join<br />

the join cannot be an outer join.<br />

the join cannot be based on more than one column.<br />

the join must be based on a column or columns that have the same name in both tables.<br />

the join must be an inner join.<br />

Question 7. Question : (TCO 7) Consider the ERD below. How many tables would be required <strong>to</strong> create a query <strong>to</strong><br />

display the cus<strong>to</strong>mer first and last name along with orderdate of each order they placed?<br />

One<br />

Two<br />

Three<br />

Four<br />

Question 8. Question : (TCO 7) Consider the ERD below. What tables will be needed <strong>to</strong> create a report showing the<br />

firstname and lastname of cus<strong>to</strong>mers who have placed an order for any product with keyboard in the description?<br />

cus<strong>to</strong>mer, product only<br />

cus<strong>to</strong>mer, order, product only<br />

cus<strong>to</strong>mer, orderline only<br />

cus<strong>to</strong>mer, order, orderline, product<br />

Question 9. Question : (TCO 7) Consider the ERD below. What tables will be needed <strong>to</strong> create a report showing<br />

cus<strong>to</strong>mer first and last name along with order date? The report should show all cus<strong>to</strong>mers even if they have never<br />

placed an order.<br />

SELECT firstname, lastname, orderdate from cus<strong>to</strong>mer LEFT JOIN order;<br />

SELECT firstname, lastname, orderdate FROM cus<strong>to</strong>mer RIGHT JOIN order ON cus<strong>to</strong>mer.cus<strong>to</strong>merid =<br />

order.cus<strong>to</strong>merid;<br />

SELECT firstname, lastname, orderdate FROM cus<strong>to</strong>mer JOIN order USING (cus<strong>to</strong>merID);


SELECT firstname, lastname, orderdate FROM cus<strong>to</strong>mer LEFT JOIN order ON cus<strong>to</strong>mer.cus<strong>to</strong>merid =<br />

order.cus<strong>to</strong>merid;<br />

Question 10. Question : (TCO 7) Consider the ERD below. Note that there are some products produced in-house<br />

that do not require a vendor, thus their vendorID is NULL. Also note that not all vendors currently supply products.<br />

Which query would be used <strong>to</strong> generate a report showing vendorname and productname, and will include ALL<br />

vendors even if they do not currently supply any products?<br />

SELECT vendorname, productname FROM vendor LEFT JOIN product;<br />

SELECT vendorname, productname FROM vendor RIGHT JOIN product;<br />

SELECT vendorname, productname FROM vendor LEFT JOIN product ON vendor.vendorID = product.vendorID;<br />

SELECT vendorname, productname FROM vendor RIGHT JOIN product ON vendor.vendorID = product.vendorID;<br />

Devry <strong>CIS336</strong> Week 6 Quiz<br />

Devry <strong>CIS336</strong> Week 6 Quiz Latest 2016 March<br />

1. Question : (TCO 7) Which is NOT an aggregate function?<br />

SUM<br />

COUNT<br />

ROUND<br />

MAX<br />

Question 2. Question : (TCO 7) Which of the following statements is correct?<br />

WHERE operates on groups formed by aggregate functions and HAVING operates on individual rows.<br />

WHERE can only be used along with HAVING.<br />

HAVING can only be used along with WHERE.<br />

WHERE operates on individual rows and HAVING operates on groups formed by aggregate functions.<br />

Question 3. Question : (TCO 7) Given the books table described below, which of the following will display the date<br />

of the book with the earliest publication date?<br />

books: bookid(PK), ISBN, title, pubdate, cost, retail, category, pubid(FK)<br />

SELECT MIN(pubdate) FROM books;<br />

SELECT title FROM books WHERE pubdate = MIN(pubdate);<br />

SELECT title FROM books WHERE pubdate < MIN(pubdate);<br />

SELECT pubdate from books WHERE MIN(pubdate) IS NOT NULL;<br />

Question 4. Question : (TCO 7) Given the books table described below, which of the following will display the title<br />

and retail price of books that are priced higher than the average retail price of all books?<br />

books: bookid(PK), ISBN, title, pubdate, cost, retail, category, pubid(FK)<br />

SELECT title, retail FROm books WHERE retail IN (SELECT AVG(retail) FROM books);<br />

SELECT title, retail FROM books WHERE retail > (SELECT AVG(retail) FROM books);<br />

SELECT title, retail FROM books WHERE retail > AVG(retail);<br />

SELECT title, AVG(retail) FROM books;


Question 5. Question : (TCO 7) Which of the values listed below can be returned by a subquery referenced as<br />

follows?<br />

WHERE vendorid = (subquery)<br />

A single value<br />

A column of one or more rows<br />

A table<br />

A subquery can’t be used in this way.<br />

Question 6. Question : (TCO 7) What type of subquery is executed once for each row processed by the main<br />

query?<br />

Correlated<br />

Uncorrelated<br />

Inner<br />

Outer<br />

Question 7. Question : (TCO 7) Given the two tables described below, which of the following queries will display the<br />

names of the cus<strong>to</strong>mers with orders shipped after December 1, 2014?<br />

cus<strong>to</strong>mer: with the fields cus<strong>to</strong>merid(PK), lastname, firstname<br />

order: with the fields orderid(PK), orderdate, shipdate, cus<strong>to</strong>merid(FK)<br />

SELECT lastname, firstname FROM cus<strong>to</strong>mer WHERE cus<strong>to</strong>merid = (SELECT cus<strong>to</strong>merID FROM order WHERE<br />

shipdate > ‘2014-01-12’);<br />

SELECT lastname, firstname FROM cus<strong>to</strong>mer WHERE cus<strong>to</strong>merid = (SELECT cus<strong>to</strong>merID FROM order WHERE<br />

shipdate < ‘2014-01-12’);<br />

SELECT lastname, firstname FROM cus<strong>to</strong>mer WHERE cus<strong>to</strong>merid = (SELECT cus<strong>to</strong>merID FROM order WHERE<br />

shipdate > ‘2014-12-01’);<br />

SELECT lastname, firstname FROM cus<strong>to</strong>mer WHERE cus<strong>to</strong>merid = (SELECT cus<strong>to</strong>merID FROM order WHERE<br />

shipdate < ‘2014-12-01’);<br />

Question 8. Question : (TCO 7) Given the two tables described below, which of the following queries will display<br />

each cus<strong>to</strong>merid along with the number of orders placed by that cus<strong>to</strong>mer?<br />

cus<strong>to</strong>mer: with the fields cus<strong>to</strong>merid(PK), lastname, firstname<br />

order: with the fields orderid(PK), orderdate, shipdate, cus<strong>to</strong>merid(FK)<br />

SELECT cus<strong>to</strong>merid, COUNT(cus<strong>to</strong>merid) FROM order;<br />

SELECT cus<strong>to</strong>merid, COUNT(ordered) FROM order;<br />

SELECT cus<strong>to</strong>merid, COUNT(orderid) FROM order GROUP BY cus<strong>to</strong>merid;<br />

SELECT cus<strong>to</strong>merid, COUNT(orderid) FROM order GROUP BY orderid;<br />

Question 9. Question : (TCO 7) Given the books table described below, which of the following will display each<br />

category along with the average retail price of books in that category?<br />

books: bookid(PK), ISBN, title, pubdate, cost, retail, category, pubid(FK)<br />

SELECT AVG(retail) FROM books;<br />

SELECT category, AVG(retail) FROM books GROUP BY category:<br />

SELECT category, AVG(retail) FROM books HAVING category;<br />

SELECT category, SUM(retail) FROM books GROUP BY category;<br />

Question 10. Question : (TCO 7) The expression below will be TRUE for what values of x?<br />

x > ALL(5, 9)<br />

5 and below


5 <strong>to</strong> 9<br />

5 and above<br />

9 and above<br />

Devry <strong>CIS336</strong> Final Exam answers<br />

Week 8 : Wk8 <strong>–</strong> Final Exam<br />

Top of Form<br />

Bot<strong>to</strong>m of Form<br />

Multiple Choice<br />

Question<br />

1. 1. (TCO<br />

1) A<br />

DBMS<br />

performs<br />

several<br />

important<br />

functions<br />

that<br />

guarantee<br />

the<br />

integrity<br />

and<br />

consistency<br />

of the data<br />

in the<br />

database.<br />

Which of<br />

the<br />

following<br />

is NOT one<br />

of those<br />

functions?<br />

(Points : 4)<br />

Multiuser access control<br />

Data integrity management<br />

<strong>Database</strong> access languages<br />

End of month reports<br />

Question<br />

2. 2. (TCO<br />

1) A<br />

relational<br />

DBMS<br />

provides


protection<br />

of the<br />

_____<br />

through<br />

security,<br />

control,<br />

and<br />

recovery<br />

facilities.<br />

(Points :<br />

4)<br />

user<br />

network<br />

system<br />

database<br />

Question<br />

3. 3. (TCO<br />

2) A<br />

relationship<br />

is an<br />

association<br />

between<br />

_____<br />

(Points : 4)<br />

objects.<br />

entities.<br />

databases.<br />

fields.<br />

Question<br />

4. 4. (TCO<br />

2) A<br />

_____ key<br />

is a key<br />

that is<br />

composed<br />

of more<br />

than one<br />

attribute.<br />

(Points :<br />

4)<br />

primary<br />

foreign<br />

composite<br />

domain<br />

Question<br />

5. 5. (TCO


3) The PK<br />

must<br />

uniquely<br />

identify<br />

each entity<br />

instance.<br />

A primary<br />

key must<br />

be able <strong>to</strong><br />

guarantee<br />

unique<br />

values. It<br />

cannot<br />

contain<br />

nulls. This<br />

rationale<br />

belongs <strong>to</strong><br />

_____<br />

(Points :<br />

4)<br />

unique values.<br />

nonintelligent.<br />

preferably single-attribute.<br />

security complaint.<br />

Question<br />

6. 6. (TCO<br />

3) The<br />

extended<br />

entity<br />

relationship<br />

model<br />

(EERM) is<br />

sometimes<br />

referred <strong>to</strong><br />

as the<br />

_____<br />

(Points : 4)<br />

entity relationship model.<br />

enhanced entity relationship model.<br />

entity clustering relationship model.<br />

extended entity relationship doctrine.<br />

Question<br />

7. 7. (TCO<br />

3) A table<br />

that has all<br />

key<br />

attributes<br />

defined,


has no<br />

repeating<br />

groups,<br />

and all its<br />

attributes<br />

are<br />

dependent<br />

on the<br />

primary<br />

key, is<br />

said <strong>to</strong> be<br />

in _____<br />

(Points :<br />

4)<br />

1NF.<br />

2NF.<br />

3NF.<br />

4NF.<br />

BCNF.<br />

Question<br />

8. 8. (TCO<br />

4) When a<br />

constraint<br />

is created<br />

at the<br />

_____<br />

level with<br />

the<br />

CREATE<br />

TABLE<br />

command,<br />

the<br />

constraint<br />

definition<br />

is simply<br />

included<br />

as part of<br />

the<br />

column<br />

definition.<br />

(Points :<br />

4)<br />

table<br />

column<br />

database<br />

row


Top of Form<br />

Top of Form<br />

Bot<strong>to</strong>m of Form<br />

Page 2 <strong>–</strong> Multiple Choice<br />

Question<br />

1. 1. (TCO<br />

4) When<br />

creating a<br />

table,<br />

which of<br />

the<br />

following<br />

statements<br />

is NOT<br />

correct?<br />

(Points :<br />

4)<br />

The schema of the table must be explicitly stated.<br />

A user can have two tables with the same name, as long as the column names are different.<br />

The column list must be enclosed in parentheses ( ).<br />

Default values cannot be assigned <strong>to</strong> all columns in a table.<br />

Question<br />

2. 2. (TCO<br />

4) Which<br />

of the<br />

following<br />

SQL<br />

statements<br />

would you<br />

use <strong>to</strong><br />

create a<br />

table<br />

named<br />

DEVRY?<br />

(Points :<br />

4)<br />

CREATE Devry<br />

(<br />

Student_id NUMBER (12),<br />

Student_name VARCHAR2 (15),


Student_city VARCHAR2 (12)<br />

);<br />

CREATE TABLE Devry<br />

(<br />

Student_id NUMBER (12)<br />

Student_name VARCHAR2 (15)<br />

Student_city VARCHAR2 (12)<br />

);<br />

CREATE TABLE Devry<br />

(<br />

Student_id NUMBER (12),<br />

Student_name VARCHAR2 (15),<br />

Student_city VARCHAR2 (12)<br />

);<br />

CREATE TABLE Devry<br />

Student_id NUMBER (12),<br />

Student_name VARCHAR2 (15),<br />

Student_city VARCHAR2 (12);<br />

Question<br />

3. 3. (TCO<br />

5) The<br />

Crow’s<br />

Foot<br />

model is<br />

more<br />

_____-<br />

oriented<br />

than the<br />

Chen<br />

model.<br />

(Points :<br />

4)<br />

object<br />

user<br />

implementation<br />

processor<br />

Question<br />

4. 4. (TCO<br />

5) Knowing<br />

the _____<br />

number of<br />

entity<br />

occurrences<br />

is very<br />

helpful at<br />

the<br />

application


software<br />

level.<br />

(Points : 4)<br />

maximum<br />

minimum<br />

exact<br />

maximum and minimum<br />

Question<br />

5. 5. (TCO<br />

6) The<br />

_____<br />

statement<br />

can be<br />

used <strong>to</strong><br />

enable or<br />

disable a<br />

constraint.<br />

(Points :<br />

4)<br />

alter table<br />

modify table<br />

create table<br />

update table<br />

Question<br />

6. 6. (TCO 6)<br />

When<br />

modifying the<br />

data<br />

characteristics<br />

of a column<br />

in <strong>Oracle</strong>,<br />

which of the<br />

following is<br />

correct?<br />

(Points : 4)<br />

The column size can be increased.<br />

The size of the column can be decreased.<br />

Changing the default value of a column will change the values of data already in a table.<br />

If a NUMBER column is empty, its precision and scale cannot be changed.<br />

Question<br />

7. 7. (TCO<br />

6) Which<br />

of the<br />

following<br />

keywords<br />

can be


used <strong>to</strong><br />

change the<br />

size,<br />

datatype,<br />

or default<br />

value of<br />

an existing<br />

column?<br />

(Points :<br />

4)<br />

ADD<br />

MODIFY<br />

CHANGE<br />

RESET<br />

Question<br />

8. 8. (TCO<br />

7) Any<br />

type of<br />

subquery<br />

can be<br />

used in the<br />

_____<br />

clause of a<br />

SELECT<br />

statement.<br />

(Points :<br />

4)<br />

WHERE<br />

HAVING<br />

FROM<br />

ORDER BY<br />

GROUP BY<br />

Top of Form<br />

Page 3 <strong>–</strong> Multiple Choice<br />

Question<br />

1. 1. (TCO<br />

7) Which<br />

of the<br />

following<br />

subqueries<br />

returns


more than<br />

one row of<br />

results <strong>to</strong><br />

the outer<br />

query?<br />

(Points :<br />

4)<br />

Multiple-column subquery<br />

Single-row subquery<br />

Multiple-row subquery<br />

Correlated subquery<br />

Question<br />

2. 2. (TCO<br />

7) To list a<br />

unique<br />

value,<br />

where the<br />

list will<br />

produce<br />

only a list<br />

of those<br />

values that<br />

are<br />

different<br />

from one<br />

another,<br />

you will<br />

write the<br />

command<br />

_____<br />

(Points :<br />

4)<br />

SELECT ONLY V-CODE<br />

FROM PRODUCT;.<br />

SELECT UNIQUE V-CODE<br />

FROM PRODUCT;.<br />

SELECT DIFFERENT V-CODE<br />

FROM PRODUCT;.<br />

SELECT DISTINCT V-CODE<br />

FROM PRODUCT;.<br />

Question<br />

3. 3. (TCO 8)<br />

Based upon the<br />

contents of the<br />

BOOK_ORDER<br />

table shown<br />

below, which of<br />

the following


SQL statements<br />

will display the<br />

ship date for<br />

order 1006 as<br />

April 2, 2002?<br />

(Points : 4)<br />

SELECT order#, TO_CHAR(shipdate, ‘fmMonth DD, YYYY’)<br />

FROM book_order;<br />

SELECT order#, TO_DATE(shipdate, ‘fmMonth DD, YYYY’)<br />

FROM book_order;<br />

SELECT order#, TO_CHAR(shipdate, ‘Month DD, YYYY’)<br />

FROM book_order;<br />

SELECT order#, TO_DATE(shipdate, ‘Month DD, YYYY’)<br />

FROM book_order;<br />

Question<br />

4. 4. (TCO<br />

8) Which of<br />

the<br />

following<br />

format<br />

elements<br />

will display<br />

insignificant<br />

leading<br />

zeros?<br />

(Points : 4)<br />

$999<br />

0009999<br />

99.999<br />

9,999.990<br />

Question<br />

5. 5. (TCO<br />

8) Which<br />

of the<br />

following<br />

functions<br />

determines<br />

the<br />

number of<br />

characters<br />

in a<br />

character<br />

string?<br />

(Points :<br />

4)<br />

COUNT<br />

NUMBER


LENGTH<br />

DECODE<br />

Question<br />

6. 6. (TCO<br />

9) The<br />

column <strong>to</strong><br />

be updated<br />

by the<br />

UPDATE<br />

command<br />

is<br />

specified<br />

in the<br />

_____<br />

clause.<br />

(Points :<br />

4)<br />

UPDATE<br />

SET<br />

WHERE<br />

COL<br />

Question<br />

7. 7. (TCO 9)<br />

Using the<br />

promotion<br />

table shown<br />

below, which<br />

of the<br />

following<br />

SQL<br />

statements<br />

will insert a<br />

new row in<strong>to</strong><br />

the<br />

PROMOTION<br />

table?<br />

(Points : 4)<br />

INSERT INTO promotion (gift, minretail, maxretail)<br />

VALUES (FREE BOOK, 75.01, 89.99);<br />

INSERT INTO promotion (gift, minretail, maxretail)<br />

VALUES (‘FREE BOOK’, 75.01, 89.99);<br />

INSERT INTO promotion VALUES (FREE BOOK, 75.01, 89.99);<br />

INSERT INTO promotion (gift, minretail)<br />

VALUES (FREE BOOK, 75.01, 89.99);<br />

Question<br />

8. 8. (TCO


10) Which<br />

of the<br />

following<br />

commands<br />

is used <strong>to</strong><br />

establish a<br />

user<br />

account?<br />

(Points :<br />

4)<br />

CREATE NEW USER username<br />

IDENTIFIED BY password;<br />

CREATE USERNAME username<br />

IDENTITY password;<br />

CREATE USER username PASSWORD password;<br />

CREATE USER username IDENTIFIED BY password;<br />

Question<br />

9. 9. (TCO<br />

10) Which<br />

command<br />

will delete<br />

a user<br />

account<br />

from<br />

<strong>Oracle</strong>9i?<br />

(Points :<br />

4)<br />

DELETE USER username;<br />

DELETE USER username IDENTIFIED BY password;<br />

DROP USER username IDENTIFIED BY password;<br />

DROP USER username;<br />

Top of Form<br />

Bot<strong>to</strong>m of Form<br />

Page 4 <strong>–</strong> Essays<br />

Question 1. 1. (TCO 2) Explain what physical independence means. (Points : 15)<br />

Question 2. 2. (TCO 3) What is a composite primary key and in what situation are they most commonly used? Give<br />

an example. (Points : 15)


Question 3. 3. (TCO 7) Sally needs <strong>to</strong> find all employees who have a date of hire between 01-JAN-2003 and 01-JAN-<br />

2005. She writes and executes the following query.<br />

SELECT emp_no, emp_lname, date_of_hire<br />

FROM emp<br />

WHERE date_of_hire BETWEEN ’01-JAN-2005′ and ’01-JAN-2003′;<br />

When she looks at the returned result set it is empty. Why? (Points : 15)<br />

Question 4. 4. (TCO 8) In a table named ORDER, there is a column named SHIPDATE that contains a date for each<br />

order that has been shipped. Write the query that would show the number of orders that have been shipped. List the<br />

column name as Number of Orders Shipped for this derived column. (Points : 15)<br />

Question 5. 5. (TCO 6) Write the SQL statement that will remove the database table EMPLOYEE. (Points : 15)<br />

Question 1. 1. (TCO 7) Write a join query that for every order placed on September 5, 1998, (use ’05-<br />

SEP-1998′) will list the order number and order date along with the cus<strong>to</strong>mer number, last name, and first<br />

name of the cus<strong>to</strong>mer who placed the order.<br />

(Points : 15)<br />

Question 2. 2. (TCO 8) Write a query that will list the part number, part description, and on-hand value (units on hand<br />

* unit price) for each part in item class AP. Give the expression an alias of on-hand value.<br />

(Points : 15)<br />

Question 3. 3. (TCO 8) Write a subquery that will list the part number, part description, and units on hand of all parts<br />

where the number of units on hand is greater than the average of units on hand for all parts.<br />

(Points : 15)


Question 4. 4. (TCO 7) Using the orders table, write a query that will list the order number, date, and cus<strong>to</strong>mer<br />

number for every order that was made prior <strong>to</strong> September 5, 1998. Format the date in your result set <strong>to</strong> be in the<br />

same format as above (i.e., September 5, 1998).<br />

(Points : 15)<br />

Question 5. 5. (TCO 7) Using a NATURAL JOIN method, write a query that will list the cus<strong>to</strong>mer number, last name,<br />

and first name for every cus<strong>to</strong>mer who currently has an order on file for an iron.<br />

(Points : 15)<br />

Top of Form<br />

Bot<strong>to</strong>m of Form<br />

Bot<strong>to</strong>m of Form<br />

Bot<strong>to</strong>m of Form<br />

Bot<strong>to</strong>m of Form<br />

Bot<strong>to</strong>m of Form

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!