In: Computer Science
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 |
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.