Question

In: Computer Science

Regarding Python and Scripting 1. What SQL clause is used to combine rows from two or...

Regarding Python and Scripting

1. What SQL clause is used to combine rows from two or more tables, based on a related column in a relational database.

Question options:

CONNECT

JOIN

WHERE

2. The highlighted portion of this program output indicates ____________.

Tracks:

(u'Thunderstruck', 20)

(u'My Way', 15)

Question options:

Unknown values that are recently inserted into the Tracks table

Unicode strings that are capable of storing non-Latin character sets

Universal variables that can fit into any column

3. In technical descriptions of relational databases, the concept of column is formally referred to as ____________.

Question options:

dictionary

variable

attribute

4. What is wrong with this SELECT statement?

SELECT FirstName LastName

FROM TableName

Question options:

This SELECT statement has no errors

A comma is missing between the field names

A table name is missing from the SELECT statement

5. What is meant by this error message in the SQL query window:

Cannot insert explicit value for identity column in table 'Tracks'

Question options:

It means that the identity field has a specified value or is auto-incremented, so a value shouldn't be forced into the field.

It means that the identity field has an unspecified variable or is auto-incremented, so a value should be entered manually.

It means that the identity field has an automated constant attribute, so a value can only be entered remotely.

6. What is returned by this SQL SELECT statement?

SELECT LoginID, JobTitle, BirthDate

FROM Employee                                                       

WHERE JobTitle Like '%Engineer%'                   

Question options:

All rows that contain the word "Engineer"

All rows where the JobTitle field ends with the word "Engineer"

All rows where the JobTitle field equals Engineer

7. An integer that is automatically assigned by the database to link rows from different tables together is referred to as ______________.

Question options:

auto link

primary key

foreign integer

8. Which of the following conclusions about the table Follows is INCORRECT?

CREATE TABLE Follows

(from_id INTEGER, to_id INTEGER, UNIQUE(from_id, to_id) )

Question options:

The table contains two columns

The table contains two rows

Columns in the table only takes integer values

Solutions

Expert Solution

1. JOIN

let there are two tables Table1 and Table2

SELECT Table1.C1, Table2.C2

FROM Table1

JOIN Table2

ON Table1.C3=Table2.C4.

Here the JOIN clause combines the rows of Table1 and table2 based on the related coumn C3 and C4 in Table1 and Table2 respectively. Note that C3 and C4 are the matching columns.

2.  Unicode strings that are capable of storing non-Latin character sets

prefix 'u' before a quote in python means that unicode string is to be created.

3. Attribute

Columns are reffered to as attributes  in relational database

4. A comma is missing between the field names

While using multiple table in the SELECT cause, the tables names are seperated using a comma.

5. It means that the identity field has an unspecified variable or is auto-incremented

When there is an identity column in the table the the server automatically generates that ID value. It can not be readily speciffied by th user.

6. All rows that contain the word "Engineer"

It is beacuse there is % in both ends of the word "Engineer", it means there can be text before and after "Engineer".

7. auto link

Since both primary key and foreign can be non integers values and they have to be specified by the database administrator, therefore by elimination technique we can conclude that the answer to the question is auto key.

8. The table contains two rows

The sql statement will create a table with twop columns and it is specified that both the columns will take integer values.


Related Solutions

Regarding a "No Damage For Delay Clause", answer the following: What is it and why is...
Regarding a "No Damage For Delay Clause", answer the following: What is it and why is it important for a General Contractor to know if its Owner contract contains one? Under what circumstances is a "No Damage For Delay Clause" unenforceable or stated another way, when will a Court refuse to apply a "No Damage For Delay Clause" as written?
What is an SQL? Is SQL a standard? Explain. 1B- What are the two categories of...
What is an SQL? Is SQL a standard? Explain. 1B- What are the two categories of SQL statements. Give examples for each category. 2- Consider the logical schema below: PET_OWNER(OWNER_ID [N, 18], FIRST_NAME [A, 250], LAST_NAME [A, 250], PHONE [A, 50], EMAIL [A, 250]) PET(PET_ID [N, 18], PET_NAME [N, 18], PET_TYPE [A, 20], BREED [A, 50], DOB [D, 10], OWNER_ID [N, 18]) A- Write an SQL statement to create a database named PET_OWNER_DB B- Write SQL statements to create PET_OWNER...
PHP/SQL Lab 1 Consider the banking example we used in the SQL in-class exercises: branch (branch-name,...
PHP/SQL Lab 1 Consider the banking example we used in the SQL in-class exercises: branch (branch-name, branch-city, assets) customer (customer-name, customer-street, customer-city) account (account-number, branch-name, balance) loan (loan-number, branch-name, amount) depositor (customer-name, account-number) borrower (customer-name, loan-number) Write PHP code for the following problems: 1. Create a php file to display the names and cities of customers who have an account at Downtown branch from the web. 2. Create the corresponding html and php files so that a user can insert...
The two rows of data below come from recorded weights of young mice raised on two...
The two rows of data below come from recorded weights of young mice raised on two different diets, labeled S1 and S2. Use these two datasets to address the following questions. S1 5.85 6.85 7.16 5.43 5.03 6.48 3.89 5.44 6.88 5.37 S2 4.52 5.29 5.74 5.48 3.74 4.61 4.00 4.67 4.87 5.12 a) Imagine you want to conduct a conventional parametric test of H0: μ1 = μ2 versus H1: μ1 not equal to μ2. What test would you use,...
What is the meaning and the policies stemming from a most favored nation clause. Are such...
What is the meaning and the policies stemming from a most favored nation clause. Are such clauses in effect today for the USA? What is the role of the WTO in regards to the most favored nation clause?
PYTHON!!!! Exercise 1 - Darcy-Weisbach GUI Let's combine all of our Darcy-Weisbach formulas, give it a...
PYTHON!!!! Exercise 1 - Darcy-Weisbach GUI Let's combine all of our Darcy-Weisbach formulas, give it a graphical interface (and finally put it to rest!). Combine your Darcy-Weisbach formula from Assignment 4 with your improved function for fD for turbulent flow in Assignment 6 (leave it as a function and have your formula call it for the turbulent flow condition). Then create a GUI for your formula to enter the length, diameter and velocity input values, and display the resulting pressure...
1 – Create a webpage that contains a table with exactly three rows and two columns....
1 – Create a webpage that contains a table with exactly three rows and two columns. The first row will contain a table heading containing the name of a US National Park, that spans across all columns. Hint: use the colspan attribute inside the opening th tag Give the table heading an onmouseover that will change the text of the heading when it is moused over to read My Favorites Park! (Hint: use innerHTML). Use onmouseout to change it back....
Q.1: create a python function that takes two integers from the user ( pass them from...
Q.1: create a python function that takes two integers from the user ( pass them from the main program). The function performs the addition operation and returns the result. In the program, ask the user to guess the result. Then, the program compares the user input ( guess) with the returned value, and displays a message that tells if the user guessing is correct or not. --define the function here --- # the program starts here print(“ This program tests...
Regarding Python. 1. How would you write a regex that matches the hour of the day...
Regarding Python. 1. How would you write a regex that matches the hour of the day from the extracted line shown below? (The highlighted portion) From [email protected] Sat Jan 5 09:14:16 2008 Question options: ˆFrom .+ [0-9] ˆX-.*: [0-9.]+ [0-9]: ˆFrom .* [0-9][0-9]: ˆFrom .* ('ˆX\S*: ([0-9.]+)', line) A _____________ sign at the end of the regular expression indicates that the string must end with the specified regex pattern. Question options: question (?) caret (^) dollar ($) 0 / 1...
1. a)What is your null hypothesis regarding sepal lengths for the two species? And what is...
1. a)What is your null hypothesis regarding sepal lengths for the two species? And what is your alternate hypothesis? b) Describe your hypotheses in terms of your test statistic: what would be the t under the null hypothesis, H0, and what would be the statement about t under your alternate hypothesis Ha?  Would you do a one- or non-(i.e., two-sided) directional test? Why? Sepal.Length Species 6.1 versicolor 6.3 versicolor 6.1 versicolor 5.5 versicolor 5.5 versicolor 5.8 versicolor 5.8 versicolor 5 versicolor...
ADVERTISEMENT
ADVERTISEMENT
ADVERTISEMENT