Basic sql statements | Computer Science homework help

Question 13ptsIf introduced as follows, the subquery can return which of the values listed below?

WHERE vendor_id NOT IN (subquery)

            a single value

            a column of one or more rows

            a table

            asubquery can’t be introduced in this way

 

Question 2 3 pts If introduced as follows, the subquery can return which of the values listed below?<br>WHERE (subquery)

If introduced as follows, the subquery can return which of the values listed below?

WHERE (subquery)

            a single value

            a column of one or more rows

            a table

            asubquery can’t be introduced in this way

 

 

Question 3 3 pts<div>You can use the AS keyword with the CREATE TABLE statement to create a copy of a table from a ____________________ statement.</div><div></div>

You can use the AS keyword with the CREATE TABLE statement to create a copy of a table from a ____________________ statement.

            FROM

            WHERE

            SELECT

            NONE OF THE THESE CHOICES

 

Question 4 3pts Skip to Question text.

Assuming that all of the table and column names are spelled correctly, what’s wrong with the INSERT statement that follows?

INSERT INTO invoices

(vendor_id, invoice_number, invoice_total, payment_total, credit_total,

terms_id, invoice_date, invoice_due_date)

VALUES

(97, ‘456789’, 8344.50, 0, 0, 1, ’31-AUG-08′)

            The column names in the column list are in the wrong sequence.

            There are too many items in the column list.

            There are too few items in the VALUES list.

            The number of items in the column list doesn’t match the number in the VALUES list.

 

 

 

Question 5 3pts By default, the INSERT, UPDATE, and DELETE statements that you issue don’t make permanent changes to an Oracle database until you issue a _____________________ statement.

By default, the INSERT, UPDATE, and DELETE statements that you issue don’t make permanent changes to an Oracle database until you issue a _____________________ statement.

            Commit

            Rollback

            Save

            Save Changes

 

 

 

Question 6 3 pts<div>A subquery can be coded in a WHERE, FROM, SELECT, or ______________ clause.</div><div></div>

A subquerycan be coded in a WHERE, FROM, SELECT, or ______________ clause.

            Having

            Order By

            group By

            None of these choices

 

 

Question 7 3pts If first_name contains Edward and last_name contains Williams, what will the Solution column contain when this code is executed? LOWER(LEFT(first_name,1) + LEFT(last_name,7)) AS solution

If first_name contains Edward and last_name contains Williams, what will the Solution column contain when this code is executed? LOWER(LEFT(first_name,1) + LEFT(last_name,7)) AS solution

            EWilliams

            EWilliam

            ewilliams

            ewilliam

 

 

 

Question 8 3 ptsWhich uses the least amount of storage?

Which uses the least amount of storage?

            ‘example’ stored in a column of type CHAR(20)

            ‘exam’ stored in a column of type CHAR(20)

            ‘ex’ stored in a column of type CHAR(20)

            they all use the same amount of storage

 

 

 

Question 9 3pts The _____________________ of a numeric data type indicates the total number of digits that can be stored in the data type.

The _____________________ of a numeric data type indicates the total number of digits that can be stored in the data type.

            magnitude

            type

            scale

            precision

 

 

 

Question 10 1 pts All of the following values can be stored in a column that’s defined as NUMBER(6,2), except

All of the following values can be stored in a column that’s defined as NUMBER(6,2), except

            32492.05

            -246.29

            0

            2479.95

 

 

 

Question 11 3 pts The DATE data type can store

The DATE data type can store

            dates only

            dates and times

            times only

            dates and numbers

 

 

 

Question 12 3 ptsWhich uses the least amount of storage?

Which uses the least amount of storage?

            ‘example’ stored in a column of type VARCHAR2(20)

            ‘exam’ stored in a column of type VARCHAR2(20)

            ‘ex’ stored in a column of type VARCHAR2(20)

            they all use the same amount of storage

 

 

 

Question 13 3pts To store an integer with an Oracle data type (not one of the ANSI standard synonyms), you use the ____________________ data type. Pick the best answer.

To store an integer with an Oracle data type (not one of the ANSI standard synonyms), you use the ____________________ data type. Pick the best answer.

            DATE

            NUMBER

            VARCHAR2

            CHAR

 

 

 

Question 14 3 pts Which of the following statements best describes what this INSERT statement does?<br>INSERT INTO invoices_copy<br>SELECT *<br>FROM invoices<br>WHERE terms_id = 1

Which of the following statements best describes what this INSERT statement does?

INSERT INTO invoices_copy

SELECT *

FROM invoices

WHERE terms_id = 1

            Adds one row from the Invoices table to the Invoices_Copy table.

            Adds all of the rows in the Invoices table that have 1 in the terms_id column to the Invoices_Copy table.

            Adds all of the rows in the Invoices table to the Invoices_Copy table and sets the terms_id column to 1 in each row.

            Updates all of the rows in the Invoices_Copy table that have 1 in the TermsID column to the rows in the Invoices table.

 

 

 

Question 15 3 pts<div>When you identify the data elements in a new database, you typically subdivide data elements into</div><div></div>

When you identify the data elements in a new database, you typically subdivide data elements into

            the largest practical components

            the smallest practical components

            components that can be easily parsed each time you use them

            None of these choices

 

 

 

Question 16 3 ptsWhich of the following does not violate the referential integrity of a database?

Which of the following does not violate the referential integrity of a database?

            inserting a new row into a table with a foreign key that doesn’t match a primary key in the related table

            updating a foreign key with a value that doesn’t match a primary key in the related table

            updating a primary key in a primary key table without also updating the foreign keys for the related rows in all related tables

            deleting a row in a foreign key table without deleting the related row in the related primary key table

 

 

 

Question 17 3ptsDenormalization typically results in all but one of the following. Which one is it?

Denormalization typically results in all but one of the following. Which one is it?

            larger tables

            redundant data

            more complicated SQL coding

            reduced performance

 

 

 

Question 18 3pts Skip to Question text.

If expiration_date contains a value that’s equivalent to November 2, 2008 and the SYSDATE function returns a value that’s equivalent to December 17, 2008, what will the exp_days column contain when this code is executed?

expiration_date – SYSDATE AS exp_days

            1.5

            -1.5

            -45

            45

 

 

 

Question 19 3pts To apply the second normal form, you move columns that don’t depend on the entire primary key to another table and establish a relationship between the two tables. This

To apply the second normal form, you move columns that don’t depend on the entire primary key to another table and establish a relationship between the two tables. This

            reduces redundancy and makes maintenance easier

            reduces redundancy but makes maintenance more difficult

            increases redundancy but makes maintenance easier

            increases redundancy but makes the data more consistent

 

 

 

Question 20 3pts You can’t code which one of the following as part of a CREATE TABLE statement:

You can’t code which one of the following as part of a CREATE TABLE statement:

            not null constraints

            column-level constraints

            table-level constraints

            function-based indexes

 

 

 

Question 21 3 ptsWhich of the following is the best way to sort a VARCHAR2 column that contains numbers in numeric sequence? In the ORDER BY clause

Which of the following is the best way to sort a VARCHAR2 column that contains numbers in numeric sequence? In the ORDER BY clause

            use the TO_NUMBER function to convert the column values to numbers

            use the RPAD function to add zeros to the column values

            use the TO_CHAR function to format the all the numbers in the column the same way

            use the TRIM function to trim off any leading zeros in the column so all the numbers will be formatted the same way

 

 

 

Question 22 3pts To model a database on a real-world system, you typically represent each real-world entity as a/an ____________________________.

To model a database on a real-world system, you typically represent each real-world entity as a/an ____________________________.

            table

            view

            diagram

            row

 

 

 

Question 23 3 pts<div>If two tables have a one-to-many relationship, you need to add a _______________________ column to the table on the “many” side.</div><div></div>

If two tables have a one-to-many relationship, you need to add a _______________________ column to the table on the “many” side.

            primary key

            unique key

            foreign key

            None of these choices

 

 

 

Question 24 3pts Typically, most database designers consider a database structure normalized if it’s in the ________________________ normal form.

Typically, most database designers consider a database structure normalized if it’s in the ________________________ normal form.

            first

            second

            third

            fourth

 

 

 

Question 25 3pts<div>Which of the following are reasons we create conceptual models? </div><div></div>

Which of the following are reasons we create conceptual models?

            It facilitates discussion. A picture is worth a thousand words.

            It forms important ideal system documentation.

            It forms a sound basis for physical database design.

            All of these choices

 

 

 

Question 26 3 ptsTo be in the first normal form, each cell in a table must contain

To be in the first normal form, each cell in a table must contain

            a unique value

            a non-unique value

            a single, scalar value

            a non-redundant value

 

 

 

Question 27 3pts Each table in a database should have a _____________________________ that uniquely identifies each row.

Each table in a database should have a _____________________________ that uniquely identifies each row.

            Unique key

            Primary key

            Foreign key

            Check key

 

 

 

Question 28 3 pts Which of the following is not a valid way to avoid search problems when you want to search for rows that have a specific date in a column that’s defined with the DATE data type?

Which of the following is not a valid way to avoid search problems when you want to search for rows that have a specific date in a column that’s defined with the DATE data type?

            use the TRUNC function to truncate the time values from the date value in the column that you’re searching

            search for date values that fall between the day and the day after the date you want

            use the TO_DATE function to remove the time values from the dates in each column

 

 

 

Question 29 3 pts.

Which of the following statements best describes what this SELECT statement does?

SELECT invoice_number, invoice_date,

CASE

WHEN (SYSDATE – invoice_date) >= 30 AND (SYSDATE – invoice_date) < 60

THEN invoice_total

ELSE 0

END AS “30-60”,

CASE

WHEN (SYSDATE – invoice_date) >= 60 AND (SYSDATE – invoice_date) < 90

THEN invoice_total

ELSE 0

END AS “60-90”,

CASE

WHEN (SYSDATE – invoice_date) > 90 THEN invoice_total

ELSE 0

END AS “Over 90”

FROM invoices

            Displays three columns for each invoice with a value in the third column that indicates how many days have elapsed between the invoice date and the current date.

            Displays five columns for each invoice with the invoice total in one of the last three columns based on how many days have elapsed between the invoice date and the current date.

            Displays three columns for each invoice with one of these messages in the third column: 30-60, 60-90, or Over 90.

            Displays five columns for each invoice with a message in one of the last three columns based on how many days have elapsed between the invoice date and the current date.

 

 

 

 

Question 30 3 pts<div>To be in the third normal form,</div><div></div>

To be in the third normal form,

            each non-key column must depend only on the primary key

            each non-key column must not depend on the primary key

            each non-key column must contain repeating values

            all of these choices

 

 

 

Question 31 3 pts<div>In a physical data model, an attribute is represented as a/an </div><div></div>

In a physical data model, an attribute is represented as a/an

            Foreign Key

            column

            row

            instance

 

 

 

Question 32 3pts<div>In a business that sells computers, choose the best relationship name from CUSTOMER to ITEM (computer, in this case). ?</div><div></div>

In a business that sells computers, choose the best relationship name from CUSTOMER to ITEM (computer, in this case). ?

            Each CUSTOMER must be the buyer of one or more ITEMS.

            Each CUSTOMER may be the maker of one or more ITEMS.

            Each CUSTOMER may be the producer of one or more ITEMS.

            Each CUSTOMER must be the seller of one or more ITEMS.

 

 

 

Question 33 3 pts<div>When you resolve a M-M (many-to-many) relationship by creating an intersection entity, this new entity will always inherit: </div><div></div>

When you resolve a M-M (many-to-many) relationship by creating an intersection entity, this new entity will always inherit:

            The attributes of both related entities.

            A relationship to each entity from the original M-M.

            The UID’s from the entities in the original M-M.

            Nothing is inherited from the original entities and relationship.

 

 

 

Question 34 3pts<div>What is a NULL value? </div><div></div>

What is a NULL value?

            A perfect zero

            A known value less than zero

            An unknown value

            A blank space







Calculate Your Essay Price
(550 words)

Approximate price: $22

Calculate the price of your order

550 words
We'll send you the first draft for approval by September 11, 2018 at 10:52 AM
Total price:
$26
The price is based on these factors:
Academic level
Number of pages
Urgency
Basic features
  • Free title page and bibliography
  • Unlimited revisions
  • Plagiarism-free guarantee
  • Money-back guarantee
  • 24/7 support
On-demand options
  • Writer’s samples
  • Part-by-part delivery
  • Overnight delivery
  • Copies of used sources
  • Expert Proofreading
Paper format
  • 275 words per page
  • 12 pt Arial/Times New Roman
  • Double line spacing
  • Any citation style (APA, MLA, Chicago/Turabian, Harvard)

Our guarantees

Delivering a high-quality product at a reasonable price is not enough anymore.
That’s why we have developed 5 beneficial guarantees that will make your experience with our service enjoyable, easy, and safe.

Money-back guarantee

You have to be 100% sure of the quality of your product to give a money-back guarantee. This describes us perfectly. Make sure that this guarantee is totally transparent.

Read more

Zero-plagiarism guarantee

Each paper is composed from scratch, according to your instructions. It is then checked by our plagiarism-detection software. There is no gap where plagiarism could squeeze in.

Read more

Free-revision policy

Thanks to our free revisions, there is no way for you to be unsatisfied. We will work on your paper until you are completely happy with the result.

Read more

Privacy policy

Your email is safe, as we store it according to international data protection rules. Your bank details are secure, as we use only reliable payment systems.

Read more

Fair-cooperation guarantee

By sending us your money, you buy the service we provide. Check out our terms and conditions if you prefer business talks to be laid out in official language.

Read more

Order your essay today and save 10% with the coupon code: best10