Final Exam >> Databases and SQL for Data Science with Python
1.The ______ statement is called a query, and the output we get from executing the query is called a result set.
1 point
DROP DATABASE
ALTER
CREATE TABLE
2.Which of the following SQL statements will delete the students with the last name Smith?
1 point
DELETE FROM STUDENTS WHERE LAST_NAME FROM ‘Smith’
DELETE FROM STUDENTS WHERE LAST_NAME = ‘Smith’ ✓
DELETE FROM TEACHERS WHERE LAST_NAME = ‘Smith’
DELETE ‘Smith’ FROM STUDENTS
3.What uniquely identifies each row in a table?
1 point
The primary key of a relational table ✓
The textual data
The columns
The secondary key of a relational table
4.What are the basic categories of the SQL language based on functionality?
1 point
Both of the above ✓
Data Definition Language
None of the above
Data Manipulation Language
5.When querying a table called Teachers that contains a list of teachers and the city they teach in, which of the following queries will return the number of teachers from each city?
1 point
SELECT City, count(City) FROM Teachers GROUP BY City ✓
SELECT City, distinct(City) FROM Teachers GROUP BY City
SELECT City, count(City) FROM Teachers
SELECT distinct(City) FROM Teachers
6.You want to retrieve a list of books that have between 450 and 600 pages. Which clause would you add to the following SQL statement: SELECT Title, Pages FROM Book ________________________________
1 point
WHERE Pages 450 – 600
WHERE Pages >= 450 and pages <= 600 ✓
WHERE Pages = 450
IF Pages >= 450 and Pages <= 600
7.Which of the following will retrieve the LOWEST value of SALARY in a table called EMPLOYEES?
1 point
SELECT MIN(SALARY) FROM EMPLOYEES ✓
SELECT SALARY FROM EMPLOYEES WHERE MINIMUM(SALARY) = SALARY
SELECT LOWEST(SALARY) FROM EMPLOYER
SELECT MAX(SALARY) FROM EMPLOYEES
8.Which of the following queries will retrieve the PRODUCT NAME that has the highest price?
1 point
SELECT MAX(UNIT_PRICE) FROM PRODUCTS
SELECT PRODUCT_NAME FROM PRODUCTS WHERE UNIT_PRICE IS HIGHEST
SELECT PRODUCT_NAME FROM PRODUCTS WHERE UNIT_PRICE = MAX
SELECT PRODUCT_NAME FROM PRODUCTS WHERE UNIT_PRICE = (SELECT MAX(UNIT_PRICE) FROM PRODUCTS) ✓
9.A ____________ is a control structure that enables traversal over the records in a database.
1 point
Primary key
Connection
Import
Database cursor ✓
10.To query data from tables in database a connection to the database needs to be established. Which of the following is NOT required to establish a connection with a relational database from a Python notebook?
1 point
Database Name
Hostname or IP address ✓
Table name
Username and Password
Related Questions & Answers:
Graded Quiz: Basic SQL Graded Quiz: Basic SQL >> Databases and SQL for Data Science with Python TOTAL POINTS 5 1.True or ... Read more...
Graded Quiz: Relational DB Concepts and Tables Graded Quiz: Relational DB Concepts and Tables >> Databases and SQL for Data Science with Python 1.Which of the following ... Read more...
Graded Quiz: Refining Your Results Graded Quiz: Refining Your Results >> Databases and SQL for Data Science with Python 1.You want to select author’s last ... Read more...
Graded Quiz: Database access from Python Graded Quiz: Database access from Python >> Databases and SQL for Data Science with Python 1.The ibm_db API provides a ... Read more...