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

Get 20% Discount on This Paper
Pages (550 words)
Approximate price: -

Try it now!

Get 20% Discount on This Paper

We'll send you the first draft for approval by at
Total price:
$0.00

How it works?

Follow these simple steps to get your paper done

Place your order

Fill in the order form and provide all details of your assignment.

Proceed with the payment

Choose the payment system that suits you most.

Receive the final file

Once your paper is ready, we will email it to you.

Our Services

Assignment Help has assembled a team of highly skilled writers with diverse experience in the online writing circles. Our aim is to become a one stop shop for all your Academic/ online writing. Check out below our amazing service!

Essays

Essay Writing Services

At Assignment Help, we prioritize on all aspects that creates a good grade such as impeccable grammar, proper structure, zero-plagiarism, and conformance to guidelines. The principal purpose of essay writing is to present the author's evaluation concerning a singular subject about which they have made. Since Professionalism is the mother of every success, try our team of experienced writers in helping you complete your essays and other assignments.

Admissions

Admission Papers

You have been trying to join that prestigious institution you long yearned for, but the hurdle of an admission essay has become a stumbling block. We have your back, with our proven team that has gained invaluable experience over time, your chance of joining that institution is now! Just let us work on that essay.How do you write an admission essay? How do you begin the essay? For answers, try Quality Custom Writers Now!

Editing

Editing and Proofreading

Regardless of whether you're pleased with your composing abilities, it's never an impractical notion to have a second eye go through your work. The best editing services leaves no mistake untouched. We recognize the stuff needed to polish up a writing; as a component of our editing and proofreading, we'll change and refine your write up to guarantee it's amazing, and blunder free. Our group of expert editors will examine your work, giving an impeccable touch of English while ensuring your punctuation and sentence structures are top-notch.

Coursework

Technical papers

We pride ourselves in having a team of clinical writers. The stringent and rigorous vetting process ensures that only the best persons for job. We hire qualified PhD and MA writers only. We equally offer our team of writers bonuses and incentives to motivate their working spirit in terms of delivering original, unique, and informative content. They are our resources drawn from diverse fields. Therefore your technical paper is in the right hands. Every paper is assessed and only the writers with the technical know-how in that field get to work on it.

Coursework

College Essay Writing

If all along you have been looking for a trustworthy college essay service provider that provides superb academic papers at reasonable prices, then be glad that you search has ended with us. We are your best choice! Get high-quality college essay writing from our magnificent team of knowledgeable and dedicated writers right now!

Coursework

Quality Assignment/Homework Help

We give the students premium quality assignments, without alarming them with plagiarism and referencing issues. We ensure that the assignments stick to the rules given by the tutors. We are specific about the deadlines you give us. We assure you that you will get your papers well in advance, knowing that you will review and return it if there are any changes, which should be incorporated.