Levels Tought:
Elementary,Middle School,High School,College,University,PHD
Teaching Since: | Apr 2017 |
Last Sign in: | 4 Weeks Ago |
Questions Answered: | 7559 |
Tutorials Posted: | 7341 |
BS,MBA, PHD
Adelphi University/Devry
Apr-2000 - Mar-2005
HOD ,Professor
Adelphi University
Sep-2007 - Apr-2017
CIS 111 SOPHIA-STRAYER Introduction to Relational Database Management Systems Unit 5 Final Exam -sobtell.com
Click link for Answers All Correct
1
In each milestone, you may want or need to use the database and query tool to answer some of the questions. We suggest you open the tool in another browser tab while you are working on this assessment.
https://postgres.sophia.org/
Which of the following is a correctly formatted INSERT statement that will insert three records into the playlist table?
•         Â
insert into playlist (name,playlist_id) values (40, 'Top 40'), (41, 'Top 40'), (42, 'Top 40')
•         Â
insert into playlist (playlist_id, name) values (40, 'Top 40'), (41, 'Top 40'), (42, 'Top 40')
•         Â
insert into playlist (playlist_id, name) values (40, 'Top 40'), (40, 'Top 41'), (40, 'Top 42')
•         Â
insert into playlist (playlist_id, name) values (40, 'Top 40') (41, 'Top 40') (42, 'Top 40')
2
In each milestone, you may want or need to use the database and query tool to answer some of the questions. We suggest you open the tool in another browser tab while you are working on this assessment.
https://postgres.sophia.org/
Using the WHERE clause, filter the employee table to include individuals that live in Edmonton.
Identify the title of the individual(s) listed.
•         Â
IT Sales Manager
•         Â
Sales Support Agent
•         Â
Andrew
•         Â
General Manager
3
In each milestone, you may want or need to use the database and query tool to answer some of the questions. We suggest you open the tool in another browser tab while you are working on this assessment.
https://postgres.sophia.org/
Which of the following is a correctly formatted INSERT statement that will successfully add a record into the genre table?
•         Â
insert into genre (genre_id, name) values (30, 'Funk' )
•         Â
insert into genre (genre_id, name) values ('Funk',35)
•         Â
insert into genre (genre_id, name) values (40, Funk)
•         Â
insert into genre (genre_id, name) values (19, 'Funk' )
4
In each milestone, you may want or need to use the database and query tool to answer some of the questions. We suggest you open the tool in another browser tab while you are working on this assessment.
Â
https://postgres.sophia.org/
Identify the correctly constructed ALTER TABLE statement that removes the address column from the customer table.
•         Â
ALTER TABLE customer DROP home_address;
•         Â
ALTER TABLE customer DROP address VARCHAR (100);
•         Â
ALTER TABLE customer DROP address;
•         Â
ALTER TABLE customer ADD address;
5
In each milestone, you may want or need to use the database and query tool to answer some of the questions. We suggest you open the tool in another browser tab while you are working on this assessment.
https://postgres.sophia.org/
Which of the following would set the postal_code of the customer with the customer_id equal to 22, to 33433.
•         Â
UPDATE customer
IN postal_code = '33433'
WHERE customer_id = 22
•         Â
UPDATE customer
SET postal_code
WHERE customer_id = '33433'
•         Â
UPDATE customer
WHERE customer_id = 22
SET postal_code = '33433'
•         Â
UPDATE customer
SET postal_code = '33433'
WHERE customer_id = 22
6
In each milestone, you may want or need to use the database and query tool to answer some of the questions. We suggest you open the tool in another browser tab while you are working on this assessment.
https://postgres.sophia.org/
Given the tables provided, which of the following DROP TABLE series of statements would correctly remove the tables without causing an error?
•         Â
DROP TABLE invoice;
DROP TABLE invoice_line;
DROP TABLE customer;
•         Â
DROP TABLE playlist_track;
DROP TABLE invoice_line;
DROP TABLE invoice;
•         Â
DROP TABLE playlist_track
DROP TABLE playlist;
DROP TABLE genre;
•         Â
DROP TABLE genre;
DROP TABLE album;
DROP TABLE artist;
7
In each milestone, you may want or need to use the database and query tool to answer some of the questions. We suggest you open the tool in another browser tab while you are working on this assessment.
https://postgres.sophia.org/
Consider the following new table:
CREATE TABLE surveylist(
surveylist_id SERIAL PRIMARY KEY,
email VARCHAR NOT NULL,
phone VARCHAR
);
Given this new table, which INSERT statement would query from the customer table to insert the email and phone of all customers in the right columns?
•         Â
INSERT INTO surveylist (surveylist_id, email, phone)
SELECT email, phone FROM customer;
•         Â
INSERT INTO surveylist (email, phone)
SELECT phone, email FROM customer;
•         Â
INSERT INTO surveylist (email, phone)
SELECT email, phone FROM customer;
•         Â
INSERT INTO surveylist
SELECT email, phone FROM customer;
8
In each milestone, you may want or need to use the database and query tool to answer some of the questions. We suggest you open the tool in another browser tab while you are working on this assessment.
https://postgres.sophia.org/
Using the SELECT statement, query the track table to find the average length of a track that has the genre_id equal to 5, rounded to the nearest millisecond.
•         Â
394489
•         Â
134644
•         Â
134643.5
•         Â
134643
9
In each milestone, you may want or need to use the database and query tool to answer some of the questions. We suggest you open the tool in another browser tab while you are working on this assessment.
Â
https://postgres.sophia.org/
Identify the correctly constructed ALTER TABLE statement to add a UNIQUE constraint to the column student_number with the constraint name student_number_unique on the table called 'student'.
•         Â
ALTER TABLE student ADD UNIQUE student_number CONSTRAINT (student_number_unique);
•         Â
ALTER TABLE student ADD CONSTRAINT student_number_unique UNIQUE (student_number);
•         Â
ALTER TABLE student ADD CONSTRAINT student_number UNIQUE (student_number_unique);
•         Â
ALTER TABLE student ADD CONSTRAINT student_number UNIQUE (student_number);
10
In each milestone, you may want or need to use the database and query tool to answer some of the questions. We suggest you open the tool in another browser tab while you are working on this assessment.
https://postgres.sophia.org/
Using the WHERE and HAVING clauses, filter the track table for the tracks having the milliseconds greater than 100,000, grouped by the album_id having the number of tracks greater than 20. Provide the list of album_id's and the count of tracks that fit these criteria.
Which of the following queries would provide the correct results?
•         Â
SELECT album_id, count(track_id)
FROM track
WHERE count(track_id) > 20
GROUP BY album_id
HAVING milliseconds > 100000
•         Â
SELECT album_id, sum(track_id)
FROM track
WHERE milliseconds > 100000
GROUP BY album_id
HAVING sum(track_id) > 20
•         Â
SELECT album_id, count(track_id)
FROM track
WHERE milliseconds > 100000
GROUP BY album_id
HAVING count(track_id) > 20
•         Â
SELECT album_id, count(track_id)
FROM track
GROUP BY album_id
HAVING count(track_id) > 20
WHERE milliseconds > 100000
11
In each milestone, you may want or need to use the database and query tool to answer some of the questions. We suggest you open the tool in another browser tab while you are working on this assessment.
https://postgres.sophia.org/
Which of these SELECT statements would successfully display exactly five columns of data from the customer table?
•         Â
SELECT customer_id, city_id, state_id, phone_id, company_id
FROM customer;
•         Â
SELECT customer_id + city + state + phone + company
FROM customer
•         Â
SELECT *
FROM customer;
•         Â
SELECT customer_id, city, state, phone, company
FROM customer;
12
In each milestone, you may want or need to use the database and query tool to answer some of the questions. We suggest you open the tool in another browser tab while you are working on this assessment.
https://postgres.sophia.org/
Using the SELECT statement, query the invoice table to find the average total cost for all orders placed between 2010-01-01 and 2011-01-01.
•         Â
5.85542168674698
•         Â
0
•         Â
5.66265060240963
•         Â
5.7063106796116505
13
In each milestone, you may want or need to use the database and query tool to answer some of the questions. We suggest you open the tool in another browser tab while you are working on this assessment.
https://postgres.sophia.org/
Using the GROUP BY clause and the count aggregate function, filter the track table to group the tracks based on album_id.
How many tracks are in album 99?
•         Â
12
•         Â
13
•         Â
10
•         Â
11
14
In each milestone, you may want or need to use the database and query tool to answer some of the questions. We suggest you open the tool in another browser tab while you are working on this assessment.
https://postgres.sophia.org/
Using the SELECT statement, query the invoice table to find the maximum invoice_date where the billing_country is equal to Canada.
•         Â
2009-01-01
•         Â
2013-12-22
•         Â
2013-12-21
•         Â
2013-12-06
15
In each milestone, you may want or need to use the database and query tool to answer some of the questions. We suggest you open the tool in another browser tab while you are working on this assessment.
https://postgres.sophia.org/
Select the correctly constructed CHECK constraint to validate the date_of_birth column of type data, to ensure that values placed into it are greater than 1850-01-01
•         Â
CHECK (date_of_birth < '1850-01-01')
•         Â
CHECK (date_of_birth >= '1850-01-01')
•         Â
CHECK (date_of_birth > '1850-01-01')
•         Â
CHECK (date_of_birth > 1850-01-01)
16
In each milestone, you may want or need to use the database and query tool to answer some of the questions. We suggest you open the tool in another browser tab while you are working on this assessment.
https://postgres.sophia.org/
Using the IN operator, filter the album table to find those with the artist ID set to 8, 17, 22, or 3.
Identify the title of the 4th record.
•         Â
Out of Exile
•         Â
Minha Historia
•         Â
Big Ones
•         Â
Coda
17
In each milestone, you may want or need to use the database and query tool to answer some of the questions. We suggest you open the tool in another browser tab while you are working on this assessment.
https://postgres.sophia.org/
Â
Consider the following table:
CREATE TABLE video(
video_id SERIAL PRIMARY KEY,
video_name VARCHAR NOT NULL
);
Which of the following is a correctly formatted INSERT statement that will successfully add a new record that uses the auto-incremented primary key into this table?
•         Â
insert into video (video_id, video_name) values (1, 'home video - first day of school' )
•         Â
insert into video (video_name) values ('home video - first day of school' )
•         Â
insert into video (video_name) values (home video - first day of school)
•         Â
insert into video (video_id, video_name) values (nextval, 'home video - first day of school')
18
In each milestone, you may want or need to use the database and query tool to answer some of the questions. We suggest you open the tool in another browser tab while you are working on this assessment.
https://postgres.sophia.org/
Using the SELECT statement, query the customer table to find the number of customers that live in the country Canada.
•         Â
8
•         Â
59
•         Â
51
•         Â
7
19
In each milestone, you may want or need to use the database and query tool to answer some of the questions. We suggest you open the tool in another browser tab while you are working on this assessment.
Â
https://postgres.sophia.org/
Using the LIKE operator in the WHERE clause, use the necessary wildcards to filter the album table to find the albums that have a year starting with 19 in the title.
Identify the 4th album ID.
•         Â
196
•         Â
104
•         Â
123
•         Â
146
20
In each milestone, you may want or need to use the database and query tool to answer some of the questions. We suggest you open the tool in another browser tab while you are working on this assessment.
https://postgres.sophia.org/
Which of the following statement(s) would successfully delete the invoice_id 280 from the invoice table?
•         Â
DELETE FROM invoice WHERE invoice_id = 280;
DELETE FROM invoice_line WHERE invoice_id = 280;
•         Â
DELETE FROM invoice WHERE invoice_id = 280;
•         Â
DELETE FROM invoice_line WHERE invoice_id = 280;
DELETE FROM invoice WHERE invoice_id = 280;
•         Â
DELETE FROM invoice_line WHERE invoice_id = 280;
21
In each milestone, you may want or need to use the database and query tool to answer some of the questions. We suggest you open the tool in another browser tab while you are working on this assessment.
https://postgres.sophia.org/
Using the SELECT statement, query the track table to find the total price for all tracks that have the genre_id not equal to 1.
•         Â
1284.03
•         Â
3552.27
•         Â
0.99
•         Â
2396.94
22
In each milestone, you may want or need to use the database and query tool to answer some of the questions. We suggest you open the tool in another browser tab while you are working on this assessment.
https://postgres.sophia.org/
Which of these constraints uses multiple fields as a primary key?
•         Â
COMPOSITE KEY
•         Â
CHECK
•         Â
FOREIGN KEY
•         Â
UNIQUE
23
In each milestone, you may want or need to use the database and query tool to answer some of the questions. We suggest you open the tool in another browser tab while you are working on this assessment.
Â
https://postgres.sophia.org/
What is the main function of the FROM clause in SQL?
•         Â
To identify one or more tables as the source for a query
•         Â
To apply conditions to filter the dataset
•         Â
To retrieve zero or more rows from one or more database columns
24
In each milestone, you may want or need to use the database and query tool to answer some of the questions. We suggest you open the tool in another browser tab while you are working on this assessment.
https://postgres.sophia.org/
Using the ORDER BY clause, sort the customer table by the company name of the customer in ascending order and identify the 10th company name in the list from among the answer options.
•         Â
Murray
•         Â
Woodstock Discos
•         Â
Martins
•         Â
null
25
In each milestone, you may want or need to use the database and query tool to answer some of the questions. We suggest you open the tool in another browser tab while you are working on this assessment.
https://postgres.sophia.org/
Given the customer table and the data that it contains, and assuming that you have the rights to modify the table, which of the following ALTER TABLE statements would create an error?
•         Â
ALTER TABLE customer ALTER COLUMN postal_code TYPE VARCHAR (100);
•         Â
ALTER TABLE customer ALTER COLUMN state TYPE VARCHAR (100);
•         Â
ALTER TABLE customer ALTER COLUMN city TYPE VARCHAR (100);
•         Â
ALTER TABLE customer ALTER COLUMN state VARCHAR (100);
26
In each milestone, you may want or need to use the database and query tool to answer some of the questions. We suggest you open the tool in another browser tab while you are working on this assessment.
Â
https://postgres.sophia.org/
The following CREATE TABLE statement creates a table called 'users' that consists of the user_id as the primary key, the username, and the password.
Â
CREATE TABLE users(
user_id int PRIMARY KEY,
username VARCHAR 50,
password VARCHAR (50)
);
Identify the line of code that would generate an error in this CREATE TABLE statement.
•         Â
1
•         Â
3
•         Â
4
•         Â
2
27
In each milestone, you may want or need to use the database and query tool to answer some of the questions. We suggest you open the tool in another browser tab while you are working on this assessment.
https://postgres.sophia.org/
Identify the SQL command that uses an aggregate function that could be used to find the youngest employee in the employee table.
•         Â
SELECT min(birth_date) FROM employee;
•         Â
SELECT max(birth_date) FROM employee;
•         Â
SELECT count(birth_date) FROM employee;
•         Â
SELECT max birth_date FROM employee;
28
In each milestone, you may want or need to use the database and query tool to answer some of the questions. We suggest you open the tool in another browser tab while you are working on this assessment.
Â
https://postgres.sophia.org/
Using the BETWEEN operator, filter the album table to find the albums with an artist ID between 5 and 10.
Identify the 5th album ID.
•         Â
12
•         Â
11
•         Â
7
•         Â
9
29
In each milestone, you may want or need to use the database and query tool to answer some of the questions. We suggest you open the tool in another browser tab while you are working on this assessment.
Â
https://postgres.sophia.org/
Using the LIKE operator in the WHERE clause, filter the customer table to list the individuals located in a country that ends with the lowercase 'a.'
Identify the 5th individual's country.
•         Â
Australia
•         Â
Canada
•         Â
Austria
•         Â
USA
30
In each milestone, you may want or need to use the database and query tool to answer some of the questions. We suggest you open the tool in another browser tab while you are working on this assessment.
Â
https://postgres.sophia.org/
Using the WHERE clause, filter the invoice table to find the invoices that were dated after March 1st, 2009.
Identify the first customer ID of the invoice.
•         Â
2
•         Â
17
•         Â
19
•         Â
16
31
In each milestone, you may want or need to use the database and query tool to answer some of the questions. We suggest you open the tool in another browser tab while you are working on this assessment.
https://postgres.sophia.org/
USING the SELECT statement, query the track table ordered by the track_id. Set the LIMIT to 5 and OFFSET to 18.
What is the name of the last row returned?
•         Â
Problem Child
•         Â
Love In An Elevator
•         Â
Whole Lotta Rosie
•         Â
Walk on Water
32
In each milestone, you may want or need to use the database and query tool to answer some of the questions. We suggest you open the tool in another browser tab while you are working on this assessment.
https://postgres.sophia.org/
Given the employee table and the data that it contains, and assuming that you have the rights to modify the table, which of the following ALTER TABLE statements would work without errors?
•         Â
ALTER TABLE employee ALTER employee_id TYPE VARCHAR (100);
•         Â
ALTER TABLE employee ALTER COLUMN email TYPE int;
•         Â
ALTER TABLE employee ALTER COLUMN email TYPE TEXT;
•         Â
ALTER TABLE customer ALTER COLUMN city TYPE int;
33
In each milestone, you may want or need to use the database and query tool to answer some of the questions. We suggest you open the tool in another browser tab while you are working on this assessment.
https://postgres.sophia.org/
Which of the following would set the company of the customers that live in the city of Prague to Humor Inc.?
•         Â
UPDATE customer
SET company = 'Humor Inc.'
WHERE city = 'Prague'
•         Â
UPDATE customer
SET company = Humor Inc.
WHERE city = 'Prague'
•         Â
UPDATE customer
SET company = 'Humor Inc.'
AND city = 'Prague'
•         Â
UPDATE customer
WHERE city = 'Prague'
SET company = 'Humor Inc.'
34
In each milestone, you may want or need to use the database and query tool to answer some of the questions. We suggest you open the tool in another browser tab while you are working on this assessment.
https://postgres.sophia.org/
The following CREATE TABLE statement creates a table called 'artist' that consists of the artist_id as the primary key that is auto-incremented, the first_name, and the last_name.
Â
CREATE TABLE artists(
artist_id serial INT,
first_name VARCHAR (50),
last_name VARCHAR (50)
);
Identify the line of code that would either generate a syntax, logical, or requirements error in this CREATE TABLE statement.
•         Â
1
•         Â
2
•         Â
4
•         Â
3
35
In each milestone, you may want or need to use the database and query tool to answer some of the questions. We suggest you open the tool in another browser tab while you are working on this assessment.
Â
https://postgres.sophia.org/
Using the AND or OR statement, filter the employee table for employees who have a title starting with Sales and an address containing Ave.
Identify the last name of the 3rd record.
•         Â
Margaret
•         Â
Peacock
•         Â
Steve
•         Â
Johnson
36
In each milestone, you may want or need to use the database and query tool to answer some of the questions. We suggest you open the tool in another browser tab while you are working on this assessment.
https://postgres.sophia.org/
Using the GROUP BY and HAVING clauses, filter the customer table by country.
How many countries have less than 5 customers?
•         Â
18
•         Â
2
•         Â
3
•         Â
20
Â
1
In each milestone, you may want or need to use the database and query tool to answer some of the questions. We suggest you open the tool in another browser tab while you are working on this assessment.
https://postgres.sophia.org/
Which of the following would set the track name to "A New Road" for the track with a track_id equal to 5?
•         Â
UPDATE track
set name = A New Road
where track_id = 5
•         Â
UPDATE track
set name in 'A New Road'
where track_id = 5
•         Â
UPDATE track
set name = 'A New Road'
where track_id = 5
•         Â
UPDATE track
set name = 'A New Road'
where album_id = 5
2
In each milestone, you may want or need to use the database and query tool to answer some of the questions. We suggest you open the tool in another browser tab while you are working on this assessment.
https://postgres.sophia.org/
Â
Consider the following new table:
CREATE TABLE locationlist(
locationlist_id SERIAL PRIMARY KEY,
city VARCHAR NOT NULL,
country VARCHAR NOT NULL,
postal_code VARCHAR
);
Given this new table, which INSERT statement would query from the customer table to insert the city, country, and postal_code of all customers in the right columns?
•         Â
INSERT INTO locationlist (city, country, postal_code)
SELECT city, country, postal_code FROM customer;
•         Â
INSERT INTO locationlist (postal_code, country, city)
SELECT city, country, postal_code FROM customer;
•         Â
INSERT INTO locationlist
SELECT city, country, postal_code FROM customer;
•         Â
INSERT INTO locationlist (locationlist_id, city, country, postal_code)
SELECT city, country, postal_code FROM customer;
3
In each milestone, you may want or need to use the database and query tool to answer some of the questions. We suggest you open the tool in another browser tab while you are working on this assessment.
https://postgres.sophia.org/
Using the GROUP BY clause and the count aggregate function, filter the track table to group the tracks based on album_id.
How many tracks are in album 8?
•         Â
14
•         Â
2
•         Â
1
•         Â
10
4
In each milestone, you may want or need to use the database and query tool to answer some of the questions. We suggest you open the tool in another browser tab while you are working on this assessment.
https://postgres.sophia.org/
Which of the following is a correctly formatted INSERT statement that will successfully add a record into the playlist table?
•         Â
insert into playlist (playlist_id, name) values (30, 'New Age Playlist' )
•         Â
insert into playlist (playlist_id, name) values (40, New Age Playlist)
•         Â
insert into playlist (playlist_id, name) values ('New Age Playlist', 35)
•         Â
insert into playlist (playlist_id, name) values ('New Age Playlist' )
5
In each milestone, you may want or need to use the database and query tool to answer some of the questions. We suggest you open the tool in another browser tab while you are working on this assessment.
https://postgres.sophia.org/
Using the GROUP BY and HAVING clauses, filter the customer table by country.
How many countries have less than 2 customers?
•         Â
18
•         Â
15
•         Â
17
•         Â
0
6
In each milestone, you may want or need to use the database and query tool to answer some of the questions. We suggest you open the tool in another browser tab while you are working on this assessment.
Â
https://postgres.sophia.org/
The following CREATE TABLE statement creates a table called 'album' that consists of the album_id as the primary key, the title, and the artist_id.
Â
CREATE TABLE album(
album_id int PRIMARY KEY
title VARCHAR (160),
artist_id int
);
Identify the missing item that would generate an error in this CREATE TABLE statement.
•         Â
Missing comma
•         Â
Missing column name
•         Â
Missing data type
•         Â
Missing parentheses
7
In each milestone, you may want or need to use the database and query tool to answer some of the questions. We suggest you open the tool in another browser tab while you are working on this assessment.
https://postgres.sophia.org/
Consider the following table:
Â
CREATE TABLE artwork(
artwork_id SERIAL PRIMARY KEY,
artwork_name VARCHAR NOT NULL
);
Which of the following is a correctly formatted INSERT statement that will successfully add a new record that uses the auto-incremented primary key into this table?
•         Â
insert into artwork (artwork_id, artwork_name) values (nextval, 'Mona Lisa')
•         Â
insert into artwork (artwork_id, artwork_name) values (1, 'Mona Lisa' )
•         Â
insert into artwork (artwork_name) values ('Mona Lisa' )
•         Â
insert into artwork (artwork_name) values (Mona Lisa)
8
In each milestone, you may want or need to use the database and query tool to answer some of the questions. We suggest you open the tool in another browser tab while you are working on this assessment.
Â
https://postgres.sophia.org/
Which of these constraints verifies that data in a column is based on columns in other tables?
•         Â
PRIMARY KEY
•         Â
CHECK
•         Â
FOREIGN KEY
•         Â
UNIQUE
9
In each milestone, you may want or need to use the database and query tool to answer some of the questions. We suggest you open the tool in another browser tab while you are working on this assessment.
https://postgres.sophia.org/
Which of the following would set the media_type_id to 1 on all tracks where the album_id is set to 3?
•         Â
UPDATE track
set media_type_id = 1
where album_id = 3
•         Â
UPDATE track
where album_id = 3
set media_type_id = 1
•         Â
UPDATE track
set media_type_id = 1
where track_id = 3
•         Â
UPDATE track
set media_type_id = 3
where album_id = 1
10
In each milestone, you may want or need to use the database and query tool to answer some of the questions. We suggest you open the tool in another browser tab while you are working on this assessment.
Â
https://postgres.sophia.org/
Using the LIKE operator in the WHERE clause, use the necessary wildcards to filter the album table to find the albums that have Disc 1 in the title.
Identify the 6th album ID.
•         Â
43
•         Â
48
•         Â
35
•         Â
44
11
In each milestone, you may want or need to use the database and query tool to answer some of the questions. We suggest you open the tool in another browser tab while you are working on this assessment.
https://postgres.sophia.org/
Using the ORDER BY clause, sort the customer table by the last name of the customer in descending order and identify the 14th name in the list from among the answer options.
•         Â
Michelle
•         Â
Sampaio
•         Â
Goyer
•         Â
Brooks
12
In each milestone, you may want or need to use the database and query tool to answer some of the questions. We suggest you open the tool in another browser tab while you are working on this assessment.
https://postgres.sophia.org/
Given the invoice table and the data that it contains, and assuming that you have the rights to modify the table, which of the following ALTER TABLE statements would work without errors?
•         Â
ALTER TABLE invoice ALTER COLUMN billing_state TYPE BOOLEAN;
•         Â
ALTER TABLE customer ALTER COLUMN billing_city TYPE VARCHAR (1);
•         Â
ALTER TABLE invoice ALTER COLUMN total TYPE VARCHAR (100);
•         Â
ALTER TABLE invoice ALTER total TYPE VARCHAR (1);
13
In each milestone, you may want or need to use the database and query tool to answer some of the questions. We suggest you open the tool in another browser tab while you are working on this assessment.
Â
https://postgres.sophia.org/
Identify the correctly constructed ALTER TABLE statement that removes the age column from the user table.
•         Â
ALTER TABLE user DROP age int;
•         Â
ALTER TABLE user ADD age int;
•         Â
ALTER TABLE user DROP age;
•         Â
ALTER TABLE user DROP age_now;
14
In each milestone, you may want or need to use the database and query tool to answer some of the questions. We suggest you open the tool in another browser tab while you are working on this assessment.
https://postgres.sophia.org/
Using the SELECT statement, query the track table to find the total cost of the tracks on album_id 10, rounded to the nearest cent.
•         Â
13.9
•         Â
13
•         Â
14
•         Â
13.86
15
In each milestone, you may want or need to use the database and query tool to answer some of the questions. We suggest you open the tool in another browser tab while you are working on this assessment.
https://postgres.sophia.org/
Using the WHERE and HAVING clauses, filter the track table for the tracks with the media_type_id set to 1, grouped by the genre_id having the number of tracks greater than 10. Provide the list of genre_id's and the count of tracks that fit these criteria.
Which of the following queries would provide the correct results?
•         Â
SELECT genre_id, count(track_id)
FROM track
WHERE media_type_id = 1
HAVING count(track_id) > 10
GROUP BY genre_id
•         Â
SELECT genre_id, count(track_id)
FROM track
WHERE media_type_id = 1
GROUP BY genre_id
HAVING count(track_id) > 10
•         Â
SELECT genre_id, sum(track_id)
FROM track
WHERE media_type_id = 1
GROUP BY genre_id
HAVING sum(track_id) > 10
•         Â
SELECT genre_id, count(track_id)
FROM track
WHERE count(track_id) > 10
GROUP BY genre_id
HAVING media_type_id = 1
16
In each milestone, you may want or need to use the database and query tool to answer some of the questions. We suggest you open the tool in another browser tab while you are working on this assessment.
Â
https://postgres.sophia.org/
Identify the correctly constructed ALTER TABLE statement to add a UNIQUE constraint to the column driver_license with the constraint name driver_license_unique on the table called 'identification'.
•         Â
ALTER TABLE identification ADD CONSTRAINT driver_license UNIQUE (driver_license_unique);
•         Â
ALTER TABLE identification ADD CONSTRAINT driver_license UNIQUE (driver_license);
•         Â
ALTER TABLE identification ADD UNIQUE driver_license CONSTRAINT (driver_license_unique);
•         Â
ALTER TABLE identification ADD CONSTRAINT driver_license_unique UNIQUE (driver_license);
17
In each milestone, you may want or need to use the database and query tool to answer some of the questions. We suggest you open the tool in another browser tab while you are working on this assessment.
https://postgres.sophia.org/
Using the SELECT statement, query the invoice table to find the average total cost for all orders placed between 2011-01-01 and 2012-01-01.
•         Â
5.7063106796116505
•         Â
5.7357723577235772
•         Â
5.8095238095238095
•         Â
0
18
In each milestone, you may want or need to use the database and query tool to answer some of the questions. We suggest you open the tool in another browser tab while you are working on this assessment.
Â
https://postgres.sophia.org/
Using the LIKE operator in the WHERE clause, filter the customer table to list the individuals that have a phone number ending with 88.
Identify the 2nd individual's country.
•         Â
Canada
•         Â
Toronto
•         Â
India
•         Â
USA
19
In each milestone, you may want or need to use the database and query tool to answer some of the questions. We suggest you open the tool in another browser tab while you are working on this assessment.
Â
https://postgres.sophia.org/
Using the IN operator, filter the invoice table to find those with the billing city set to Paris, London, New York, or Brussels.
Identify the billing postal code of the 4th record.
•         Â
75009
•         Â
SW1V 3EN
•         Â
1000
•         Â
75002
20
In each milestone, you may want or need to use the database and query tool to answer some of the questions. We suggest you open the tool in another browser tab while you are working on this assessment.
https://postgres.sophia.org/
Using the SELECT statement, query the invoice table to find the total cost for all orders placed by the customer_id that is equal to 2.
•         Â
38
•         Â
2313
•         Â
7
•         Â
2
21
In each milestone, you may want or need to use the database and query tool to answer some of the questions. We suggest you open the tool in another browser tab while you are working on this assessment.
Â
https://postgres.sophia.org/
Using the AND or OR statement, filter the album table for an album that has Disc 1 in the title or Disc 2 in the title.
Identify the album ID of the 4th record.
•         Â
34
•         Â
50
•         Â
33
•         Â
35
22
In each milestone, you may want or need to use the database and query tool to answer some of the questions. We suggest you open the tool in another browser tab while you are working on this assessment.
https://postgres.sophia.org/
Select the correctly constructed CHECK constraint to validate the signup_date column of type data, to ensure that values placed into it are between 2020-01-01 and 2025-01-01.
•         Â
CHECK (signup_date BETWEEN 2020-01-01 AND 2025-01-01)
•         Â
CHECK (signup_date BETWEEN '2020-01-01' OR '2025-01-01')
•         Â
CHECK (signup_date BETWEEN '2020-01-01' AND '2025-01-01')
•         Â
CHECK (signup_date IN '2020-01-01' AND '2025-01-01')
23
In each milestone, you may want or need to use the database and query tool to answer some of the questions. We suggest you open the tool in another browser tab while you are working on this assessment.
https://postgres.sophia.org/
Given the invoice table and the data that it contains, and assuming that you have the rights to modify the table, which of the following ALTER TABLE statements would create an error?
•         Â
ALTER TABLE invoice ALTER COLUMN billing_state TYPE VARCHAR (100);
•         Â
ALTER TABLE invoice ALTER COLUMN billing_city TYPE VARCHAR (100);
•         Â
ALTER TABLE invoice ALTER COLUMN invoice_id TYPE VARCHAR (50);
•         Â
ALTER TABLE invoice ALTER COLUMN total TYPE VARCHAR (100);
24
In each milestone, you may want or need to use the database and query tool to answer some of the questions. We suggest you open the tool in another browser tab while you are working on this assessment.
https://postgres.sophia.org/
USING the SELECT statement, query the track table ordered by the bytes. Set the LIMIT to 5 and OFFSET to 5.
What is the name of the last row returned?
•         Â
Bossa
•         Â
Deixa Entrar
•         Â
Snowballed
•         Â
Evil Walks
25
In each milestone, you may want or need to use the database and query tool to answer some of the questions. We suggest you open the tool in another browser tab while you are working on this assessment.
https://postgres.sophia.org/
Given the tables provided, which of the following DROP TABLE series of statements would correctly remove the tables without causing an error?
•         Â
DROP TABLE genre;
DROP TABLE album;
DROP TABLE artist;
•         Â
DROP TABLE genre;
DROP TABLE album;
DROP TABLE artist;
•         Â
DROP TABLE customer;
DROP TABLE invoice;
DROP TABLE invoice_line;
•         Â
DROP TABLE invoice_line;
DROP TABLE playlist_track;
DROP TABLE playlist;
26
In each milestone, you may want or need to use the database and query tool to answer some of the questions. We suggest you open the tool in another browser tab while you are working on this assessment.
Â
https://postgres.sophia.org/
Using the WHERE clause, filter the invoice table to find the invoices dated January 15th, 2011.
Identify the 2nd customer ID of the invoices.
•         Â
29
•         Â
27
•         Â
31
•         Â
35
27
In each milestone, you may want or need to use the database and query tool to answer some of the questions. We suggest you open the tool in another browser tab while you are working on this assessment.
https://postgres.sophia.org/
Using the SELECT statement, query the customer table to find the number of customers that live in the country USA.
•         Â
12
•         Â
46
•         Â
13
•         Â
59
28
In each milestone, you may want or need to use the database and query tool to answer some of the questions. We suggest you open the tool in another browser tab while you are working on this assessment.
https://postgres.sophia.org/
Which of these SELECT statements would successfully display exactly three columns of data from the employee table?
•         Â
SELECT *
FROM employee;
•         Â
SELECT hiredate, postalcode, employeeid
FROM employee;
•         Â
SELECT hire_date, postal_code, employee_id
FROM employee;
•         Â
SELECT hire_date;
postal_code;
employee_id
FROM employee;
29
In each milestone, you may want or need to use the database and query tool to answer some of the questions. We suggest you open the tool in another browser tab while you are working on this assessment.
https://postgres.sophia.org/
What is the main function of the SELECT clause in SQL?
•         Â
To apply conditions to filter the dataset
•         Â
To retrieve rows from one or more table columns
•         Â
To identify one or more tables as the source for a query
30
In each milestone, you may want or need to use the database and query tool to answer some of the questions. We suggest you open the tool in another browser tab while you are working on this assessment.
https://postgres.sophia.org/
Which of the following is a correctly formatted INSERT statement that will insert three records into the album table?
•         Â
insert into album (artist_id, title, album_id) values (1, 'Genesis', 450), (1, 'Self-Titled', 451), (1, 'Lyrics', 452)
•         Â
insert into album (album_id, title, artist_id) values (1, 'Genesis', 450), (1, 'Self-Titled', 451), (1, 'Lyrics', 452)
•         Â
insert into album (artist_id, title, album_id) values (1, 'Genesis', 450), (1, 'Self-Titled', 451), (1, 'Lyrics', 450)
•         Â
insert into album (artist_id, title, album_id) values (1, 'Genesis', 450) (1, 'Self-Titled', 451) (1, 'Lyrics', 452)
31
In each milestone, you may want or need to use the database and query tool to answer some of the questions. We suggest you open the tool in another browser tab while you are working on this assessment.
https://postgres.sophia.org/
Which of the following statement(s) would successfully delete the invoice_line_id 5 from the invoice_line table?
•         Â
DELETE FROM invoice_line WHERE invoice_line_id = 5;
DELETE FROM invoice WHERE invoice_line_id = 5;
•         Â
DELETE FROM invoice_line WHERE invoice_line_id = 5;
•         Â
DELETE FROM invoice WHERE invoice_line_id = 353;
•         Â
DELETE FROM invoice WHERE invoice_line_id = 5;
DELETE FROM invoice_line WHERE invoiceline__id = 5;
32
In each milestone, you may want or need to use the database and query tool to answer some of the questions. We suggest you open the tool in another browser tab while you are working on this assessment.
https://postgres.sophia.org/
Using the WHERE clause, filter the employee table to include individuals that report to Andrew Adams, who has an employee_id of 1.
Identify the title of the 2nd individual listed.
•         Â
Sales Support Agent
•         Â
IT Manager
•         Â
General Manager
•         Â
Sales Manager
33
In each milestone, you may want or need to use the database and query tool to answer some of the questions. We suggest you open the tool in another browser tab while you are working on this assessment.
Â
https://postgres.sophia.org/
Using the BETWEEN operator, filter the album table to find the albums with an artist ID between 18 and 30.
Identify the 7th album ID.
•         Â
29
•         Â
30
•         Â
31
•         Â
127
34
In each milestone, you may want or need to use the database and query tool to answer some of the questions. We suggest you open the tool in another browser tab while you are working on this assessment.
https://postgres.sophia.org/
Identify the SQL command that uses an aggregate function that could be used to find the employee in the employee table who has been at the company the longest.
•         Â
SELECT max(hire_date) FROM employee;
•         Â
SELECT large(hire_date) FROM employee;
•         Â
SELECT small(hire_date) FROM employee;
•         Â
SELECT min(hire_date) FROM employee;
35
In each milestone, you may want or need to use the database and query tool to answer some of the questions. We suggest you open the tool in another browser tab while you are working on this assessment.
https://postgres.sophia.org/
The following CREATE TABLE statement creates a table called 'album' that consists of the album_id as the primary key that is auto-incremented, the title, and the artist_id.
Â
CREATE TABLE albums(
album_id serial PRIMARY KEY,
title serial VARCHAR,
artist_id int
);
Identify the line of code that would either generate a syntax, logical, or requirements error in this CREATE TABLE statement.
•         Â
2
•         Â
1
•         Â
4
•         Â
3
36
In each milestone, you may want or need to use the database and query tool to answer some of the questions. We suggest you open the tool in another browser tab while you are working on this assessment.
https://postgres.sophia.org/
Using the SELECT statement, query the track table to find the maximum bytes where the milliseconds are greater than 11650.
•         Â
1059546140
•         Â
387360
•         Â
319888
•         Â
38747
Â
1
In each milestone, you may want or need to use the database and query tool to answer some of the questions. We suggest you open the tool in another browser tab while you are working on this assessment.
Â
https://postgres.sophia.org/
Using the AND or OR statement, filter the employee table for employees who have a title starting with Sales and an address containing Ave.
Identify the last name of the 3rd record.
•         Â
Peacock
•         Â
Johnson
•         Â
Margaret
•         Â
Steve
2
In each milestone, you may want or need to use the database and query tool to answer some of the questions. We suggest you open the tool in another browser tab while you are working on this assessment.
https://postgres.sophia.org/
Select the correctly constructed CHECK constraint to validate the phone_type column of type string, to ensure that values placed into it are either work, home, or mobile.
•         Â
CHECK (phone_type IN ('work', 'home', 'mobile'))
•         Â
CHECK (phone_type = 'work' OR 'home' OR 'mobile')
•         Â
CHECK (phone_type IN 'work', 'home', 'mobile')
•         Â
CHECK (phone_type IN (work, home, mobile))
Â
3
In each milestone, you may want or need to use the database and query tool to answer some of the questions. We suggest you open the tool in another browser tab while you are working on this assessment.
https://postgres.sophia.org/
Which of the following would set the company of the customer with the customer_id equal to 24, to Apple Inc.?
•         Â
UPDATE customer
SET company = 'Apple Inc.'
AND customer_id = 24
•         Â
UPDATE customer
WHERE customer_id = 24
SET company = 'Apple Inc.'
•         Â
UPDATE customer
SET company = 'Apple Inc.'
WHERE customer_id = 24
•         Â
UPDATE customer
SET company = Apple Inc.
WHERE customer_id = 24
4
In each milestone, you may want or need to use the database and query tool to answer some of the questions. We suggest you open the tool in another browser tab while you are working on this assessment.
https://postgres.sophia.org/
Using the WHERE clause, filter the employee table to include individuals that report to Andrew Adams, who has an employee_id of 1.
Identify the title of the 2nd individual listed.
•         Â
Sales Manager
•         Â
IT Manager
•         Â
Sales Support Agent
•         Â
General Manager
5
In each milestone, you may want or need to use the database and query tool to answer some of the questions. We suggest you open the tool in another browser tab while you are working on this assessment.
https://postgres.sophia.org/
Using the SELECT statement, query the track table to find the average length of a track that has the genre_id equal to 5, rounded to the nearest millisecond.
•         Â
134643
•         Â
394489
•         Â
134644
•         Â
134643.5
6
In each milestone, you may want or need to use the database and query tool to answer some of the questions. We suggest you open the tool in another browser tab while you are working on this assessment.
https://postgres.sophia.org/
Using the SELECT statement, query the customer table to find the number of customers that live in the country Canada.
•         Â
59
•         Â
7
•         Â
8
•         Â
51
7
In each milestone, you may want or need to use the database and query tool to answer some of the questions. We suggest you open the tool in another browser tab while you are working on this assessment.
https://postgres.sophia.org/
Given the invoice table and the data that it contains, and assuming that you have the rights to modify the table, which of the following ALTER TABLE statements would work without errors?
•         Â
ALTER TABLE invoice ALTER COLUMN total TYPE VARCHAR (100);
•         Â
ALTER TABLE invoice ALTER total TYPE VARCHAR (1);
•         Â
ALTER TABLE customer ALTER COLUMN billing_city TYPE VARCHAR (1);
•         Â
ALTER TABLE invoice ALTER COLUMN billing_state TYPE BOOLEAN;
8
In each milestone, you may want or need to use the database and query tool to answer some of the questions. We suggest you open the tool in another browser tab while you are working on this assessment.
https://postgres.sophia.org/
Using the WHERE and HAVING clauses, filter the track table for the tracks with the media_type_id set to 1, grouped by the genre_id having the number of tracks greater than 10. Provide the list of genre_id's and the count of tracks that fit these criteria.
Which of the following queries would provide the correct results?
•         Â
SELECT genre_id, sum(track_id)
FROM track
WHERE media_type_id = 1
GROUP BY genre_id
HAVING sum(track_id) > 10
•         Â
SELECT genre_id, count(track_id)
FROM track
WHERE count(track_id) > 10
GROUP BY genre_id
HAVING media_type_id = 1
•         Â
SELECT genre_id, count(track_id)
FROM track
WHERE media_type_id = 1
GROUP BY genre_id
HAVING count(track_id) > 10
•         Â
SELECT genre_id, count(track_id)
FROM track
WHERE media_type_id = 1
HAVING count(track_id) > 10
GROUP BY genre_id
9
In each milestone, you may want or need to use the database and query tool to answer some of the questions. We suggest you open the tool in another browser tab while you are working on this assessment.
https://postgres.sophia.org/
Using the SELECT statement, query the track table to find the maximum bytes where the milliseconds are less than 11650.
•         Â
38747
•         Â
319888
•         Â
1059546140
•         Â
387360
10
In each milestone, you may want or need to use the database and query tool to answer some of the questions. We suggest you open the tool in another browser tab while you are working on this assessment.
https://postgres.sophia.org/
Given the tables provided, which of the following DROP TABLE series of statements would correctly remove the tables without causing an error?
•         Â
DROP TABLE genre;
DROP TABLE album;
DROP TABLE artist;
•         Â
DROP TABLE genre;
DROP TABLE album;
DROP TABLE artist;
•         Â
DROP TABLE customer;
DROP TABLE invoice;
DROP TABLE invoice_line;
•         Â
DROP TABLE invoice_line;
DROP TABLE playlist_track;
DROP TABLE playlist;
11
In each milestone, you may want or need to use the database and query tool to answer some of the questions. We suggest you open the tool in another browser tab while you are working on this assessment.
Â
https://postgres.sophia.org/
The following CREATE TABLE statement creates a table called 'users' that consists of the user_id as the primary key, the username, and the password.
Â
CREATE TABLE users(
user_id int PRIMARY KEY,
username VARCHAR 50,
password VARCHAR (50)
);
Identify the line of code that would generate an error in this CREATE TABLE statement.
•         Â
1
•         Â
3
•         Â
4
•         Â
2
12
In each milestone, you may want or need to use the database and query tool to answer some of the questions. We suggest you open the tool in another browser tab while you are working on this assessment.
https://postgres.sophia.org/
Which of the following is a correctly formatted INSERT statement that will insert three records into the artist table?
•         Â
insert into artist (name, artist_id) values (550, 'Lady Gaga'), (551, 'Ed Sheeran'), (552, 'Taylor Swift')
•         Â
insert into artist (artist_id, name) values (550, 'Lady Gaga') (551, 'Ed Sheeran') (552, 'Taylor Swift')
•         Â
insert into artist (artist_id, name) values (550, 'Lady Gaga'), (551, 'Ed Sheeran'), (552, 'Taylor Swift')
•         Â
insert into artist (artist_id, name) values (550, 'Lady Gaga'), (551, 'Ed Sheeran'), (551, 'Taylor Swift')
13
In each milestone, you may want or need to use the database and query tool to answer some of the questions. We suggest you open the tool in another browser tab while you are working on this assessment.
Â
https://postgres.sophia.org/
What is the main function of the FROM clause in SQL?
•         Â
To retrieve zero or more rows from one or more database columns
•         Â
To apply conditions to filter the dataset
•         Â
To identify one or more tables as the source for a query
14
In each milestone, you may want or need to use the database and query tool to answer some of the questions. We suggest you open the tool in another browser tab while you are working on this assessment.
https://postgres.sophia.org/
Using the GROUP BY clause and the count aggregate function, filter the track table to group the tracks based on album_id.
How many tracks are in album 179?
•         Â
8
•         Â
10
•         Â
13
•         Â
1
15
In each milestone, you may want or need to use the database and query tool to answer some of the questions. We suggest you open the tool in another browser tab while you are working on this assessment.
Â
https://postgres.sophia.org/
Using the LIKE operator in the WHERE clause, use the necessary wildcards to filter the album table to find the albums that have Disc 1 in the title.
Identify the 6th album ID.
•         Â
48
•         Â
43
•         Â
44
•         Â
35
16
In each milestone, you may want or need to use the database and query tool to answer some of the questions. We suggest you open the tool in another browser tab while you are working on this assessment.
https://postgres.sophia.org/
Which of the following statement(s) would successfully delete the playlist_id 8 from the playlist table?
•         Â
DELETE FROM playlist_track WHERE playlist_id_id = 8;
•         Â
DELETE FROM playlist_id WHERE playlist_id_id = 8;
DELETE FROM playlist_track WHERE playlist_id_id = 8;
•         Â
DELETE from playlist_track WHERE playlist_id = 8;
DELETE from playlist WHERE playlist_id = 8;
•         Â
DELETE FROM playlist_id WHERE playlist_id_id = 8;
17
In each milestone, you may want or need to use the database and query tool to answer some of the questions. We suggest you open the tool in another browser tab while you are working on this assessment.
Â
https://postgres.sophia.org/
Using the BETWEEN operator, filter the album table to find the albums with an artist ID between 5 and 10.
Identify the 5th album ID.
•         Â
11
•         Â
12
•         Â
7
•         Â
9
18
In each milestone, you may want or need to use the database and query tool to answer some of the questions. We suggest you open the tool in another browser tab while you are working on this assessment.
https://postgres.sophia.org/
Â
Consider the following table:
CREATE TABLE video(
video_id SERIAL PRIMARY KEY,
video_name VARCHAR NOT NULL
);
Which of the following is a correctly formatted INSERT statement that will successfully add a new record that uses the auto-incremented primary key into this table?
•         Â
insert into video (video_id, video_name) values (1, 'home video - first day of school' )
•         Â
insert into video (video_name) values (home video - first day of school)
•         Â
insert into video (video_name) values ('home video - first day of school' )
•         Â
insert into video (video_id, video_name) values (nextval, 'home video - first day of school')
19
In each milestone, you may want or need to use the database and query tool to answer some of the questions. We suggest you open the tool in another browser tab while you are working on this assessment.
https://postgres.sophia.org/
Identify the SQL command that uses an aggregate function that could be used to find the newest employee in the employee table.
•         Â
SELECT large(hire_date) FROM employee;
•         Â
SELECT max(hire_date) FROM employee;
•         Â
SELECT small(hire_date) FROM employee;
•         Â
SELECT min(hire_date) FROM employee;
20
In each milestone, you may want or need to use the database and query tool to answer some of the questions. We suggest you open the tool in another browser tab while you are working on this assessment.
https://postgres.sophia.org/
Which of these SELECT statements would successfully display exactly four columns of data from the track table?
•         Â
SELECT *
FROM track;
•         Â
SELECT track_id, name, album_id, milliseconds
FROM track;
•         Â
SELECT Track_id and name and album_id and milliseconds
FROM track;
•         Â
SELECT track_id
name
album_id
milliseconds
FROM track;
21
In each milestone, you may want or need to use the database and query tool to answer some of the questions. We suggest you open the tool in another browser tab while you are working on this assessment.
https://postgres.sophia.org/
Using the GROUP BY and HAVING clauses, filter the customer table by country.
How many countries have less than 5 customers?
•         Â
3
•         Â
2
•         Â
20
•         Â
18
22
In each milestone, you may want or need to use the database and query tool to answer some of the questions. We suggest you open the tool in another browser tab while you are working on this assessment.
Â
https://postgres.sophia.org/
Identify the correctly constructed ALTER TABLE statement to add a UNIQUE constraint to the column reference_number with the constraint name reference_number_unique on the table called 'document'.
•         Â
ALTER TABLE document ADD CONSTRAINT reference_number_unique UNIQUE (reference_number);
•         Â
ALTER TABLE document ADD UNIQUE reference_number CONSTRAINT (reference_number_unique);
•         Â
ALTER TABLE document ADD CONSTRAINT reference_number UNIQUE (reference_number_unique);
•         Â
ALTER TABLE document ADD CONSTRAINT reference_number UNIQUE (reference_number);
23
In each milestone, you may want or need to use the database and query tool to answer some of the questions. We suggest you open the tool in another browser tab while you are working on this assessment.
https://postgres.sophia.org/
The following CREATE TABLE statement creates a table called 'album' that consists of the album_id as the primary key that is auto-incremented, the title, and the artist_id.
Â
CREATE TABLE albums(
album_id serial PRIMARY KEY,
title serial VARCHAR,
artist_id int
);
Identify the line of code that would either generate a syntax, logical, or requirements error in this CREATE TABLE statement.
•         Â
1
•         Â
4
•         Â
3
•         Â
2
24
In each milestone, you may want or need to use the database and query tool to answer some of the questions. We suggest you open the tool in another browser tab while you are working on this assessment.
https://postgres.sophia.org/
Using the ORDER BY clause, sort the customer table by the first name of the customer in descending order and identify the 12th name in the list from among the answer options.
•         Â
Patrick
•         Â
Ellie
•         Â
Gray
•         Â
Sullivan
25
In each milestone, you may want or need to use the database and query tool to answer some of the questions. We suggest you open the tool in another browser tab while you are working on this assessment.
https://postgres.sophia.org/
Using the SELECT statement, query the track table to find the total price for all tracks that have the genre_id not equal to 1.
•         Â
0.99
•         Â
2396.94
•         Â
1284.03
•         Â
3552.27
26
In each milestone, you may want or need to use the database and query tool to answer some of the questions. We suggest you open the tool in another browser tab while you are working on this assessment.
Â
https://postgres.sophia.org/
Using the IN operator, filter the album table to find those with an artist ID of 11, 18, 9, or 4.
Identify the title of the 1st record.
•         Â
BackBeat Soundtrack
•         Â
Jagged Little Pill
•         Â
Afrociberdelia
•         Â
Alcohol Fueled Brewtality Live! [Disc 1]
27
In each milestone, you may want or need to use the database and query tool to answer some of the questions. We suggest you open the tool in another browser tab while you are working on this assessment.
https://postgres.sophia.org/
Using the SELECT statement, query the invoice table to find the average total cost for all orders placed in the country France.
•         Â
5.6285714285714286
•         Â
5.8021978021978022
•         Â
5.7135278514588859
•         Â
5.64
28
In each milestone, you may want or need to use the database and query tool to answer some of the questions. We suggest you open the tool in another browser tab while you are working on this assessment.
https://postgres.sophia.org/
Which of the following would set the company of the customers that live in the city of Prague to Humor Inc.?
•         Â
UPDATE customer
WHERE city = 'Prague'
SET company = 'Humor Inc.'
•         Â
UPDATE customer
SET company = Humor Inc.
WHERE city = 'Prague'
•         Â
UPDATE customer
SET company = 'Humor Inc.'
WHERE city = 'Prague'
•         Â
UPDATE customer
SET company = 'Humor Inc.'
AND city = 'Prague'
29
In each milestone, you may want or need to use the database and query tool to answer some of the questions. We suggest you open the tool in another browser tab while you are working on this assessment.
https://postgres.sophia.org/
Â
Consider the following new table:
CREATE TABLE locationlist(
locationlist_id SERIAL PRIMARY KEY,
city VARCHAR NOT NULL,
country VARCHAR NOT NULL,
postal_code VARCHAR
);
Given this new table, which INSERT statement would query from the customer table to insert the city, country, and postal_code of all customers in the right columns?
•         Â
INSERT INTO locationlist (postal_code, country, city)
SELECT city, country, postal_code FROM customer;
•         Â
INSERT INTO locationlist (city, country, postal_code)
SELECT city, country, postal_code FROM customer;
•         Â
INSERT INTO locationlist
SELECT city, country, postal_code FROM customer;
•         Â
INSERT INTO locationlist (locationlist_id, city, country, postal_code)
SELECT city, country, postal_code FROM customer;
30
In each milestone, you may want or need to use the database and query tool to answer some of the questions. We suggest you open the tool in another browser tab while you are working on this assessment.
Â
https://postgres.sophia.org/
Using the WHERE clause, filter the invoice table to find the invoices that were dated after March 1st, 2009.
Identify the first customer ID of the invoice.
•         Â
16
•         Â
2
•         Â
17
•         Â
19
31
In each milestone, you may want or need to use the database and query tool to answer some of the questions. We suggest you open the tool in another browser tab while you are working on this assessment.
https://postgres.sophia.org/
USING the SELECT statement, query the track table ordered by the track_id. Set the LIMIT to 8 and OFFSET to 40.
What is the name of the last row returned?
•         Â
Hand In My Pocket
•         Â
Not The Doctor
•         Â
Right Through You
•         Â
Ironic
32
In each milestone, you may want or need to use the database and query tool to answer some of the questions. We suggest you open the tool in another browser tab while you are working on this assessment.
https://postgres.sophia.org/
Which of the following is a correctly formatted INSERT statement that will successfully add a record into the playlist table?
•         Â
insert into playlist (playlist_id, name) values (30, 'New Age Playlist' )
•         Â
insert into playlist (playlist_id, name) values ('New Age Playlist', 35)
•         Â
insert into playlist (playlist_id, name) values (40, New Age Playlist)
•         Â
insert into playlist (playlist_id, name) values ('New Age Playlist' )
33
In each milestone, you may want or need to use the database and query tool to answer some of the questions. We suggest you open the tool in another browser tab while you are working on this assessment.
https://postgres.sophia.org/
Given the employee table and the data that it contains, and assuming that you have the rights to modify the table, which of the following ALTER TABLE statements would create an error?
•         Â
ALTER TABLE employee ALTER COLUMN city TYPE VARCHAR (100);
•         Â
ALTER TABLE employee ALTER COLUMN email TYPE VARCHAR (100);
•         Â
ALTER TABLE employee ALTER COLUMN employee_id TYPE VARCHAR (50);
•         Â
ALTER TABLE employee ALTER COLUMN postal_code TYPE VARCHAR (100);
34
In each milestone, you may want or need to use the database and query tool to answer some of the questions. We suggest you open the tool in another browser tab while you are working on this assessment.
https://postgres.sophia.org/
Which of these constraints uses multiple fields as a primary key?
•         Â
UNIQUE
•         Â
COMPOSITE KEY
•         Â
CHECK
•         Â
FOREIGN KEY
35
In each milestone, you may want or need to use the database and query tool to answer some of the questions. We suggest you open the tool in another browser tab while you are working on this assessment.
Â
https://postgres.sophia.org/
Using the LIKE operator in the WHERE clause, filter the customer table to list the individuals who have an email ending with gmail.com.
Identify the 4th individual's city.
•         Â
Chicago
•         Â
Orlando
•         Â
Prague
•         Â
Salt Lake City
36
In each milestone, you may want or need to use the database and query tool to answer some of the questions. We suggest you open the tool in another browser tab while you are working on this assessment.
Â
https://postgres.sophia.org/
Identify the correctly constructed ALTER TABLE statement that removes the address column from the customer table.
•         Â
ALTER TABLE customer DROP home_address;
•         Â
ALTER TABLE customer DROP address;
•         Â
ALTER TABLE customer ADD address;
•         Â
ALTER TABLE customer DROP address VARCHAR (100);
Â
In each milestone, you may want or need to use the database and query tool to answer some of the questions. We suggest you open the tool in another browser tab while you are working on this assessment.
https://postgres.sophia.org/
Which of the following is a correctly formatted INSERT statement that will successfully add a record into the artist table?
•         Â
insert into artist (artist_id, name) values (900, Special Artist)
•         Â
insert into artist (artist_id, name) values ('Special Artist',900 )
•         Â
insert into artist (artist_id, name) values (900, 'Special Artist' )
•         Â
insert into artist (artist_id, name) values (19, 'Special Artist' )
Â
In each milestone, you may want or need to use the database and query tool to answer some of the questions. We suggest you open the tool in another browser tab while you are working on this assessment.
Â
https://postgres.sophia.org/
Using the BETWEEN operator, filter the invoice table to find the invoices dated between 2010-01-01 and 2010-01-15.
Identify the 3rd customer ID.
•         Â
45
•         Â
47
•         Â
51
•         Â
57
Â
In each milestone, you may want or need to use the database and query tool to answer some of the questions. We suggest you open the tool in another browser tab while you are working on this assessment.
https://postgres.sophia.org/
Which of the following UPDATE statements would set the postal_code of any customer who lives in the city of Berlin to 10789?
•         Â
UPDATE customer
WHERE city = 'Berlin'
SET postal_code = '10789'
•         Â
UPDATE customer
SET postal_code
WHERE city = '10789'
•         Â
UPDATE customer
SET postal_code = '10789'
WHERE city = 'Berlin'
•         Â
UPDATE customer
IN postal_code = '10789'
WHERE city = 'Berlin'
Â
In each milestone, you may want or need to use the database and query tool to answer some of the questions. We suggest you open the tool in another browser tab while you are working on this assessment.
https://postgres.sophia.org/
Using the SELECT statement, query the track table to find the total cost of the tracks on album_id 5, rounded to the nearest dollar.
•         Â
14.9
•         Â
15
•         Â
14.85
•         Â
14
Â
In each milestone, you may want or need to use the database and query tool to answer some of the questions. We suggest you open the tool in another browser tab while you are working on this assessment.
Â
https://postgres.sophia.org/
Using the LIKE operator in the WHERE clause, use the necessary wildcards to filter the tracks table to find the tracks that have at least three composers by checking for two / in the composer field.
Identify the 3rd track's song.
•         Â
Please Mr. Postman
•         Â
My Time After Awhile
•         Â
Girassol
•         Â
Long Tall Sally
Â
In each milestone, you may want or need to use the database and query tool to answer some of the questions. We suggest you open the tool in another browser tab while you are working on this assessment.
https://postgres.sophia.org/
Â
Consider the following new table:
CREATE TABLE contact(
user_id SERIAL PRIMARY KEY,
phone VARCHAR NOT NULL
);
Given this new table, which INSERT statement would query from the customer table to insert the phone number of all customers that have an email address that contains the word "apple" in it?
•         Â
INSERT INTO contact (phone)
SELECT phone FROM customer
WHERE email LIKE '%apple%';
•         Â
INSERT INTO contact (user_id, phone)
SELECT phone FROM customer
WHERE email LIKE %apple%;
•         Â
INSERT INTO contact (phone)
SELECT phone FROM customer;
•         Â
INSERT INTO contact
SELECT phone FROM customer
WHERE email LIKE '%apple%';
Â
In each milestone, you may want or need to use the database and query tool to answer some of the questions. We suggest you open the tool in another browser tab while you are working on this assessment.
Â
https://postgres.sophia.org/
Using the WHERE clause, filter the invoice table to find the invoices dated prior to January 19th, 2009.
Identify the invoice date closest to that invoice.
•         Â
2009-01-19
•         Â
2009-02-01
•         Â
2009-01-01
•         Â
2009-01-11
Â
In each milestone, you may want or need to use the database and query tool to answer some of the questions. We suggest you open the tool in another browser tab while you are working on this assessment.
https://postgres.sophia.org/
Â
Consider the following table:
Â
CREATE TABLE event(
event_id SERIAL PRIMARY KEY,
event_name VARCHAR NOT NULL
);
Which of the following is a correctly formatted INSERT statement that will successfully add a new record that uses the auto-incremented primary key into this table?
•         Â
insert into event (event_id, event_name) values (1, 'Homework Due' )
•         Â
insert into event (event_id, event_name) values (nextval, 'Homework Due')
•         Â
insert into event (event_name) values (Homework Due)
•         Â
insert into event (event_name) values ('Homework Due' )
Â
In each milestone, you may want or need to use the database and query tool to answer some of the questions. We suggest you open the tool in another browser tab while you are working on this assessment.
https://postgres.sophia.org/
Given the customer table and the data that it contains, and assuming that you have the rights to modify the table, which of the following ALTER TABLE statements would work without errors?
•         Â
ALTER TABLE customer ALTER COLUMN company TYPE TEXT;
•         Â
ALTER TABLE customer ALTER postal_code TYPE VARCHAR (1);
•         Â
ALTER TABLE customer ALTER COLUMN state TYPE int;
•         Â
ALTER TABLE customer ALTER COLUMN city VARCHAR (100);
Â
In each milestone, you may want or need to use the database and query tool to answer some of the questions. We suggest you open the tool in another browser tab while you are working on this assessment.
https://postgres.sophia.org/
Using the GROUP BY and HAVING clauses, filter the customer table by country.
How many countries have more than 3 customers?
•         Â
6
•         Â
5
•         Â
18
•         Â
7
Â
In each milestone, you may want or need to use the database and query tool to answer some of the questions. We suggest you open the tool in another browser tab while you are working on this assessment.
https://postgres.sophia.org/
Using the SELECT statement, query the track table to find the total price for all tracks that have the genre_id equal to 2.
•         Â
128.7
•         Â
0.99
•         Â
3552.27
•         Â
130
Â
In each milestone, you may want or need to use the database and query tool to answer some of the questions. We suggest you open the tool in another browser tab while you are working on this assessment.
https://postgres.sophia.org/
Using the WHERE and HAVING clauses, filter the track table for the tracks having the genre_id set to 1 or 2, grouped by the album_id with a number of tracks greater than 15. Provide the list of album_id's and the sum of unit_price that fit these criteria.
Which of the following queries would provide the correct results?
•         Â
SELECT album_id, sum(unit_price)
FROM track
WHERE count(track_id) > 15
GROUP BY album_id
HAVING genre_id in (1,2)
•         Â
SELECT album_id, sum(unit_price)
FROM track
HAVING count(track_id) > 15
WHERE genre_id in (1,2)
GROUP BY album_id
•         Â
SELECT album_id, count(unit_price)
FROM track
WHERE genre_id in (1,2)
GROUP BY album_id
HAVING sum(track_id) > 15
•         Â
SELECT album_id, sum(unit_price)
FROM track
WHERE genre_id in (1,2)
GROUP BY album_id
HAVING count(track_id) > 15
Â
In each milestone, you may want or need to use the database and query tool to answer some of the questions. We suggest you open the tool in another browser tab while you are working on this assessment.
Â
https://postgres.sophia.org/
What is the main function of the WHERE clause in SQL?
•         Â
To apply conditions to filter the dataset
•         Â
To retrieve zero or more rows from one or more database columns
•         Â
To identify one or more tables as the source for a query
Â
Â
1
In each milestone, you may want or need to use the database and query tool to answer some of the questions. We suggest you open the tool in another browser tab while you are working on this assessment.
Â
https://postgres.sophia.org/
Which of the following queries will use a subquery to find all of the rows in the track table that has the genre_id equal to 2 and has the length of the song in milliseconds longer than the maximum track length of all songs where the genre_id = 3?
•         Â
SELECT *
FROM TRACK
WHERE milliseconds >
(SELECT MAX(milliseconds)
FROM track
WHERE genre_id = 3)
AND genre_id = 2;
•         Â
SELECT *
FROM TRACK
WHERE milliseconds >
SELECT MAX(milliseconds)
FROM track
WHERE genre_id = 3
AND genre_id = 2;
•         Â
SELECT *
FROM TRACK
WHERE milliseconds >
(SELECT MAX(milliseconds)
FROM track
WHERE genre_id = 2)
AND genre_id = 3;
•         Â
SELECT *
FROM TRACK
WHERE milliseconds >
(SELECT MIN(milliseconds)
FROM track
WHERE genre_id = 3)
AND genre_id = 2;
2
In each milestone, you may want or need to use the database and query tool to answer some of the questions. We suggest you open the tool in another browser tab while you are working on this assessment.
https://postgres.sophia.org/
Which of the following query does NOT correctly use aliases?
•         Â
SELECT i.customer_id, total, last_name
FROM invoice AS i
JOIN customer AS c
USING (customer_id);
•         Â
SELECT i.customer_id, i.total, c.last_name
FROM invoice AS i
JOIN customer AS c
USING (customer_id);
•         Â
SELECT c.customer_id, c.total, c.last_name
FROM invoice AS i
JOIN customer AS c
USING (customer_id);
•         Â
SELECT c.customer_id, i.total, c.last_name
FROM invoice AS i
JOIN customer AS c
USING (customer_id);
3
In each milestone, you may want or need to use the database and query tool to answer some of the questions. We suggest you open the tool in another browser tab while you are working on this assessment.
https://postgres.sophia.org/
Use the following data model for this question:
Â
Outfit
outfit_id
name
Â
ClothingPiece
piece_id
name
Â
OutfitPiece
outfit_piece_id
outfit_id
piece_id
Â
Which of the following is a situation where an OUTER JOIN could be useful?
•         Â
To view all the clothing pieces, even if they haven't been associated with an outfit in the outfits table
•         Â
To view clothing pieces that are assigned to multiple outfits
•         Â
To view outfits with just one clothing piece
•         Â
To view clothing pieces that have already been assigned to outfits
4
In each milestone, you may want or need to use the database and query tool to answer some of the questions. We suggest you open the tool in another browser tab while you are working on this assessment.
Â
https://postgres.sophia.org/
Given the following view that has been created, how would you query it to find the customers that have ordered more than $30 over their lifetime as a customer?
Â
CREATE VIEW customer_order
AS
SELECT invoice.customer_id, first_name, last_name, SUM(total) as total
FROM invoice
INNER JOIN customer
ON invoice.customer_id = customer.customer_id
GROUP BY invoice.customer_id, first_name, last_name;
•         Â
SELECT *
FROM order
WHERE SUM(total) > 30;
•         Â
SELECT *
FROM customer_order
WHERE total < 30;
•         Â
SELECT *
FROM customer_order
WHERE total > 30;
•         Â
SELECT *
FROM customer_order
WHERE lifetime_total > 30;
5
In each milestone, you may want or need to use the database and query tool to answer some of the questions. We suggest you open the tool in another browser tab while you are working on this assessment.
Â
https://postgres.sophia.org/
Genre
genre_id         name
1Â Â Â Â Â Â Â Â Â Broadway
2Â Â Â Â Â Â Â Â Â Rock
3Â Â Â Â Â Â Â Â Â Classical
4Â Â Â Â Â Â Â Â Â Salsa
Â
Track
track_id          name  genre_id
1         Highway to Hell        2
2         Everlong        2
3         Smells Like Teen Spirit         2
Â
Given the above genres and tracks, how many results will be returned for the following query?
SELECT genre.name, track.name
FROM track
RIGHT JOIN genre
USING (genre_id);
•         Â
6
•         Â
5
•         Â
3
•         Â
4
6
In each milestone, you may want or need to use the database and query tool to answer some of the questions. We suggest you open the tool in another browser tab while you are working on this assessment.
Â
https://postgres.sophia.org/
Given the tables have been created without foreign keys added, which of the following ALTER TABLE statements would create a foreign key on the coordinator_id in the email table to reference the coordinator_id in the coordinator table?
•         Â
ALTER TABLE email
ADD CONSTRAINT fk_email
FOREIGN KEY coordinator (coordinator_id)
REFERENCES coordinator_id;
•         Â
ALTER TABLE coordinator
ADD CONSTRAINT fk_email
FOREIGN KEY (coordinator_id)
REFERENCES email (coordinator_id);
•         Â
ALTER TABLE email
ADD CONSTRAINT
FOREIGN KEY (coordinator_id)
REFERENCES coordinator (coordinator_id);
•         Â
ALTER TABLE email
ADD CONSTRAINT fk_email
FOREIGN KEY (coordinator_id)
REFERENCES coordinator (coordinator_id);
7
In each milestone, you may want or need to use the database and query tool to answer some of the questions. We suggest you open the tool in another browser tab while you are working on this assessment.
Â
https://postgres.sophia.org/
Given the following queries, which of these would be the most efficient?
Â
1. SELECT *
FROM invoice
WHERE customer_id IN
(SELECT customer_id
FROM customer
WHERE country like 'U%');
Â
2. SELECT invoice.*
FROM invoice
INNER JOIN customer
ON customer.customer_id = invoice.customer_id
WHERE country like 'U%';
•         Â
Both would be the same as both use the same indices for the join and filter.
•         Â
Query #1 would be more efficient as it is based on primary and foreign keys.
•         Â
Query #2 would be more efficient as it is not using indexed columns.
•         Â
Query #2 would be more efficient as it is based on primary and foreign keys.
Check other also
8
In each milestone, you may want or need to use the database and query tool to answer some of the questions. We suggest you open the tool in another browser tab while you are working on this assessment.
https://postgres.sophia.org/
Why is the following query NOT valid as a NATURAL JOIN?
Â
SELECT customer.first_name, customer.last_name, employee.first_name, employee.last_name
FROM customer
NATURAL JOIN employee;
•         Â
The tables have a shared column, but their column names are not identical, so a JOIN... ON is needed.
•         Â
The syntax used for NATURAL JOIN is not correct.
•         Â
The tables do not have a foreign key relationship.
•         Â
These two tables do not share any identical columns/fields.
9
In each milestone, you may want or need to use the database and query tool to answer some of the questions. We suggest you open the tool in another browser tab while you are working on this assessment.
Â
https://postgres.sophia.org/
Which of the following statements would create a UNION between all of the columns of invoice where the total of the invoice is greater than 10, combined with the invoices that have an invoice_date greater or equal to 2013-08-01, and combined with the billing country in the USA with the billing state in FL?
•         Â
SELECT *
FROM invoice
WHERE total > 10
SELECT *
FROM invoice
WHERE invoice_date >= '2013-08-01'
UNION
SELECT *
FROM invoice
WHERE billing_country = 'USA' AND billing_state = 'FL';
•         Â
SELECT *
FROM invoice
UNION
WHERE total > 10
SELECT *
FROM invoice
UNION
WHERE invoice_date >= '2013-08-01'
SELECT *
FROM invoice
WHERE billing_country = 'USA' AND billing_state = 'FL';
•         Â
SELECT *
FROM invoice
WHERE total > 10
UNION
SELECT *
FROM invoice
WHERE invoice_date >= '2013-08-01'
UNION
SELECT *
FROM invoice
WHERE billing_country = 'USA' AND billing_state = 'FL';
•         Â
SELECT *
FROM invoice
WHERE total > 10
SELECT *
FROM invoice
WHERE invoice_date >= '2013-08-01'
SELECT *
FROM invoice
WHERE billing_country = 'USA' AND billing_state = 'FL';
10
In each milestone, you may want or need to use the database and query tool to answer some of the questions. We suggest you open the tool in another browser tab while you are working on this assessment.
Â
https://postgres.sophia.org/
In trying to insert into the playlist_track table, what is the cause of this error?
Query failed because of: error: insert or update on table "playlist_track" violates foreign key constraint "playlist_track_playlist_id_fkey"
•         Â
The playlist_id needs to be added to the playlist table first.
•         Â
The playlist_track_id is not unique.
•         Â
The playlist_id being referenced doesn't exist in the playlist table.
•         Â
The playlist_id in the playlist_track table doesn't exist yet.
11
In each milestone, you may want or need to use the database and query tool to answer some of the questions. We suggest you open the tool in another browser tab while you are working on this assessment.
Â
https://postgres.sophia.org/
Which results would show if the employee table LEFT JOINed the customer table?
•         Â
Only customers that have employees associated with them and vice-versa
•         Â
All rows from the customer table even if they don't have an employee supporting them
•         Â
All employees, even those that aren't supporting customers
•         Â
Only employees that have customers that they support
12
Â
Which of the following statements would be a valid DROP VIEW statement for an invoice_verification table that would prevent the removal of a view if there are any objects depending on it?
•         Â
DROP VIEW invoice_verification RESTRICT;
•         Â
DROP VIEW IF EXISTS invoice_verification;
•         Â
DROP VIEW CASCADE invoice_verification;
•         Â
DROP VIEW invoice_verification;
13
In each milestone, you may want or need to use the database and query tool to answer some of the questions. We suggest you open the tool in another browser tab while you are working on this assessment.
Â
https://postgres.sophia.org/
Which of the following statements would query the invoice_line table to sum up the totals by multiplying the unit_price with the quantity grouped by track_id?
•         Â
SELECT track_id, SUM(quantity * unit_price) AS total
FROM invoice_line
GROUP BY track_id
ORDER BY total DESC;
•         Â
SELECT track_id, (quantity * unit_price) AS total
FROM invoice_line
GROUP BY track_id
ORDER BY total DESC;
•         Â
SELECT track_id, SUM(quantity * unit_price) AS total
FROM invoice_line
ORDER BY total DESC;
•         Â
SELECT track_id, (quantity / unit_price) AS total
FROM invoice_line
GROUP BY track_id
ORDER BY total DESC;
14
In each milestone, you may want or need to use the database and query tool to answer some of the questions. We suggest you open the tool in another browser tab while you are working on this assessment.
Â
https://postgres.sophia.org/
Animal
animal_id
name
adopter_id
Â
Adopter
adopter_id
name
Â
Given the above data for an adoption agency, what does the result set for the following query represent?
Â
SELECT adopter.name, animal.name
FROM Animal
CROSS JOIN Adopter;
•         Â
It represents every single Animal in the animal table regardless of whether they have been adopted or not.
•         Â
It represents all adopters regardless of whether they have claimed an animal in the animal table.
•         Â
It represents each animal, with the name of their adopter if that has been specified via a Foreign Key.
•         Â
It represents every single animal matches with every single adopter.
15
In each milestone, you may want or need to use the database and query tool to answer some of the questions. We suggest you open the tool in another browser tab while you are working on this assessment.
Â
https://postgres.sophia.org/
Which of the following data models appropriately models the relationship of recipes and their ingredients?
•         Â
recipe
recipe_id
recipe_name
ingredient_id (FK)
Â
ingredient
ingredient_id
ingredient_name
ingredient_amount
•         Â
recipe
recipe_id
recipe_name
ingredient_name_1
ingredient_amount_1
ingredient_name_2
ingredient_amount_2
•         Â
recipe
recipe_id
recipe_name
Â
ingredient
ingredient_id
recipe_id (FK)
ingredient_name
ingredient_amount
•         Â
ingredient
ingredient_id
recipe_name
ingredient_name
ingredient_amount
16
In each milestone, you may want or need to use the database and query tool to answer some of the questions. We suggest you open the tool in another browser tab while you are working on this assessment.
Â
https://postgres.sophia.org/
What will be the result of the query based on the following criteria?
<columnname>Â <=Â ANY (<subquery>)
•         Â
Returns true if the value is less than the smallest value returned by the subquery.
•         Â
Returns true if the value is less than or equal to the smallest value returned by the subquery.
•         Â
Returns true if the value is less than or equal to any of the values returned by the subquery.
•         Â
Returns true if the value is less than any of the values returned by the subquery.
17
In each milestone, you may want or need to use the database and query tool to answer some of the questions. We suggest you open the tool in another browser tab while you are working on this assessment.
Â
https://postgres.sophia.org/
Which of the following is true of foreign keys?
•         Â
A foreign key can be linked to a NOT NULL column.
•         Â
A foreign key may be linked to a unique column that establishes a 1 to 1 relationship.
•         Â
A foreign key is not needed if the data type is different.
•         Â
Foreign keys are not needed when we require referential integrity.
18
In each milestone, you may want or need to use the database and query tool to answer some of the questions. We suggest you open the tool in another browser tab while you are working on this assessment.
Â
https://postgres.sophia.org/
Which of the following queries would check for the duplicate of reports_to WITHOUT returning the count of each?
•         Â
SELECT reports_to, count(*)
FROM employee
GROUP BY reports_to
HAVING COUNT(*) > 1;
•         Â
SELECT reports_to
FROM employee
GROUP BY reports_to
HAVING COUNT(*) > 1;
•         Â
SELECT reports_to, count(*)
FROM employee
GROUP BY reports_to
HAVING > 1;
•         Â
SELECT reports_to
FROM employee
HAVING COUNT(*) > 1;
Find Duplicate Rows
Report an issue with this question
19
In each milestone, you may want or need to use the database and query tool to answer some of the questions. We suggest you open the tool in another browser tab while you are working on this assessment.
https://postgres.sophia.org/
Which of the following statements will show the following result set?
Â
Â
•         Â
SELECT track_id, name
FROM track
JOIN playlist_track
USING (track.name = playlist.name);
•         Â
SELECT track_id, name
FROM track
JOIN playlist_track
WHERE track_id != NULL;
•         Â
SELECT track_id, name
FROM track
JOIN playlist_track
USING (track_id);
•         Â
SELECT track_id, name
FROM track, playlist_track;
20
In each milestone, you may want or need to use the database and query tool to answer some of the questions. We suggest you open the tool in another browser tab while you are working on this assessment.
https://postgres.sophia.org/
Which of the following is a correctly formatted SELECT statement to show the following result set with the media type's name and the track's name?
•         Â
SELECT media_type.name, track.name
FROM track
JOIN media_type
ON media_type.media_type_id = track.media_type_id;
•         Â
SELECT media_type.name, track.name
FROM track
JOIN media_type
ON mediatype.media_type_id = track.media_type_id;
•         Â
SELECT media_type.name, track.name
FROM track
JOIN media_type
ON media_type.media_type_id = track.track_id;
•         Â
SELECT media_type.name, track.name
FROM track
JOIN media_type
ON media_type.media_type.id = track.media_type.id;
21
In each milestone, you may want or need to use the database and query tool to answer some of the questions. We suggest you open the tool in another browser tab while you are working on this assessment.
Â
https://postgres.sophia.org/
Which result set requires a JOIN?
•         Â
Showing invoice_dates with invoice totals
•         Â
Showing invoice totals, invoice_dates, and customer_id's
•         Â
Showing customer names with invoice_dates
•         Â
Showing invoice_dates with customer_id's
CONCEPT
Joins
Report an issue with this question
22
In each milestone, you may want or need to use the database and query tool to answer some of the questions. We suggest you open the tool in another browser tab while you are working on this assessment.
Â
https://postgres.sophia.org/
Which of the following is the valid syntax for creating a VIEW to view a subset of a table?
•         Â
CREATE VIEW album_cost
AS track
GROUP BY album_id;
•         Â
CREATE VIEW album_cost
AS
SELECT album_id, SUM(unit_price)
FROM track
GROUP BY album_id;
•         Â
CREATE VIEW album_cost
SELECT album_id, SUM(unit_price)
FROM track
GROUP BY album_id;
•         Â
CREATE VIEW album_cost
AS
SELECT album_id, SUM(unit_price)
GROUP BY album_id;
23
In each milestone, you may want or need to use the database and query tool to answer some of the questions. We suggest you open the tool in another browser tab while you are working on this assessment.
Â
https://postgres.sophia.org/
Given the initial tables in our example database, if we wanted to delete artists, tracks, and albums that HAVE NOT been purchased before, in what order do we need to delete data from our tables?
•         Â
track
album
artist
•         Â
artist
album
track
media_type
genre
•         Â
invoice_line
invoice
track
album
artist
•         Â
artist
album
track
24
In each milestone, you may want or need to use the database and query tool to answer some of the questions. We suggest you open the tool in another browser tab while you are working on this assessment.
Â
https://postgres.sophia.org/
What type of situation would you need to create or replace a view?
•         Â
The view is no longer being used.
•         Â
Data has been imported from other databases.
•         Â
The underlying query is not efficient and needs to be updated.
•         Â
On a daily basis so that the data is refreshed.
25
In each milestone, you may want or need to use the database and query tool to answer some of the questions. We suggest you open the tool in another browser tab while you are working on this assessment.
Â
https://postgres.sophia.org/
Which of the following is the valid syntax for creating a VIEW to view data from multiple tables?
•         Â
CREATE VIEW customer_order
AS
SELECT invoice.customer_id, first_name, last_name, SUM(total) as total
FROM invoice
INNER JOIN customer
ON invoice.customer_id = customer.customer_id
GROUP BY invoice.customer_id, first_name, last_name;
•         Â
CREATE VIEW customer_order
SELECT invoice.customer_id, first_name, last_name, SUM(total) as total
FROM invoice
INNER JOIN customer
ON invoice.customer_id = customer.customer_id
GROUP BY invoice.customer_id, first_name, last_name;
•         Â
CREATE VIEW customer_order
AS
SELECT invoice.customer_id, first_name, last_name, SUM(total) as total
ON invoice.customer_id = customer.customer_id
GROUP BY invoice.customer_id, first_name, last_name;
•         Â
CREATE VIEW customer order
AS
SELECT invoice.customer_id, first_name, last_name, SUM(total) as total
FROM invoice
INNER JOIN customer
ON invoice.customer_id = customer.customer_id
GROUP BY invoice.customer_id, first_name, last_name;
Â
1
In each milestone, you may want or need to use the database and query tool to answer some of the questions. We suggest you open the tool in another browser tab while you are working on this assessment.
Â
https://postgres.sophia.org/
Which of the following statements would create a UNION between all of the countries we have customers, employees, or invoices in?
•         Â
SELECT billing_country
FROM invoice
UNION
SELECT country
FROM customer
UNION
SELECT country
FROM employee;
•         Â
SELECT billing_country
FROM invoice
SELECT country
FROM customer
SELECT country
FROM employee
UNION;
•         Â
SELECT country
FROM invoice
UNION
SELECT country
FROM customer
UNION
SELECT country
FROM employee;
•         Â
SELECT billing_country
FROM invoice
SELECT country
FROM customer
SELECT country
FROM employee;
2
In each milestone, you may want or need to use the database and query tool to answer some of the questions. We suggest you open the tool in another browser tab while you are working on this assessment.
https://postgres.sophia.org/
When is a natural join possible between two tables?
•         Â
When columns in two separate tables contain the same data
•         Â
When the tables being joined both contain a column with the same name and data type
•         Â
When two tables have a foreign key relationship
•         Â
When the tables being joined have only one column each other than the primary key
3
In each milestone, you may want or need to use the database and query tool to answer some of the questions. We suggest you open the tool in another browser tab while you are working on this assessment.
Â
https://postgres.sophia.org/
Which of the following statements would calculate the average bytes per millisecond grouped by the media_type_id in the track table?
•         Â
SELECT media_type_id, AVG(bytes/milliseconds)
FROM track;
•         Â
SELECT media_type_id, (bytes/milliseconds)
FROM track
GROUP BY media_type_id;
•         Â
SELECT media_type_id, AVG(bytes/milliseconds)
FROM track
GROUP BY media_type_id;
•         Â
SELECT media_type_id, AVG(milliseconds/bytes)
FROM track
GROUP BY media_type_id;
4
In each milestone, you may want or need to use the database and query tool to answer some of the questions. We suggest you open the tool in another browser tab while you are working on this assessment.
https://postgres.sophia.org/
Which of the following statements will be able to show the following result set?
Â
Â
•         Â
SELECT name, title
FROM album
JOIN track
WHERE album_id != NULL;
•         Â
SELECT name, title
FROM album
JOIN track
USING (track_id);
•         Â
SELECT name, title
FROM album
JOIN track
USING (album_id);
•         Â
SELECT name, title
FROM album, track;
5
In each milestone, you may want or need to use the database and query tool to answer some of the questions. We suggest you open the tool in another browser tab while you are working on this assessment.
Â
https://postgres.sophia.org/
Genre
genre_id         name
1Â Â Â Â Â Â Â Â Â Broadway
2Â Â Â Â Â Â Â Â Â Rock
3Â Â Â Â Â Â Â Â Â Classical
4Â Â Â Â Â Â Â Â Â Salsa
Â
Â
Track
track_id          name  genre_id
1         Highway to Hell        2
2         Everlong        2
3         Smells Like Teen Spirit         2
Â
Given the above genres and tracks, how many results will be returned for the following query?
Â
SELECT genre.name, track.name
FROM genre
RIGHT JOIN track
USING (genre_id);
•         Â
5
•         Â
3
•         Â
4
•         Â
6
6
In each milestone, you may want or need to use the database and query tool to answer some of the questions. We suggest you open the tool in another browser tab while you are working on this assessment.
Â
https://postgres.sophia.org/
Which of the following data models appropriately models the relationship of coordinators and their email addresses?
•         Â
email_id
coordinator_name
email_type
email_address
•         Â
Coordinator
coordinator_id
coordinator_name
Â
email_id
coordinator_id (FK)
email_type
email_address
•         Â
Coordinator
coordinator_id
coordinator_name
email_type_1
email_address_1
email_type_2
email_address_2
•         Â
Coordinator
coordinator_id
coordinator_name
email_id (FK)
Â
email_id
email_type
email_address
7
In each milestone, you may want or need to use the database and query tool to answer some of the questions. We suggest you open the tool in another browser tab while you are working on this assessment.
Â
https://postgres.sophia.org/
Which result set requires a JOIN?
•         Â
Showing track name with track ID
•         Â
Showing media type name with track name
•         Â
Showing media type ID with track name
•         Â
Showing track ID, media type ID, and track name
8
In each milestone, you may want or need to use the database and query tool to answer some of the questions. We suggest you open the tool in another browser tab while you are working on this assessment.
Â
https://postgres.sophia.org/
Which of the following is the valid syntax for creating a VIEW to view data from multiple tables?
•         Â
CREATE VIEW album_artist_names
AS
SELECT album.title, artist.name
FROM album
INNER JOIN artist
ON album.artist_id = artist.artist_id;
•         Â
CREATE VIEW album artist names
AS
SELECT album.title, artist.name
FROM album
INNER JOIN artist
ON album.artist_id = artist.artist_id;
•         Â
CREATE VIEW album_artist_names
SELECT album.title, artist.name
FROM album
INNER JOIN artist
ON album.artist_id = artist.artist_id;
•         Â
CREATE VIEW album_artist_names
AS
SELECT album.title, artist.name
FROM album
ON album.artist_id = artist.artist_id;
9
In each milestone, you may want or need to use the database and query tool to answer some of the questions. We suggest you open the tool in another browser tab while you are working on this assessment.
Â
https://postgres.sophia.org/
Given the initial tables in our example database, if we wanted to delete tracks, albums, and artists that HAVE been purchased before, in what order do we need to delete data from our tables?
•         Â
invoice_line
invoice
track
album
artist
•         Â
artist
album
track
media_type
genre
•         Â
track
album
artist
•         Â
artist
album
track
10
In each milestone, you may want or need to use the database and query tool to answer some of the questions. We suggest you open the tool in another browser tab while you are working on this assessment.
Â
https://postgres.sophia.org/
Given the tables have been created without foreign keys added, which of the following ALTER TABLE statements would create a foreign key on the customer_id in the department table to reference the customer_id in the customer table?
•         Â
ALTER TABLE department
ADD CONSTRAINT
FOREIGN KEY (customer_id)
REFERENCES customer (customer_id);
•         Â
ALTER TABLE department
ADD CONSTRAINT fk_department
FOREIGN KEY (customer_id)
REFERENCES customer (customer_id);
•         Â
ALTER TABLE customer
ADD CONSTRAINT fk_department
FOREIGN KEY (customer_id)
REFERENCES department (customer_id);
•         Â
ALTER TABLE department
ADD CONSTRAINT fk_department
FOREIGN KEY customer (customer_id)
REFERENCES customer_id;
11
In each milestone, you may want or need to use the database and query tool to answer some of the questions. We suggest you open the tool in another browser tab while you are working on this assessment.
Â
https://postgres.sophia.org/
Which of the following statements would be a valid DROP VIEW statement to remove the two views, which will also display an error if either view doesn't exist?
•         Â
DROP VIEW album_cost, album_artist_names CASCADE;
•         Â
DROP VIEW album_cost, album_artist_names;
•         Â
DROP VIEW album_cost AND album_artist_names;
•         Â
DROP VIEW IF EXISTS album_cost, album_artist_names;
12
In each milestone, you may want or need to use the database and query tool to answer some of the questions. We suggest you open the tool in another browser tab while you are working on this assessment.
https://postgres.sophia.org/
Select the query that properly uses table aliases to show the genres of each track in the Album with the id of 6.
•         Â
SELECT g.name, t.name
FROM t AS track
JOIN g AS genre
USING (genre_id)
WHERE t.album_id=6;
•         Â
SELECT g(name), t(name)
FROM track AS t
JOIN genre AS g
USING (genre_id)
WHERE t(album_id)=6;
•         Â
SELECT g.name, t.name
FROM track AS t
JOIN genre AS g
USING (genre_id)
WHERE t.album_id=6;
•         Â
SELECT genre.name, track.name
FROM track
JOIN genre
USING (genre_id)
WHERE track.album_id=6;
13
In each milestone, you may want or need to use the database and query tool to answer some of the questions. We suggest you open the tool in another browser tab while you are working on this assessment.
Â
https://postgres.sophia.org/
Which of the following queries will use a subquery to find all of the rows in the track table that has a unit_price of 0.99 and has the length of the song in milliseconds that is longer than the AVG track length of all tracks in the album_id between 5 and 10?
•         Â
SELECT *
FROM TRACK
WHERE milliseconds >
SELECT AVG(milliseconds)
FROM track
WHERE album_id BETWEEN 5 AND 10
AND unit_price = 0.99;
•         Â
SELECT *
FROM TRACK
WHERE milliseconds >
(SELECT AVG(milliseconds)
FROM track
WHERE album_id BETWEEN 5 AND 10)
AND unit_price = 0.99;
•         Â
SELECT AVG(milliseconds)
FROM TRACK
WHERE milliseconds >
(SELECT *
FROM track
WHERE album_id BETWEEN 5 AND 10)
AND unit_price = 0.99;
•         Â
SELECT *
FROM TRACK
WHERE milliseconds >
(SELECT AVG(milliseconds)
FROM track
WHERE unit_price = 0.99)
AND album_id BETWEEN 5 AND 10;
14
In each milestone, you may want or need to use the database and query tool to answer some of the questions. We suggest you open the tool in another browser tab while you are working on this assessment.
https://postgres.sophia.org/
Which of the following is a correctly formatted SELECT statement to show the following result set with the invoice total, customer's customer_id, and the invoice's billing_state?
•         Â
SELECT total, invoice.customer_id, billing_state
FROM invoice
JOIN customer
ON invoice.customer_id = customer.customer_id;
•         Â
SELECT total, invoice.customer_id, billing_state
FROM invoice
JOIN customer
ON invoice.customer_id = consumer.customer_id;
•         Â
SELECT invoice_total, invoice.customer_id, billing_state
FROM invoice
JOIN customer
ON invoice.invoice_id = customer.customer_id;
•         Â
SELECT invoice_total, invoice.customer_id, billing_state
FROM invoice
JOIN customer
ON invoice.id = customer.id;
15
In each milestone, you may want or need to use the database and query tool to answer some of the questions. We suggest you open the tool in another browser tab while you are working on this assessment.
Â
https://postgres.sophia.org/
What is incorrect regarding the following statement intended to create a VIEW?
Â
CREATE VIEW priority_invoices AS
FROM invoice
WHERE total > 100;
•         Â
The name "priority_invoices" is not a table that exists in the database.
•         Â
The name of the VIEW belongs after the word "AS".
•         Â
It's not possible to create a view that only shows a subset of the data from a table.
•         Â
The fields that should belong in the result set are not specified.
16
In each milestone, you may want or need to use the database and query tool to answer some of the questions. We suggest you open the tool in another browser tab while you are working on this assessment.
Â
https://postgres.sophia.org/
Which results would show if the genre table LEFT JOINed the track table?
•         Â
All rows from the track table, even those that have NULL genre_id's
•         Â
Only genres that don't have tracks in the track table
•         Â
All genres, even those with no tracks in the track table
•         Â
Only genres with tracks in the track table
17
In each milestone, you may want or need to use the database and query tool to answer some of the questions. We suggest you open the tool in another browser tab while you are working on this assessment.
https://postgres.sophia.org/
Use the following data model for this question:
Â
Recipe
recipe_id
title
Â
Ingredient
ingredient_id
name
Â
Recipe_Ingredient
recipe_ingredient_id
recipe_id
ingredient_id
Â
Which of the following is a situation where an OUTER JOIN could be useful?
•         Â
To view only ingredients that are being utilized for particular recipes
•         Â
To view recipes that have ingredients in the ingredients table
•         Â
To view all ingredients in the database even if they are not being used for a particular recipe
•         Â
To view recipes that have the word "banana" in their title
18
In each milestone, you may want or need to use the database and query tool to answer some of the questions. We suggest you open the tool in another browser tab while you are working on this assessment.
Â
https://postgres.sophia.org/
Given the following queries, which of these would be the most efficient?
Â
1. SELECT customer.*
FROM invoice
INNER JOIN customer
ON customer.city = invoice.billing_city
WHERE COUNTRY like '%m';
Â
2. SELECT *
FROM customer
WHERE city IN
(SELECT billing_city
FROM invoice
WHERE COUNTRY like '%m');
•         Â
Query #2 would be more efficient as it is based on primary and foreign keys.
•         Â
Query #1 would be more efficient as it is based on primary and foreign keys.
•         Â
Query #1 would be more efficient as it is index indices.
•         Â
Both would be the same as both use the same indices for the join and filter.
Check other also
Â
19
In each milestone, you may want or need to use the database and query tool to answer some of the questions. We suggest you open the tool in another browser tab while you are working on this assessment.
Â
https://postgres.sophia.org/
Which of the following queries would check for duplicates of first names in the customer table and how many there are of each?
•         Â
SELECT first_name, COUNT(*)
FROM customer
WHERE COUNT(*) > 1;
•         Â
SELECT first_name
FROM customer
GROUP BY first_name
HAVING COUNT(*) > 0;
•         Â
SELECT first_name
FROM customer
GROUP BY first_name
HAVING COUNT(*) > 1;
•         Â
SELECT first_name, COUNT(*)
FROM customer
GROUP BY first_name
HAVING COUNT(*) > 1;
20
In each milestone, you may want or need to use the database and query tool to answer some of the questions. We suggest you open the tool in another browser tab while you are working on this assessment.
Â
https://postgres.sophia.org/
What will be the result of the query based on the following criteria?
<columnname>Â =Â ALL (<subquery>)
•         Â
Returns true if the value is equal to every value returned by the subquery.
•         Â
Returns true if the value is not equal to any values returned by the subquery.
•         Â
Returns true if the value is not equal to any value returned by the subquery.
•         Â
Returns true if the value is equal to any value returned by the subquery.
21
In each milestone, you may want or need to use the database and query tool to answer some of the questions. We suggest you open the tool in another browser tab while you are working on this assessment.
Â
https://postgres.sophia.org/
What type of situation would you need to create or replace a view?
•         Â
On a daily basis so that the data is refreshed.
•         Â
A view has already been created with the same name but needs to be changed.
•         Â
The view is no longer being used.
•         Â
The view needs to have update, insert, and delete statements allowed.
22
In each milestone, you may want or need to use the database and query tool to answer some of the questions. We suggest you open the tool in another browser tab while you are working on this assessment.
Â
https://postgres.sophia.org/
Outfit
ID: 1, Name: Rainy day outfit
ID: 2, Name: Important meeting outfit
ID: 3, Name: Fancy event outfit
ID: 4, Name: Beach outfit
Â
Piece
ID: 1, Name: Gray button-up shirt
ID: 2, Name: Rainboots
ID: 3, Name: Velvet pants
Â
Â
Given the above data for an outfit generator, how many records would be included in the result set for the following query?
Â
SELECT Outfit.name, Piece.name
FROM Outfit
CROSS JOIN Piece;
•         Â
12
•         Â
9
•         Â
4
•         Â
7
23
In each milestone, you may want or need to use the database and query tool to answer some of the questions. We suggest you open the tool in another browser tab while you are working on this assessment.
Â
https://postgres.sophia.org/
Which of the following is true of foreign keys?
•         Â
A foreign key could be linked to a candidate key of a table.
•         Â
A foreign key can be linked to any foreign key.
•         Â
A foreign key should always be linked to a primary key of another table.
•         Â
A foreign key is not needed if the data type is different.
24
In each milestone, you may want or need to use the database and query tool to answer some of the questions. We suggest you open the tool in another browser tab while you are working on this assessment.
Â
https://postgres.sophia.org/
Given the following view that has been created, how would you query the view to list the artist names in ascending order and album titles in desc order?
CREATE VIEW album_artist_names
AS
SELECT album.title, artist.name
FROM album
INNER JOIN artist
ON album.artist_id = artist.artist_id;
•         Â
SELECT *
FROM album, artist
ORDER BY name ASC, title DESC;
•         Â
SELECT *
FROM album_artist_names
ORDER BY name DESC, title;
•         Â
SELECT *
FROM album_artist_names
ORDER BY name, title DESC;
•         Â
SELECT *
FROM album_artist_names
ORDER BY name DESC, title ASC;
25
In each milestone, you may want or need to use the database and query tool to answer some of the questions. We suggest you open the tool in another browser tab while you are working on this assessment.
Â
https://postgres.sophia.org/
In trying to delete from the playlist table, what is the cause of this error?
"Query failed because of: error: update or delete on table "playlist" violates foreign key constraint "playlist_track_playlist_id_fkey" on table "playlist_track"
•         Â
The playlist_id doesn't exist in the playlist table.
•         Â
The track has to be deleted first before the playlist is deleted.
•         Â
The playlist_id doesn't exist in the playlist_track table.
•         Â
The playlist_track table has a reference to the playlist_id that is being deleted.
Â
1
In each milestone, you may want or need to use the database and query tool to answer some of the questions. We suggest you open the tool in another browser tab while you are working on this assessment.
Â
https://postgres.sophia.org/
Which of the following is true of foreign keys?
•         Â
A foreign key should always be linked to a primary key of another table.
•         Â
A foreign key can be linked to any foreign key.
•         Â
Tables could be created first to avoid having to create foreign keys in order.
•         Â
A foreign key is not needed if the data type is different.
2
In each milestone, you may want or need to use the database and query tool to answer some of the questions. We suggest you open the tool in another browser tab while you are working on this assessment.
Â
https://postgres.sophia.org/
Which of the following statements would create a UNION between all of the countries we have customers, employees, or invoices in?
•         Â
SELECT country
FROM invoice
UNION
SELECT country
FROM customer
UNION
SELECT country
FROM employee;
•         Â
SELECT billing_country
FROM invoice
SELECT country
FROM customer
SELECT country
FROM employee;
•         Â
SELECT billing_country
FROM invoice
SELECT country
FROM customer
SELECT country
FROM employee
UNION;
•         Â
SELECT billing_country
FROM invoice
UNION
SELECT country
FROM customer
UNION
SELECT country
FROM employee;
3
In each milestone, you may want or need to use the database and query tool to answer some of the questions. We suggest you open the tool in another browser tab while you are working on this assessment.
Â
https://postgres.sophia.org/
Given the tables have been created without foreign keys added, which of the following ALTER TABLE statements would create a foreign key on the customer_id in the department table to reference the customer_id in the customer table?
•         Â
ALTER TABLE customer
ADD CONSTRAINT fk_department
FOREIGN KEY (customer_id)
REFERENCES department (customer_id);
•         Â
ALTER TABLE department
ADD CONSTRAINT
FOREIGN KEY (customer_id)
REFERENCES customer (customer_id);
•         Â
ALTER TABLE department
ADD CONSTRAINT fk_department
FOREIGN KEY (customer_id)
REFERENCES customer (customer_id);
•         Â
ALTER TABLE department
ADD CONSTRAINT fk_department
FOREIGN KEY customer (customer_id)
REFERENCES customer_id;
Â
4
In each milestone, you may want or need to use the database and query tool to answer some of the questions. We suggest you open the tool in another browser tab while you are working on this assessment.
Â
https://postgres.sophia.org/
Given the initial tables in our example database, if we wanted to delete tracks, albums, and artists that HAVE been purchased before, in what order do we need to delete data from our tables?
•         Â
track
album
artist
•         Â
artist
album
track
•         Â
invoice_line
invoice
track
album
artist
•         Â
artist
album
track
media_type
genre
5
In each milestone, you may want or need to use the database and query tool to answer some of the questions. We suggest you open the tool in another browser tab while you are working on this assessment.
https://postgres.sophia.org/
Which of the following query does NOT correctly use aliases?
•         Â
SELECT i.customer_id, i.total, c.last_name
FROM invoice AS i
JOIN customer AS c
USING (customer_id);
•         Â
SELECT c.customer_id, i.total, c.last_name
FROM invoice AS i
JOIN customer AS c
USING (customer_id);
•         Â
SELECT i.customer_id, total, last_name
FROM invoice AS i
JOIN customer AS c
USING (customer_id);
•         Â
SELECT c.customer_id, c.total, c.last_name
FROM invoice AS i
JOIN customer AS c
USING (customer_id);
6
In each milestone, you may want or need to use the database and query tool to answer some of the questions. We suggest you open the tool in another browser tab while you are working on this assessment.
https://postgres.sophia.org/
Which of the following statements will show the following result set?
Â
Â
•         Â
SELECT track_id, name
FROM track
JOIN playlist_track
WHERE track_id != NULL;
•         Â
SELECT track_id, name
FROM track
JOIN playlist_track
USING (track.name = playlist.name);
•         Â
SELECT track_id, name
FROM track
JOIN playlist_track
USING (track_id);
•         Â
SELECT track_id, name
FROM track, playlist_track;
7
In each milestone, you may want or need to use the database and query tool to answer some of the questions. We suggest you open the tool in another browser tab while you are working on this assessment.
Â
https://postgres.sophia.org/
Which result set requires a JOIN?
•         Â
Showing all album titles with both artist ID and album ID
•         Â
Showing artist_id with album title
•         Â
Showing all album_id's with artist names
•         Â
Showing artist names with artist_id's
8
In each milestone, you may want or need to use the database and query tool to answer some of the questions. We suggest you open the tool in another browser tab while you are working on this assessment.
Â
https://postgres.sophia.org/
Which results would show if the artist table LEFT JOINed the album table?
•         Â
All artists, even those with no albums in the album table
•         Â
All rows from the album table, even those that have NULL artist_id's
•         Â
Only artists from the artist table that have albums
•         Â
Only rows from the artist table that do not have related albums in the album table
9
In each milestone, you may want or need to use the database and query tool to answer some of the questions. We suggest you open the tool in another browser tab while you are working on this assessment.
Â
https://postgres.sophia.org/
Which of the following is the valid syntax for creating a VIEW to view a subset of a table?
•         Â
CREATE VIEW USA_customers
AS customer
SELECT *
WHERE country = 'USA';
•         Â
CREATE VIEW USA_customers
SELECT *
FROM customer
WHERE country = 'USA';
•         Â
CREATE VIEW USA_customers
AS
SELECT *
FROM customer
WHERE country = 'USA';
•         Â
CREATE VIEW USA_customers
AS customer
WHERE country = 'USA';
10
Â
Which of the following statements would be a valid DROP VIEW statement for an invoice_verification table that would prevent the removal of a view if there are any objects depending on it?
•         Â
DROP VIEW CASCADE invoice_verification;
•         Â
DROP VIEW invoice_verification RESTRICT;
•         Â
DROP VIEW IF EXISTS invoice_verification;
•         Â
DROP VIEW invoice_verification;
11
In each milestone, you may want or need to use the database and query tool to answer some of the questions. We suggest you open the tool in another browser tab while you are working on this assessment.
https://postgres.sophia.org/
Why is the following query valid for a NATURAL join?
Â
SELECT album.title, artist.name
FROM album
NATURAL JOIN artist;
•         Â
The two tables share identical columns.
•         Â
The tables do not have a foreign key relationship.
•         Â
The tables have a shared column, but their column names are not identical which makes it a candidate for a NATURAL JOIN.
•         Â
The query is not a valid NATURAL JOIN query and must use a JOIN... ON instead.
12
In each milestone, you may want or need to use the database and query tool to answer some of the questions. We suggest you open the tool in another browser tab while you are working on this assessment.
Â
https://postgres.sophia.org/
Given the following view that has been created, how would you query the playlist names and track names both in descending order?
CREATE VIEW playlist_track_names
AS
SELECT playlist.name as playlist_name, track.name as track_name
FROM playlist
INNER JOIN playlist_track
ON playlist.playlist_id = playlist_track.playlist_id
INNER JOIN track
ON playlist_track.track_id = track.track_id;
•         Â
SELECT *
FROM playlist_track_names
ORDER BY track_name, playlist_name;
•         Â
SELECT *
FROM playlist_track_names
ORDER BY playlist_name, track_name DESC;
•         Â
SELECT *
FROM playlist_track_names
ORDER BY playlist_name DESC, track_name DESC;
•         Â
SELECT *
FROM playlist_track_names
ORDER BY playlist_name ASC, track_name ASC;
13
In each milestone, you may want or need to use the database and query tool to answer some of the questions. We suggest you open the tool in another browser tab while you are working on this assessment.
Â
https://postgres.sophia.org/
Which of the following queries will use a subquery to find all of the rows in the track table that has the genre_id equal to 2 and has the length of the song in milliseconds longer than the maximum track length of all songs where the genre_id = 3?
•         Â
SELECT *
FROM TRACK
WHERE milliseconds >
(SELECT MAX(milliseconds)
FROM track
WHERE genre_id = 2)
AND genre_id = 3;
•         Â
SELECT *
FROM TRACK
WHERE milliseconds >
SELECT MAX(milliseconds)
FROM track
WHERE genre_id = 3
AND genre_id = 2;
•         Â
SELECT *
FROM TRACK
WHERE milliseconds >
(SELECT MIN(milliseconds)
FROM track
WHERE genre_id = 3)
AND genre_id = 2;
•         Â
SELECT *
FROM TRACK
WHERE milliseconds >
(SELECT MAX(milliseconds)
FROM track
WHERE genre_id = 3)
AND genre_id = 2;
14
In each milestone, you may want or need to use the database and query tool to answer some of the questions. We suggest you open the tool in another browser tab while you are working on this assessment.
https://postgres.sophia.org/
Use the following data model for this question:
Â
Outfit
outfit_id
name
Â
ClothingPiece
piece_id
name
Â
OutfitPiece
outfit_piece_id
outfit_id
piece_id
Â
Which of the following is a situation where an OUTER JOIN could be useful?
•         Â
To view outfits with just one clothing piece
•         Â
To view all the clothing pieces, even if they haven't been associated with an outfit in the outfits table
•         Â
To view clothing pieces that are assigned to multiple outfits
•         Â
To view clothing pieces that have already been assigned to outfits
15
In each milestone, you may want or need to use the database and query tool to answer some of the questions. We suggest you open the tool in another browser tab while you are working on this assessment.
Â
https://postgres.sophia.org/
Which of the following queries would check for duplicates of a track's composer in the track table and how many there are of each?
•         Â
SELECT composer, COUNT(*)
FROM track
GROUP BY composer
HAVING COUNT(*) > 1;
•         Â
SELECT composer, COUNT(*)
FROM track
HAVING COUNT(*) > 1;
•         Â
SELECT composer
FROM track
GROUP BY composer
HAVING COUNT(*) > 1;
•         Â
SELECT track_id, COUNT(*)
FROM track
GROUP BY track_id
HAVING COUNT(*) > 1;
16
In each milestone, you may want or need to use the database and query tool to answer some of the questions. We suggest you open the tool in another browser tab while you are working on this assessment.
Â
https://postgres.sophia.org/
Given the following queries, which of these would be the most efficient?
Â
1. SELECT *
FROM invoice
WHERE customer_id IN
(SELECT customer_id
FROM customer
WHERE country like 'U%');
Â
2. SELECT invoice.*
FROM invoice
INNER JOIN customer
ON customer.customer_id = invoice.customer_id
WHERE country like 'U%';
•         Â
Both would be the same as both use the same indices for the join and filter.
•         Â
Query #1 would be more efficient as it is based on primary and foreign keys.
•         Â
Query #2 would be more efficient as it is not using indexed columns.
•         Â
Query #2 would be more efficient as it is based on primary and foreign keys.
Check other also
Â
17
In each milestone, you may want or need to use the database and query tool to answer some of the questions. We suggest you open the tool in another browser tab while you are working on this assessment.
Â
https://postgres.sophia.org/
Which of the following is the valid syntax for creating a VIEW to view data from multiple tables?
•         Â
CREATE VIEW album_artist_names
AS
SELECT album.title, artist.name
FROM album
ON album.artist_id = artist.artist_id;
•         Â
CREATE VIEW album_artist_names
SELECT album.title, artist.name
FROM album
INNER JOIN artist
ON album.artist_id = artist.artist_id;
•         Â
CREATE VIEW album artist names
AS
SELECT album.title, artist.name
FROM album
INNER JOIN artist
ON album.artist_id = artist.artist_id;
•         Â
CREATE VIEW album_artist_names
AS
SELECT album.title, artist.name
FROM album
INNER JOIN artist
ON album.artist_id = artist.artist_id;
18
In each milestone, you may want or need to use the database and query tool to answer some of the questions. We suggest you open the tool in another browser tab while you are working on this assessment.
Â
https://postgres.sophia.org/
In trying to insert into the playlist_track table, what is the cause of this error?
Query failed because of: error: insert or update on table "playlist_track" violates foreign key constraint "playlist_track_playlist_id_fkey"
•         Â
The playlist_id needs to be added to the playlist table first.
•         Â
The playlist_id being referenced doesn't exist in the playlist table.
•         Â
The playlist_track_id is not unique.
•         Â
The playlist_id in the playlist_track table doesn't exist yet.
19
In each milestone, you may want or need to use the database and query tool to answer some of the questions. We suggest you open the tool in another browser tab while you are working on this assessment.
Â
https://postgres.sophia.org/
Which of the following data models appropriately models the relationship of companies and their phone numbers?
•         Â
Company
company_id
company_name
phone_id (FK)
Â
Phone
phone_id
phone_type
phone_number
•         Â
Company
company_id
company_name
Â
Phone
phone_id
company_id (FK)
phone_type
phone_number
•         Â
Phone
phone_id
company_name
phone_type
phone_number
•         Â
Company
company_id
company_name
phone_type_1
phone_number_1
phone_type_2
phone_number_2
20
In each milestone, you may want or need to use the database and query tool to answer some of the questions. We suggest you open the tool in another browser tab while you are working on this assessment.
Â
https://postgres.sophia.org/
Genre
genre_id         name
1Â Â Â Â Â Â Â Â Â Broadway
2Â Â Â Â Â Â Â Â Â Rock
3Â Â Â Â Â Â Â Â Â Classical
4Â Â Â Â Â Â Â Â Â Salsa
Â
Track
track_id          name  genre_id
1         Highway to Hell        2
2         Everlong        2
3         Smells Like Teen Spirit         2
Â
Given the above genres and tracks, how many results will be returned for the following query?
SELECT genre.name, track.name
FROM track
RIGHT JOIN genre
USING (genre_id);
•         Â
5
•         Â
4
•         Â
3
•         Â
6
21
In each milestone, you may want or need to use the database and query tool to answer some of the questions. We suggest you open the tool in another browser tab while you are working on this assessment.
Â
https://postgres.sophia.org/
What will be the result of the query based on the following criteria?
<columnname>Â <=Â ANY (<subquery>)
•         Â
Returns true if the value is less than or equal to any of the values returned by the subquery.
•         Â
Returns true if the value is less than any of the values returned by the subquery.
•         Â
Returns true if the value is less than or equal to the smallest value returned by the subquery.
•         Â
Returns true if the value is less than the smallest value returned by the subquery.
22
In each milestone, you may want or need to use the database and query tool to answer some of the questions. We suggest you open the tool in another browser tab while you are working on this assessment.
Â
https://postgres.sophia.org/
Which of the following statements would query the invoice_line table to sum up the totals by multiplying the unit_price with the quantity grouped by track_id?
•         Â
SELECT track_id, (quantity * unit_price) AS total
FROM invoice_line
GROUP BY track_id
ORDER BY total DESC;
•         Â
SELECT track_id, SUM(quantity * unit_price) AS total
FROM invoice_line
ORDER BY total DESC;
•         Â
SELECT track_id, SUM(quantity * unit_price) AS total
FROM invoice_line
GROUP BY track_id
ORDER BY total DESC;
•         Â
SELECT track_id, (quantity / unit_price) AS total
FROM invoice_line
GROUP BY track_id
ORDER BY total DESC;
23
In each milestone, you may want or need to use the database and query tool to answer some of the questions. We suggest you open the tool in another browser tab while you are working on this assessment.
Â
https://postgres.sophia.org/
What type of situation would you need to create or replace a view?
•         Â
On a daily basis so that the data is refreshed.
•         Â
The view needs to have update, insert, and delete statements allowed.
•         Â
The view is no longer being used.
•         Â
A view has already been created with the same name but needs to be changed.
24
In each milestone, you may want or need to use the database and query tool to answer some of the questions. We suggest you open the tool in another browser tab while you are working on this assessment.
Â
https://postgres.sophia.org/
Animal
animal_id
name
adopter_id
Â
Adopter
adopter_id
name
Â
Given the above data for an adoption agency, what does the result set for the following query represent?
Â
SELECT adopter.name, animal.name
FROM Animal
CROSS JOIN Adopter;
•         Â
It represents all adopters regardless of whether they have claimed an animal in the animal table.
•         Â
It represents each animal, with the name of their adopter if that has been specified via a Foreign Key.
•         Â
It represents every single Animal in the animal table regardless of whether they have been adopted or not.
•         Â
It represents every single animal matches with every single adopter.
25
In each milestone, you may want or need to use the database and query tool to answer some of the questions. We suggest you open the tool in another browser tab while you are working on this assessment.
https://postgres.sophia.org/
Which of the following is a correctly formatted SELECT statement to show the following result set with the media type's name and the track's name?
•         Â
SELECT media_type.name, track.name
FROM track
JOIN media_type
ON media_type.media_type_id = track.track_id;
•         Â
SELECT media_type.name, track.name
FROM track
JOIN media_type
ON media_type.media_type.id = track.media_type.id;
•         Â
SELECT media_type.name, track.name
FROM track
JOIN media_type
ON mediatype.media_type_id = track.media_type_id;
•         Â
SELECT media_type.name, track.name
FROM track
JOIN media_type
ON media_type.media_type_id = track.media_type_id;
Â
Â
In each milestone, you may want or need to use the database and query tool to answer some of the questions. We suggest you open the tool in another browser tab while you are working on this assessment.
https://postgres.sophia.org/
Which of the following statements will be able to show the following result set?
Â
•         Â
SELECT invoice_id, billing_state, state
FROM invoice, customer;
•         Â
SELECT invoice_id, billing_state, state
FROM inuoice
JOIN consumer
USING (customer_id);
•         Â
SELECT invoice_id, billing_state, state
FROM invoice
WHERE customer_id != NULL;
•         Â
SELECT invoice_id, billing_state, state
FROM invoice
JOIN customer
USING (customer_id);
Â
In each milestone, you may want or need to use the database and query tool to answer some of the questions. We suggest you open the tool in another browser tab while you are working on this assessment.
Â
https://postgres.sophia.org/
Which of the following statements would create a UNION between all of the cities we have customers, employees, or invoices in?
•         Â
SELECT billing_city
FROM invoice
SELECT city
FROM customer
SELECT city
FROM employee
UNION;
•         Â
SELECT city
FROM invoice
UNION
SELECT city
FROM customer
UNION
SELECT city
FROM employee;
•         Â
SELECT billing_city
FROM invoice
UNION
SELECT city
FROM customer
UNION
SELECT city
FROM employee;
•         Â
SELECT billing_city
FROM invoice
SELECT city
FROM customer
SELECT city
FROM employee;
Â
In each milestone, you may want or need to use the database and query tool to answer some of the questions. We suggest you open the tool in another browser tab while you are working on this assessment.
https://postgres.sophia.org/
Which of the following is a correctly formatted SELECT statement to show the following result set with the track's name, the track's millisecond, and the playlist_track's playlist_id?
•         Â
SELECT name, milliseconds, playlist_id
FROM track
JOIN playlist_track
ON track_id;
•         Â
SELECT name, milliseconds, playlist_id
FROM track
JOIN playlist_track
ON track.trackid = playlisttrack.trackid;
•         Â
SELECT name, milliseconds, playlist_id
FROM track
JOIN playlist_track
ON track.playlist_id = playlist_track.playlist_id;
•         Â
SELECT name, milliseconds, playlist_id
FROM track
JOIN playlist_track
ON track.track_id = playlist_track.track_id;
Â
In each milestone, you may want or need to use the database and query tool to answer some of the questions. We suggest you open the tool in another browser tab while you are working on this assessment.
Â
https://postgres.sophia.org/
Which of the following statements would calculate the max bytes per millisecond grouped by the album_id in the track table?
•         Â
SELECT album_id, MAX(bytes/milliseconds)
FROM track
GROUP BY album_id;
•         Â
SELECT album_id, MAX(milliseconds/bytes)
FROM track
GROUP BY album_id;
•         Â
SELECT album_id, MIN(bytes/milliseconds) FROM track
GROUP BY album_id;
•         Â
SELECT album_id, SUM(bytes/milliseconds)
FROM track
GROUP BY album_id;
Â
In each milestone, you may want or need to use the database and query tool to answer some of the questions. We suggest you open the tool in another browser tab while you are working on this assessment.
Â
https://postgres.sophia.org/
What type of situation would you need to create or replace a view?
•         Â
On a daily basis so that the data is refreshed.
•         Â
The view's underlying data has to be changed to other tables.
•         Â
Data has been imported from other databases.
•         Â
The data in the tables have changed.
Â
In each milestone, you may want or need to use the database and query tool to answer some of the questions. We suggest you open the tool in another browser tab while you are working on this assessment.
Â
https://postgres.sophia.org/
Given the tables have been created without foreign keys added, which of the following ALTER TABLE statements would create a foreign key on the organization_id in the donor table to reference the organization_id in the organization table?
•         Â
ALTER TABLE donor
ADD CONSTRAINT
FOREIGN KEY (organization_id)
REFERENCES organization (organization_id);
•         Â
ALTER TABLE donor
ADD CONSTRAINT fk_donor
FOREIGN KEY organization (organization_id)
REFERENCES organization_id;
•         Â
ALTER TABLE organization
ADD CONSTRAINT fk_donor
FOREIGN KEY (organization_id)
REFERENCES donor (organization_id);
•         Â
ALTER TABLE donor
ADD CONSTRAINT fk_donor
FOREIGN KEY (organization_id)
REFERENCES organization (organization_id);
Â
Â
In each milestone, you may want or need to use the database and query tool to answer some of the questions. We suggest you open the tool in another browser tab while you are working on this assessment.
Â
https://postgres.sophia.org/
Which of the following queries will use a subquery to find all of the rows in the track table that has a unit_price of 0.99 and has the length of the song in milliseconds that is longer than the AVG track length of all tracks in the album_id between 5 and 10?
•         Â
SELECT *
FROM TRACK
WHERE milliseconds >
(SELECT AVG(milliseconds)
FROM track
WHERE unit_price = 0.99)
AND album_id BETWEEN 5 AND 10;
•         Â
SELECT AVG(milliseconds)
FROM TRACK
WHERE milliseconds >
(SELECT *
FROM track
WHERE album_id BETWEEN 5 AND 10)
AND unit_price = 0.99;
•         Â
SELECT *
FROM TRACK
WHERE milliseconds >
SELECT AVG(milliseconds)
FROM track
WHERE album_id BETWEEN 5 AND 10
AND unit_price = 0.99;
•         Â
SELECT *
FROM TRACK
WHERE milliseconds >
(SELECT AVG(milliseconds)
FROM track
WHERE album_id BETWEEN 5 AND 10)
AND unit_price = 0.99;
Â
Â
In each milestone, you may want or need to use the database and query tool to answer some of the questions. We suggest you open the tool in another browser tab while you are working on this assessment.
Â
https://postgres.sophia.org/
Genre
genre_id         name
1Â Â Â Â Â Â Â Â Â Broadway
2Â Â Â Â Â Â Â Â Â Rock
3Â Â Â Â Â Â Â Â Â Classical
4Â Â Â Â Â Â Â Â Â Salsa
Â
Â
Track
track_id          name  genre_id
1         Highway to Hell        2
2         Everlong        2
3         Smells Like Teen Spirit         2
Â
Given the above genres and tracks, how many results will be returned for the following query?
Â
SELECT genre.name, track.name
FROM genre
RIGHT JOIN track
USING (genre_id);
•         Â
5
•         Â
4
•         Â
3
•         Â
6
Â
1
In each milestone, you may want or need to use the database and query tool to answer some of the questions. We suggest you open the tool in another browser tab while you are working on this assessment.
Â
https://postgres.sophia.org/
Which of the following operators will attempt to use a hash or b-tree index?
•         Â
&&
•         Â
@>
•         Â
>>Â
•         Â
=
2
In each milestone, you may want or need to use the database and query tool to answer some of the questions. We suggest you open the tool in another browser tab while you are working on this assessment.
Â
https://postgres.sophia.org/
Which of the following statements would create a role named regular_user with no added features?
•         Â
CREATE ROLE regular_user;
•         Â
CREATE ROLE regular_user CREATEROLE;
•         Â
CREATE ROLE regular_user INHERIT;
•         Â
CREATE ROLE regular_user NOINHERIT;
3
In each milestone, you may want or need to use the database and query tool to answer some of the questions. We suggest you open the tool in another browser tab while you are working on this assessment.
https://postgres.sophia.org/
Which of the following scenarios reflects the durability property?
•         Â
1. A user attempts to do a product transfer between companies.
2. The quantity of the product is moved from the first company.
3. Only once the product is verified to have been deducted, the quantity is moved to the second company.
4. Verification is done and identifies that the total amounts before and after the transactions are not maintained.
5. The transaction is reverted.
•         Â
1. In the library database, there are 50 books available.
2. Billy has checked and there are 50 books.
3. Sam has checked and there are 50 books.
4. Billy has taken out 5 books.
5. The library system informs Sam of the update and Sam now checks that there are 45 books.
6. Sam checks out 10 books.
7. There are now 35 books in the library database.
•         Â
1. Tiffany has updated a customer's address while on the phone with them.
2. The server restarted after Tiffany clicked on save.
3. When the server comes back up, Tiffany was able to verify that the address was updated.
•         Â
1. In the flower database, there are 50 flowers available.
2. Reese has checked and there are 50 flowers.
3. Reese has attempted to take out 5 flowers.
4. Which trying to take them out, there was an error in trying to dispense.
5. While checking, there are still 50 flowers available in the system.
4
In each milestone, you may want or need to use the database and query tool to answer some of the questions. We suggest you open the tool in another browser tab while you are working on this assessment.
Â
https://postgres.sophia.org/
Which is an advantage of both the command line and the GUI?
•         Â
We can encode the backup file to another format.
•         Â
We can restore a remote database.
•         Â
We can use any parameters without limitation.
•         Â
We can backup multiple databases at once.
5
In each milestone, you may want or need to use the database and query tool to answer some of the questions. We suggest you open the tool in another browser tab while you are working on this assessment.
Â
https://postgres.sophia.org/
Which of the following statements would restore only the table 'customer' from the mydatabase database from backup.sql?
•         Â
psql -t customer mydatabase < backup.sql
•         Â
psql -a customer mydatabase < backup.sql
•         Â
psql -t customer < backup.sql
•         Â
psql mydatabase customer < backup.sql
6
In each milestone, you may want or need to use the database and query tool to answer some of the questions. We suggest you open the tool in another browser tab while you are working on this assessment.
https://postgres.sophia.org/
Which of the following criterion is specific to the isolation property?
•         Â
All SQL requests of a transaction must be completed; if not, the transaction must be aborted.
•         Â
Data used in one transaction cannot be used in another transaction until the first transaction is completed.
•         Â
When a transaction is completed, the database must be in a consistent state.
•         Â
Once transaction changes are done and saved, they cannot be lost.
7
In each milestone, you may want or need to use the database and query tool to answer some of the questions. We suggest you open the tool in another browser tab while you are working on this assessment.
Â
https://postgres.sophia.org/
Using which type of process between the user input and dynamically created statements can help reduce the number of SQL injection attacks?
•         Â
Coding
•         Â
Posting
•         Â
Filtering
•         Â
Construction
8
In each milestone, you may want or need to use the database and query tool to answer some of the questions. We suggest you open the tool in another browser tab while you are working on this assessment.
Â
https://postgres.sophia.org/
Which of the following statements will grant update permissions on the customer table to all users?
•         Â
GRANT UPDATE ON 'customer' TO 'public';
•         Â
GRANT UPDATE ON customer TO public;
•         Â
GRANT UPDATE ON customer TO ALL;
•         Â
GRANT UPDATE ON public to customer;
9
In each milestone, you may want or need to use the database and query tool to answer some of the questions. We suggest you open the tool in another browser tab while you are working on this assessment.
https://postgres.sophia.org/
Which of the following scenarios reflects the atomicity property?
•         Â
1. Tiffany has updated a customer's address while on the phone with them.
2. The server restarted after Tiffany clicked on save.
3. When the server came back up, Tiffany was able to verify that the address was updated.
•         Â
1. A user attempts to do a product transfer between companies.
2. The quantity of the product is moved from the first company.
3. The quantity is moved to the second company without verifying that it has been deducted from the first company.
4. The transaction is accepted.
•         Â
1. In the flower database, there are 50 flowers available.
2. Reese has checked and there are 50 flowers.
3. Reese has attempted to take out 5 flowers.
4. While trying to take them out, there was an error in trying to dispense.
5. While checking, there are still 50 flowers available in the system.
•         Â
1. In the library database, there are 50 books available.
2. Billy has checked and there are 50 books.
3. Sam has checked and there are 50 books.
4. Billy has taken out 5 books.
5. The library system informs Sam of the update and Sam now checks that there are 45 books.
6. Sam checks out 10 books.
7. There are now 35 books in the library database.
10
In each milestone, you may want or need to use the database and query tool to answer some of the questions. We suggest you open the tool in another browser tab while you are working on this assessment.
Â
https://postgres.sophia.org/
Which of the following sequences of statements would ensure that Jennifer has the privileges of the roles of finance and executive?
•         Â
CREATE ROLE executive NOINHERIT;
CREATE ROLE finance NOINHERIT;
GRANT executive to jennifer;
GRANT executive to finance;
•         Â
CREATE ROLE executive INHERIT;
CREATE ROLE finance INHERIT;
GRANT finance to jennifer;
GRANT executive to jennifer;
•         Â
CREATE ROLE executive NOINHERIT;
CREATE ROLE finance INHERIT;
GRANT finance to jennifer;
GRANT executive to finance;
•         Â
CREATE ROLE executive NOINHERIT;
CREATE ROLE finance NOINHERIT;
GRANT finance to jennifer;
GRANT executive to finance;
11
In each milestone, you may want or need to use the database and query tool to answer some of the questions. We suggest you open the tool in another browser tab while you are working on this assessment.
Â
https://postgres.sophia.org/
Which of the following statements represents a correctly structured transaction?
•         Â
BEGIN;
COMMIT;
UPDATE customer
SET postal_code = '33433'
WHERE customer_id = 22;
UPDATE customer
SET postal_code = '10789'
WHERE city = 'Berlin';
UPDATE customer
SET company = 'Humor Inc.'
WHERE city = 'Prague';
•         Â
BEGIN;
UPDATE customer
SET postal_code = '33433'
WHERE customer_id = 22;
UPDATE customer
SET postal_code = '10789'
WHERE city = 'Berlin';
UPDATE customer
SET company = 'Humor Inc.'
WHERE city = 'Prague';
COMMIT;
•         Â
UPDATE customer
SET postal_code = '33433'
WHERE customer_id = 22;
UPDATE customer
SET postal_code = '10789'
WHERE city = 'Berlin';
UPDATE customer
SET company = 'Humor Inc.'
WHERE city = 'Prague';
COMMIT;
•         Â
BEGIN
UPDATE customer
SET postal_code = '33433'
WHERE customer_id = 22
UPDATE customer
SET postal_code = '10789'
WHERE city = 'Berlin'
UPDATE customer
SET company = 'Humor Inc.'
WHERE city = 'Prague'
COMMIT
12
In each milestone, you may want or need to use the database and query tool to answer some of the questions. We suggest you open the tool in another browser tab while you are working on this assessment.
Â
https://postgres.sophia.org/
Which type of backup would require no more than 2 backup sets?
•         Â
Full backup and nightly backup
•         Â
Incremental and full backup
•         Â
Differential and incremental backup
•         Â
Differential and full backup
13
In each milestone, you may want or need to use the database and query tool to answer some of the questions. We suggest you open the tool in another browser tab while you are working on this assessment.
https://postgres.sophia.org/
Which of the following scenarios reflect the consistency property?
•         Â
1. Jeff checks his user profile and sees his email address is set to jeff@gmail.com.
2. Jeff changes his email to set it to jeff@outlook.com but does not click on save yet.
3. A customer rep checks into Jeff's account and sees jeff@gmail.com.
4. Jeff clicks on save.
5. Another customer rep checks Jeff's account and sees jeff@outlook.com.
•         Â
1. User 1 has $500 in their online account.
2. User 2 has $300 in their online account.
3. User 1 sends user 2 $100.
4. User 1 has $400 in their account.
5. User 2 has $300 in their account.
6. The transaction is reverted.
•         Â
1. A fairly large transaction is run to import new customers.
2. The import is saved to the logs.
3. The import starts to then save to the disk.
4. The disk fails midway through the update.
5. A new disk replaces the failed disk.
6. The backup is applied and the saving of the data is run from the logs.
•         Â
1. A vendor has 5 orders available.
2. A customer attempts to purchase all 5.
3. The system deducts it from the vendor and adds it to the customer.
4. The vendor now has 0 orders available.
5. The customer has 0 orders purchased.
5. The transaction is saved.
14
In each milestone, you may want or need to use the database and query tool to answer some of the questions. We suggest you open the tool in another browser tab while you are working on this assessment.
https://postgres.sophia.org/
Which of the following statements would create a user login role named testuser1 with the password set as testpassword1 that is valid until 2042-01-01?
•         Â
CREATE ROLE 'testuser1'
LOGIN
PASSWORD 'testpassword1'
EXPIRES '2042-01-01'
•         Â
CREATE ROLE testuser1
LOGIN
VALID UNTIL '2042-01-01'
PASSWORD 'testpassword1'
•         Â
CREATE ROLE testuser1
LOGIN
PASSWORD 'testpassword1'
VALID UNTIL '2042-01-01'
•         Â
CREATE USER testuser1
LOGIN
PASSWORD testpassword1
VALID UNTIL 2042-01-01
15
In each milestone, you may want or need to use the database and query tool to answer some of the questions. We suggest you open the tool in another browser tab while you are working on this assessment.
https://postgres.sophia.org/
Which of the following scenarios reflects the isolation property?
•         Â
1. User 1 has $500 in their online account.
2. User 2 has $300 in their online account.
3. User 1 sends user 2 $100.
4. User 1 has $400 in their account.
5. User 2 has $300 in their account.
6. The transaction is reverted.
•         Â
1. The product quantity starts at 200.
2. Transaction 1 runs to read the quantity of the product to be updated.
3. Transaction 2 runs in parallel to read the quantity of the product to be updated.
4. Transaction 1 updates the product quantity to reduce it by 100.
5. Transaction 2 updates the product quantity to reduce it by 5.
6. The product quantity ends at 195.
•         Â
1. A fairly large update to the products table.
2. The update is saved to the logs.
3. The update starts to then save to the disk.
4. The system fails midway through.
5. When the system starts back up, the committed transactions that haven't been written to disk are written.
•         Â
1. Transaction 1 reads a product's cost which is set at $100.
2. Transaction 1 updates the product to set the price to $90.
3. Transaction 2 reads the same product's cost and sees $100.
4. Transaction 1 commits the cost.
5. Transaction 3 reads the same product's cost and sees $90.
16
In each milestone, you may want or need to use the database and query tool to answer some of the questions. We suggest you open the tool in another browser tab while you are working on this assessment.
Â
https://postgres.sophia.org/
Which of the following permissions are automatically granted to a user?
•         Â
All permissions need to be granted to the user or role.
•         Â
Access to any piece that touches the underlying system
•         Â
Permission to change items in the database
•         Â
Access to enabling extensions
17
In each milestone, you may want or need to use the database and query tool to answer some of the questions. We suggest you open the tool in another browser tab while you are working on this assessment.
https://postgres.sophia.org/
Â
Consider the following scenario:
1. Update
ROLLBACK
2. Insert
3. Insert
COMMIT
4. Delete
5. Update
COMMIT
In this scenario, which statements would be saved to the database, assuming these are all in a single transaction?
•         Â
1, 2, 3, 4, 5
•         Â
2, 3, 4, 5
•         Â
4, 5
•         Â
2, 3
18
In each milestone, you may want or need to use the database and query tool to answer some of the questions. We suggest you open the tool in another browser tab while you are working on this assessment.
Â
https://postgres.sophia.org/
Which of the following statements would clean the database objects in a data dump of the mydatabase to backup.sql, prior to outputting the commands to create them?
•         Â
pg_dump mydatabase > backup.sql
•         Â
pg_dump -c mydatabase > backup.sql
•         Â
pg_dump -a mydatabase > backup.sql
•         Â
pg_dump -b mydatabase > backup.sql
19
In each milestone, you may want or need to use the database and query tool to answer some of the questions. We suggest you open the tool in another browser tab while you are working on this assessment.
Â
https://postgres.sophia.org/
In which of the following cases would it make the most sense to use a b-tree index?
•         Â
SELECT *
FROM customer
WHERE fax LIKE '+55%';
•         Â
SELECT *
FROM album
WHERE artist_id < 5;
•         Â
SELECT *
FROM employee
WHERE address LIKE '%i%';
•         Â
SELECT *
FROM customer
WHERE customer_id > 10 AND customer_id < 20;
20
In each milestone, you may want or need to use the database and query tool to answer some of the questions. We suggest you open the tool in another browser tab while you are working on this assessment.
Â
https://postgres.sophia.org/
Which of the following DROP INDEX statements would give a notice if the index does not exist but not an error?
•         Â
DROP INDEX myindex RESTRICT;
•         Â
DROP INDEX IF EXISTS myindex;
•         Â
DROP INDEX CONCURRENTLY myindex;
•         Â
DROP INDEX myindex;
21
In each milestone, you may want or need to use the database and query tool to answer some of the questions. We suggest you open the tool in another browser tab while you are working on this assessment.
Â
https://postgres.sophia.org/
In which of the following cases would it make the most sense to use a hash index?
•         Â
SELECT *
FROM customer
WHERE email LIKE '%gmail%';
•         Â
SELECT *
FROM employee
WHERE employee_id > 2;
•         Â
SELECT *
FROM invoice
WHERE invoice_id > 10 AND invoice_id < 200;
•         Â
SELECT *
FROM track
WHERE album_id = 10;
Â
1
In each milestone, you may want or need to use the database and query tool to answer some of the questions. We suggest you open the tool in another browser tab while you are working on this assessment.
Â
https://postgres.sophia.org/
Which of the following operators will attempt to use a GiST index?
•         Â
<=
•         Â
<<Â
•         Â
<Â
•         Â
>Â
2
In each milestone, you may want or need to use the database and query tool to answer some of the questions. We suggest you open the tool in another browser tab while you are working on this assessment.
Â
https://postgres.sophia.org/
Which of the following statements represents a correctly structured transaction?
•         Â
UPDATE track
set media_type_id = 1
where album_id = 3;
DELETE FROM playlist
WHERE playlist_id = 1;
INSERT INTO genre (genre_id, name)
VALUES (30, 'Funk' ),(31,'Classical'),(32,'Pop Rock');
COMMIT;
•         Â
BEGIN
UPDATE track
set media_type_id = 1
where album_id = 3
DELETE FROM playlist
WHERE playlist_id = 1
INSERT INTO genre (genre_id, name)
VALUES (30, 'Funk' ),(31,'Classical'),(32,'Pop Rock')
COMMIT
•         Â
BEGIN;
UPDATE track
set media_type_id = 1
where album_id = 3;
DELETE FROM playlist
WHERE playlist_id = 1;
INSERT INTO genre (genre_id, name)
VALUES (30, 'Funk' ),(31,'Classical'),(32,'Pop Rock');
COMMIT;
•         Â
BEGIN;
COMMIT;
UPDATE track
set media_type_id = 1
where album_id = 3;
DELETE FROM playlist
WHERE playlist_id = 1;
INSERT INTO genre (genre_id, name)
VALUES (30, 'Funk' ),(31,'Classical'),(32,'Pop Rock');
3
In each milestone, you may want or need to use the database and query tool to answer some of the questions. We suggest you open the tool in another browser tab while you are working on this assessment.
https://postgres.sophia.org/
Which of the following scenarios reflect the consistency property?
•         Â
1. In the flower database, there are 50 flowers available
2. Reese has checked and there are 50 flowers.
3. Reese has attempted to take out 5 flowers.
4. Which trying to take them out, there was an error in trying to dispense.
5. While checking, there are still 50 flowers available in the system.
•         Â
1. A user attempts to do a product transfer between companies.
2. The quantity of the product is moved from the first company.
3. Only once the product is verified to have been deducted, the quantity is moved to the second company.
4. Verification is done and identifies that the total amounts before and after the transactions are not maintained.
5. The transaction is reverted.
•         Â
1. In the library database, there are 50 books available
2. Billy has checked and there are 50 books.
3. Sam has checked and there are 50 books.
4. Billy has taken out 5 books.
5. The library system informs Sam of the update and Sam now checks that there are 45 books.
6. Sam checks out 10 books.
7. There are now 35 books in the library database.
•         Â
1. Tiffany has updated a customer's address while on the phone with them.
2. The server restarted after Tiffany clicked on save.
3. When the server comes back up, Tiffany was able to verify that the address was updated.
4
In each milestone, you may want or need to use the database and query tool to answer some of the questions. We suggest you open the tool in another browser tab while you are working on this assessment.
https://postgres.sophia.org/
Which of the following scenarios reflects the atomicity property?
•         Â
1. Jeff checks his user profile and sees his email address is set to jeff@gmail.com.
2. Jeff changes his email to set it to jeff@outlook.com but does not click on save yet.
3. A customer rep checks into Jeff's account and sees jeff@gmail.com.
4. Jeff clicks on save.
5. Another customer rep checks Jeff's account and sees jeff@outlook.com.
•         Â
1. User 1 has $800 in their online account.
2. User 2 has $600 in their online account.
3. User 1 sends user 2 $100.
4. User 1 has $700 in their account.
5. User 2 has $600 in their account.
6. The transaction is saved.
•         Â
1. A vendor has 5 orders available.
2. A customer attempts to purchase all 5.
3. The system deducts it from the vendor and adds it to the customer.
4. The vendor now has 0 orders available.
5. The customer has 5 orders purchased.
6. The transaction is saved.
•         Â
1. A fairly large transaction is run to import new customers.
2. The import is saved to the logs.
3. The import starts to then save to the disk.
4. The disk fails midway through the update.
5. A new disk replaces the failed disk.
6. The backup is applied and the saving of the data is run from the logs.
5
In each milestone, you may want or need to use the database and query tool to answer some of the questions. We suggest you open the tool in another browser tab while you are working on this assessment.
https://postgres.sophia.org/
Which of the following scenarios reflects the durability property?
•         Â
1. Jeff checks his user profile and sees his email address is set to jeff@gmail.com.
2. Jeff changes his email to set it to jeff@outlook.com but does not click on save yet.
3. A customer rep checks into Jeff's account and sees jeff@gmail.com.
4. Jeff clicks on save.
5. Another customer rep checks Jeff's account and sees jeff@outlook.com.
•         Â
1. A fairly large transaction is run to import new customers.
2. The import is saved to the logs.
3. The import starts to then save to the disk.
4. The disk fails midway through the update before being committed.
5. A new disk replaces the failed disk.
6. The backup is applied and the saving of the data is run from the logs.
•         Â
1. User 1 has $500 in their online account.
2. User 2 has $300 in their online account.
3. User 1 sends user 2 $100.
4. User 1 has $400 in their account.
5. User 2 has $300 in their account.
6. The transaction is reverted.
•         Â
1. A vendor has 5 orders available.
2. A customer attempts to purchase all 5.
3. The system deducts it from the vendor and adds it to the customer.
4. The vendor now has 0 orders available.
5. The customer has 5 orders purchased.
6. The transaction is saved.
6
In each milestone, you may want or need to use the database and query tool to answer some of the questions. We suggest you open the tool in another browser tab while you are working on this assessment.
https://postgres.sophia.org/
Which of the following statements would create a role named database_admin which gives them the ability to create databases?
•         Â
CREATE ROLE database_admin INHERIT;
•         Â
CREATE ROLE database_admin NOINHERIT;
•         Â
CREATE ROLE database_admin CREATEROLE;
•         Â
CREATE ROLE database_admin CREATEDB;
7
In each milestone, you may want or need to use the database and query tool to answer some of the questions. We suggest you open the tool in another browser tab while you are working on this assessment.
Â
https://postgres.sophia.org/
Which type of backup would result in the largest storage space?
•         Â
Nightly backup
•         Â
Full backup
•         Â
Incremental backup
•         Â
Differential backup
8
In each milestone, you may want or need to use the database and query tool to answer some of the questions. We suggest you open the tool in another browser tab while you are working on this assessment.
Â
https://postgres.sophia.org/
Which of the following statements would only restore the schema, but not the data, of the database mydatabase from backup.sql?
•         Â
pg_restore mydatabase < backup.sql
•         Â
pg_restore -s mydatabase < backup.sql
•         Â
pg_restore -a mydatabase < backup.sql
•         Â
pg_restore -d mydatabase < backup.sql
9
In each milestone, you may want or need to use the database and query tool to answer some of the questions. We suggest you open the tool in another browser tab while you are working on this assessment.
Â
https://postgres.sophia.org/
In which of the following cases would it make the most sense to use a hash index?
•         Â
SELECT *
FROM employee
WHERE address LIKE '%i%';
•         Â
SELECT *
FROM customer
WHERE customer_id > 10 AND customer_id < 20;
•         Â
SELECT *
FROM album
WHERE artist_id < 5;
•         Â
SELECT *
FROM track
WHERE media_type_id = 1;
10
In each milestone, you may want or need to use the database and query tool to answer some of the questions. We suggest you open the tool in another browser tab while you are working on this assessment.
https://postgres.sophia.org/
Which of the following properties are specific to the durability property?
•         Â
In the event of system failure, no transactions that were done can be undone.
•         Â
Data used in one transaction cannot be used in another transaction until the first transaction is completed.
•         Â
A transaction should be treated as a single logical unit of work that is indivisible.
•         Â
If any of the transaction parts violates an integrity constraint, the entire transaction must be aborted.
11
In each milestone, you may want or need to use the database and query tool to answer some of the questions. We suggest you open the tool in another browser tab while you are working on this assessment.
Â
https://postgres.sophia.org/
Which type of attack is often used to get passwords or other information using iterative trial and error?
•         Â
Conditional
•         Â
Row set
•         Â
Schematic
•         Â
Brute force
12
In each milestone, you may want or need to use the database and query tool to answer some of the questions. We suggest you open the tool in another browser tab while you are working on this assessment.
Â
https://postgres.sophia.org/
In which of the following cases would it make the most sense to use a b-tree index?
•         Â
SELECT *
FROM invoice
WHERE invoice_id > 10 AND invoice_id < 200;
•         Â
SELECT *
FROM employee
WHERE title LIKE '%IT%';
•         Â
SELECT *
FROM customer
WHERE email LIKE '%gmail%';
•         Â
SELECT *
FROM customer
WHERE fax LIKE '%7070';
13
In each milestone, you may want or need to use the database and query tool to answer some of the questions. We suggest you open the tool in another browser tab while you are working on this assessment.
Â
https://postgres.sophia.org/
Which of the following statements would dump ONLY the table customer from the mydatabase database to backup.sql?
•         Â
pg_dump -a customer mydatabase > backup.sql
•         Â
pg_dump mydatabase customer > backup.sql
•         Â
pg_dump -t customer > backup.sql
•         Â
pg_dump -t customer mydatabase > backup.sql
14
In each milestone, you may want or need to use the database and query tool to answer some of the questions. We suggest you open the tool in another browser tab while you are working on this assessment.
Â
https://postgres.sophia.org/
Which is an advantage of both the command line and the GUI?
•         Â
We can use any parameters without limitation.
•         Â
We can back up a remote server.
•         Â
We can backup the data, schema, or both at the same time.
•         Â
We can compress the backup script.
15
In each milestone, you may want or need to use the database and query tool to answer some of the questions. We suggest you open the tool in another browser tab while you are working on this assessment.
https://postgres.sophia.org/
Consider the following scenario:
Â
1. Update
2. Insert
3. Insert
4. Delete
5. Update
ROLLBACK
COMMIT
In this scenario, which statements would be saved to the database, assuming these are all in a single transaction?
•         Â
1, 2, 3, 4, 5
•         Â
5
•         Â
none
•         Â
1
16
In each milestone, you may want or need to use the database and query tool to answer some of the questions. We suggest you open the tool in another browser tab while you are working on this assessment.
Â
https://postgres.sophia.org/
Which of the following DROP INDEX statement parameters are set by default?
•         Â
DROP INDEX IF EXISTS myindex;
•         Â
DROP INDEX myindex CASCADE;
•         Â
DROP INDEX CONCURRENTLY myindex;
•         Â
DROP INDEX myindex RESTRICT;
17
In each milestone, you may want or need to use the database and query tool to answer some of the questions. We suggest you open the tool in another browser tab while you are working on this assessment.
Â
https://postgres.sophia.org/
Which of the following statements will grant insert permissions on the track table to all users?
•         Â
GRANT INSERT ON track TO ALL;
•         Â
GRANT INSERT ON track TO public;
•         Â
GRANT INSERT ON 'track' TO 'public';
•         Â
GRANT INSERT ON public to track;
18
In each milestone, you may want or need to use the database and query tool to answer some of the questions. We suggest you open the tool in another browser tab while you are working on this assessment.
Â
https://postgres.sophia.org/
Which of the following permissions are not automatically granted to a superuser?
•         Â
Permission to change items in the database
•         Â
Access to operating system user accounts
•         Â
Access to any piece that touches the underlying system
•         Â
Access to enabling extensions
19
In each milestone, you may want or need to use the database and query tool to answer some of the questions. We suggest you open the tool in another browser tab while you are working on this assessment.
https://postgres.sophia.org/
Which of the following statements would create a user login role named temporary_user with the password set as changeme that is valid until 2025-05-01?
•         Â
CREATE ROLE temporary_user
LOGIN
PASSWORD changeme
VALID UNTIL 2025-05-01
•         Â
CREATE ROLE temporary_user
LOGIN
VALID UNTIL '2025-05-01'
PASSWORD 'changeme'
•         Â
CREATE ROLE temporary_user
LOGIN
PASSWORD 'changeme'
EXPIRES '2025-05-01'
•         Â
CREATE ROLE temporary_user
LOGIN
PASSWORD 'changeme'
VALID UNTIL '2025-05-01'
20
In each milestone, you may want or need to use the database and query tool to answer some of the questions. We suggest you open the tool in another browser tab while you are working on this assessment.
Â
https://postgres.sophia.org/
Which of the following sequences of statements would ensure that Jimmy has the privileges of the roles of health_department and manager?
•         Â
CREATE ROLE manager INHERIT;
CREATE ROLE health_department INHERIT;
GRANT health_department to jimmy;
GRANT manager to jimmy;
•         Â
CREATE ROLE manager NOINHERIT;
CREATE ROLE health_department NOINHERIT;
GRANT health_department to jimmy;
GRANT manager to health_department;
•         Â
CREATE ROLE manager NOINHERIT;
CREATE ROLE health_department NOINHERIT;
GRANT manager to jimmy;
GRANT manager to health_department;
•         Â
CREATE ROLE manager NOINHERIT;
CREATE ROLE health_department INHERIT;
GRANT health_department to jimmy;
GRANT manager to health_department;
21
In each milestone, you may want or need to use the database and query tool to answer some of the questions. We suggest you open the tool in another browser tab while you are working on this assessment.
https://postgres.sophia.org/
Which of the following scenarios reflects the isolation property?
•         Â
1. Jeff checks his user profile and sees his email address is set to jeff@gmail.com.
2. Jeff changes his email to set it to jeff@outlook.com but does not click on save yet.
3. A customer rep checks into Jeff's account and sees jeff@gmail.com.
4. Jeff clicks on save.
5. Another customer rep checks Jeff's account and sees jeff@outlook.com.
•         Â
1. A fairly large transaction is run to import new customers.
2. The import is saved to the logs.
3. The import starts to then save to the disk.
4. The disk fails midway through the update.
5. A new disk replaces the failed disk.
6. The backup is applied and the saving of the data is run from the logs.
•         Â
1. User 1 has $500 in their online account.
2. User 2 has $300 in their online account.
3. User 1 sends user 2 $100.
4. User 1 has $400 in their account.
5. User 2 has $300 in their account.
6. The transaction is reverted.
•         Â
1. A vendor has 5 orders available.
2. A customer attempts to purchase all 5.
3. The system deducts it from the vendor and adds it to the customer.
4. The vendor now has 0 orders available.
5. The customer has 5 orders purchased.
6. The transaction is saved.
Â
In each milestone, you may want or need to use the database and query tool to answer some of the questions. We suggest you open the tool in another browser tab while you are working on this assessment.
https://postgres.sophia.org/
Which of the following scenarios reflects the atomicity property?
•         Â
1. User 1 has $500 in their online account.
2. User 2 has $300 in their online account.
3. User 1 sends user 2 $100.
4. User 1 has $400 in their account.
5. User 2 has $300 in their account.
6. The transaction is reverted.
•         Â
1. A fairly large update to the products table.
2. The update is saved to the logs.
3. The update starts to then save to the disk.
4. The system fails midway through.
5. When the system starts back up, the committed transactions that haven't been written to disk are written.
•         Â
1. The product quantity starts at 200.
2. Transaction 1 runs to read the quantity of the product to be updated.
3. Transaction 2 runs in parallel to read the quantity of the product to be updated.
4. Transaction 1 updates the product quantity to reduce it by 100.
5. Transaction 2 updates the product quantity to reduce it by 5.
6. The product quantity ends at 195.
•         Â
1. Transaction 1 reads a product's cost which is set at $100.
2. Transaction 1 updates the product to set the price to $90.
3. Transaction 2 reads the same product's cost and sees $100.
4. Transaction 1 commits the cost.
5. Transaction 3 reads the same product's cost and sees $90.
Â
Which of the following statements would only dump the data definitions and not the data of the mydatabase to backup.sql?
•         Â
pg_dump mydatabase > backup.sql
•         Â
pg_dump -d mydatabase > backup.sql
•         Â
pg_dump -s mydatabase > backup.sql
•         Â
pg_dump -a mydatabase > backup.sql
Â
Which of the following statements would create a role named database_admin which gives them the ability to create databases?
•         Â
CREATE ROLE database_admin NOINHERIT;
•         Â
CREATE ROLE database_admin CREATEROLE;
•         Â
CREATE ROLE database_admin CREATEDB;
•         Â
CREATE ROLE database_admin INHERIT;
Â
In each milestone, you may want or need to use the database and query tool to answer some of the questions. We suggest you open the tool in another browser tab while you are working on this assessment.
Â
https://postgres.sophia.org/
In which of the following cases would it make the most sense to use a hash index?
•         Â
SELECT *
FROM album
WHERE email LIKE '%t%';
•         Â
SELECT *
FROM artist
WHERE artist_id < 10;
•         Â
SELECT *
FROM track
WHERE track_id > 1 AND track_id < 15;
•         Â
SELECT *
FROM playlist
WHERE playlist_id = 4;
Â
In each milestone, you may want or need to use the database and query tool to answer some of the questions. We suggest you open the tool in another browser tab while you are working on this assessment.
Â
https://postgres.sophia.org/
Which type of backup would result in the fastest restoration?
•         Â
Differential backup
•         Â
Nightly backup
•         Â
Incremental backup
•         Â
Full backup
Â
In each milestone, you may want or need to use the database and query tool to answer some of the questions. We suggest you open the tool in another browser tab while you are working on this assessment.
Â
https://postgres.sophia.org/
Which of the following statements represents a correctly structured transaction?
•         Â
BEGIN
UPDATE track
set name = 'A New Road'
where track_id = 5;
insert into artist (artist_id, name) values (900, 'Special Artist' );
insert into genre (genre_id, name) values (30, 'Funk' );
COMMIT;
•         Â
BEGIN;
COMMIT;
UPDATE track
set name = 'A New Road'
where track_id = 5;
insert into artist (artist_id, name) values (900, 'Special Artist' );
insert into genre (genre_id, name) values (30, 'Funk' );
•         Â
BEGIN
UPDATE track
set name = 'A New Road'
where track_id = 5
insert into artist (artist_id, name) values (900, 'Special Artist' )
insert into genre (genre_id, name) values (30, 'Funk' )
COMMIT
•         Â
BEGIN;
UPDATE track
set name = 'A New Road'
where track_id = 5;
insert into artist (artist_id, name) values (900, 'Special Artist' );
insert into genre (genre_id, name) values (30, 'Funk' );
COMMIT;
Â
Â
In each milestone, you may want or need to use the database and query tool to answer some of the questions. We suggest you open the tool in another browser tab while you are working on this assessment.
Â
https://postgres.sophia.org/
Which is an advantage of both the command line and the GUI?
•         Â
We can backup from one database and immediately send the result to restore another database.
•         Â
We can continue to restore a database even if there are errors in the file.
•         Â
We can back up a remote server.
•         Â
We can restore a remote database.
Â
In each milestone, you may want or need to use the database and query tool to answer some of the questions. We suggest you open the tool in another browser tab while you are working on this assessment.
https://postgres.sophia.org/
Which of the following scenarios reflects the atomicity property?
•         Â
1. In the library database, there are 50 books available.
2. Billy has checked and there are 50 books.
3. Sam has checked and there are 50 books.
4. Billy has taken out 5 books.
5. The library system informs Sam of the update and Sam now checks that there are 45 books.
6. Sam checks out 10 books.
7. There are now 35 books in the library database.
•         Â
1. In the flower database, there are 50 flowers available.
2. Reese has checked and there are 50 flowers.
3. Reese has attempted to take out 5 flowers.
4. While trying to take them out, there was an error in trying to dispense.
5. While checking, there are still 50 flowers available in the system.
•         Â
1. Tiffany has updated a customer's address while on the phone with them.
2. The server restarted after Tiffany clicked on save.
3. When the server came back up, Tiffany was able to verify that the address was updated.
•         Â
1. A user attempts to do a product transfer between companies.
2. The quantity of the product is moved from the first company.
3. The quantity is moved to the second company without verifying that it has been deducted from the first company.
4. The transaction is accepted.
Â
In each milestone, you may want or need to use the database and query tool to answer some of the questions. We suggest you open the tool in another browser tab while you are working on this assessment.
Â
https://postgres.sophia.org/
What is unique about a superuser compared to a user?
•         Â
A superuser is the same as a regular user but with all permissions granted.
•         Â
A superuser can bypass all permission checks.
•         Â
A superuser has administrative privileges that users can't have.
•         Â
A superuser has their permissions checked but passes all tests.
Â
In each milestone, you may want or need to use the database and query tool to answer some of the questions. We suggest you open the tool in another browser tab while you are working on this assessment.
Â
https://postgres.sophia.org/
Which of the following statements will grant update, delete and insert permissions on the employee table to all users?
•         Â
GRANT UPDATE, INSERT, DELETE ON employee TO ALL;
•         Â
GRANT UPDATE and INSERT AND DELETE ON employee TO ALL;
•         Â
GRANT UPDATE, INSERT, DELETE ON ALL to employee;
•         Â
GRANT UPDATE, INSERT, DELETE ON 'employee' TO 'ALL';
Â
In each milestone, you may want or need to use the database and query tool to answer some of the questions. We suggest you open the tool in another browser tab while you are working on this assessment.
https://postgres.sophia.org/
Consider the following scenario:
Â
1. Update
ROLLBACK
2. Insert
3. Insert
4. Delete
ROLLBACK
5. Update
COMMIT
In this scenario, which statements would be saved to the database, assuming these are all in a single transaction?
•         Â
5
•         Â
1, 2, 3, 4, 5
•         Â
2, 3, 4, 5
•         Â
None
Â
In each milestone, you may want or need to use the database and query tool to answer some of the questions. We suggest you open the tool in another browser tab while you are working on this assessment.
https://postgres.sophia.org/
Which of the following statements would create a user login role named master_user with the password set as k489dJs9l that is valid until 2032-12-31?
•         Â
CREATE ROLE master_user
LOGIN
WITH PASSWORD 'k489dJs9l'
EXPIRES '2032-12-31'
•         Â
CREATE ROLE master_user
LOGIN
Â
VALID UNTIL '2032-12-31'
PASSWORD 'k489dJs9l'
•         Â
CREATE ROLE master_user
LOGIN
PASSWORD 'k489dJs9l'
VALID UNTIL '2032-12-31'
•         Â
CREATE ROLE master_user
LOGIN
PASSWORD k489dJs9l
VALID UNTIL 2032-12-31
Â
In each milestone, you may want or need to use the database and query tool to answer some of the questions. We suggest you open the tool in another browser tab while you are working on this assessment.
Â
https://postgres.sophia.org/
Which type of application that acts as an interface to the database is used to perform most SQL injections?
•         Â
Image
•         Â
Text
•         Â
System
•         Â
Web
Â
In each milestone, you may want or need to use the database and query tool to answer some of the questions. We suggest you open the tool in another browser tab while you are working on this assessment.
Â
https://postgres.sophia.org/
Which of the following statements would create a role named database_test which gives them the ability login as a user?
•         Â
CREATE ROLE database_test LOGIN;
•         Â
CREATE ROLE database_test INHERIT;
•         Â
CREATE ROLE database_test CREATEROLE;
•         Â
CREATE ROLE database_test NOINHERIT;
Â
In each milestone, you may want or need to use the database and query tool to answer some of the questions. We suggest you open the tool in another browser tab while you are working on this assessment.
https://postgres.sophia.org/
Which of the following scenarios reflect the consistency property?
•         Â
1. The product quantity starts at 200.
2. Transaction 1 runs to read the quantity of the product to be updated.
3. Transaction 2 runs in parallel to read the quantity of the product to be updated.
4. Transaction 1 updates the product quantity to reduce it by 100.
5. Transaction 2 updates the product quantity to reduce it by 5.
6. The product quantity ends at 95.
•         Â
1. User 1 has $50 in their online account.
2. User 2 has $60 in their online account.
3. User 1 sends user 2 $10.
4. User 1 has $40 in their account.
5. User 2 has $60 in their account.
6. The transaction is saved.
•         Â
1. A fairly large update to the products table.
2. The update is saved to the logs.
3. The update starts to then save to the disk.
4. The system fails midway through.
5. When the system starts back up, the committed transactions that haven't been written to disk are written.
•         Â
1. Transaction 1 reads a product's cost which is set at $100.
2. Transaction 1 updates the product to set the price to $90.
3. Transaction 2 reads the same product's cost and sees $100.
4. Transaction 1 commits the cost.
5. Transaction 3 reads the same product's cost and sees $90.
Â
In each milestone, you may want or need to use the database and query tool to answer some of the questions. We suggest you open the tool in another browser tab while you are working on this assessment.
Â
https://postgres.sophia.org/
In which of the following cases would it make the most sense to use a b-tree index?
•         Â
SELECT *
FROM invoice
WHERE invoice_id > 10 AND invoice_id < 200;
•         Â
SELECT *
FROM customer
WHERE fax LIKE '%7070';
•         Â
SELECT *
FROM employee
WHERE title LIKE '%IT%';
•         Â
SELECT *
FROM customer
WHERE email LIKE '%gmail%';
Â
In each milestone, you may want or need to use the database and query tool to answer some of the questions. We suggest you open the tool in another browser tab while you are working on this assessment.
Â
https://postgres.sophia.org/
Which of the following sequences of statements would ensure that Jimmy has the privileges of the roles of health_department and manager?
•         Â
CREATE ROLE manager NOINHERIT;
CREATE ROLE health_department NOINHERIT;
GRANT manager to jimmy;
GRANT manager to health_department;
•         Â
CREATE ROLE manager INHERIT;
CREATE ROLE health_department INHERIT;
GRANT health_department to jimmy;
GRANT manager to jimmy;
•         Â
CREATE ROLE manager NOINHERIT;
CREATE ROLE health_department INHERIT;
GRANT health_department to jimmy;
GRANT manager to health_department;
•         Â
CREATE ROLE manager NOINHERIT;
CREATE ROLE health_department NOINHERIT;
GRANT health_department to jimmy;
GRANT manager to health_department;
Â
1
In each milestone, you may want or need to use the database and query tool to answer some of the questions. We suggest you open the tool in another browser tab while you are working on this assessment.
https://postgres.sophia.org/
Which of the following users architects the database?
•         Â
Database administrator
•         Â
System programmer
•         Â
Database designer
•         Â
System administrator
2
Which of the following would help protect data security during database migrations?
•         Â
Converting schemas
•         Â
Normalizing data
•         Â
Testing for data loss
•         Â
Removing personally identifiable information
3
In each milestone, you may want or need to use the database and query tool to answer some of the questions. We suggest you open the tool in another browser tab while you are working on this assessment.
https://postgres.sophia.org/
What is the best example of a scenario in which a new database should be created to support the business?
•         Â
An organization would like to create an application to help manage appointments for pet-related services. The mobile application should allow pet owners to schedule services by viewing the availability of pet groomers within the app.
•         Â
A local pet shop would like to offer pet services. They have six pet groomers on staff and use MS Outlook to help with tracking their appointments. The pet owner receives calls from customers and then schedules them on the company computer through Outlook.
•         Â
An organization would like to add pet services as an option to their existing pet store sales database. Services and products should be able to be paid for at the same time.
•         Â
An organization has found an application that can be used to manage pet services for pet owners and pet groomers. Both have to log into the existing site to set up appointments.
4
Which of these databases is limited in terms of database size?
•         Â
PostgreSQL
•         Â
Oracle
•         Â
Teradata
•         Â
MySQL
5
Consider the following command:
UPDATE customer
SET customer_id = customer_id --1;
What happens if we run this command in MySQL?
•         Â
The customer table has every customer_id set to the same value as it previously had.
•         Â
An error is thrown due to the --.
•         Â
The customer_id in the customer table for all records is incremented by 1.
•         Â
The customer_id in the customer table for all records is decremented by 1.
6
Which of the following criteria was a key milestone for the object-relational model created in the mid-1980s?
•         Â
The use of this data model on IBM mainframe systems
•         Â
The creation of a single structure that contained both data and its relationships
•         Â
The existence of support for unstructured data
•         Â
Identification of all of the data to be stored in a collection of tables with each table being independent and each of the rows in a table being related by common values
7
Which data model(s) introduced the use of a data manipulation language?
•         Â
Network
•         Â
Hierarchical
•         Â
Both hierarchical and network
•         Â
Neither
8
Which of the following is a key feature of a data warehouse?
•         Â
This type of database has processing that is immediate to when the user makes a request.
•         Â
This type of database is often denormalized with a focus on performance.
•         Â
This type of database focuses on reducing data redundancy.
•         Â
This type of database uses insert, update, and delete statements quickly.
9
What are the emerging major data models created between the early 2000s to the current day?
•         Â
File system
•         Â
XML Hybrid
•         Â
Key-value store and wide-column store
•         Â
Relational
10
What is the term related to a specific implementation of ANSI SQL by a vendor?
•         Â
Implementation
•         Â
Version
•         Â
Dialect
•         Â
T-SQL
11
Which of the following is a key part of conceptual design in an entity relationship model?
•         Â
This model does not depend on the database management software or the hardware used to implement the model.
•         Â
This model converts attributes into columns.
•         Â
This model adds all of the attributes for each entity.
•         Â
This model resolves the many-to-many relationships to multiple one-to-many relationships.
12
Which of the following is a key part of logical design in an entity relationship model?
•         Â
In this model, no attributes are specified.
•         Â
This model avoids any database model-specific details.
•         Â
This model converts entities into tables.
•         Â
This model has normalization that occurs.
13
Which of the following is a key feature of a relational database?
•         Â
It has a broad umbrella of a variety of approaches with data storage and manipulation.
•         Â
It is designed for highly available systems that should provide a consistent, high-quality experience for all users globally.
•         Â
It has flexible data models that make it easy to store and combine data of any structure and allow dynamic changes to the schema.
•         Â
It ensures strong consistency such that applications should be able to read what has been written to the database immediately.
14
Which of the following ALTER TABLE features is available in SQLite?
•         Â
ADD CONSTRAINT
•         Â
DROP COLUMN
•         Â
ADD COLUMN
•         Â
ALTER COLUMN
15
In each milestone, you may want or need to use the database and query tool to answer some of the questions. We suggest you open the tool in another browser tab while you are working on this assessment.
https://postgres.sophia.org/
As compared to databases, flat files have __________.
•         Â
more consistency
•         Â
less flexibility
•         Â
more security
•         Â
less redundancy
16
Which of the following creates one of the most common types of bottlenecks?
•         Â
Transactions competing to access different tables
•         Â
Transactions competing for different data rows in the same table
•         Â
Transactions competing for the same data rows
•         Â
Transactions running in sequence with one another
17
Which of the following is not a reason to identify and document business rules?
•         Â
It can create a database that will work in any situation.
•         Â
It can help standardize the company's view of the data.
•         Â
It can allow developers to create an accurate data model.
•         Â
It can allow the designer to create appropriate relationships.
18
Which of the following is a key part of physical design in an entity relationship model?
•         Â
In this model, the characteristics such as location, path, and format are described.
•         Â
This model uses column names instead of attributes.
•         Â
This model resolves the many-to-many relationships to multiple one-to-many relationships.
•         Â
In this model, no primary keys are specified in the entities.
19
In each milestone, you may want or need to use the database and query tool to answer some of the questions. We suggest you open the tool in another browser tab while you are working on this assessment.
Â
https://postgres.sophia.org/
In the context of a database, what do we get when we process data?
•         Â
Information
•         Â
Raw facts
•         Â
Constraints
•         Â
Knowledge
20
What notation and relationship does this refer to?
Â
•         Â
Crow's Foot notation showing a 1:1 relationship
•         Â
Chen notation showing an M:N relationship
•         Â
Chen notation showing a 1:M relationship
•         Â
Crow's Foot notation showing a 1:M relationship
21
Which of the following is not a common commercial database option?
•         Â
SQLite
•         Â
PostgreSQL
•         Â
MariaDB
•         Â
ANSI SQL
22
Which of the following criteria was a key milestone for the relational model created in the mid-1970s?
•         Â
The identification of all of the data to be stored in a collection of tables with each table being independent and each of the rows in a table being related by common values
•         Â
The creation of a single structure that contained both data and its relationships
•         Â
The existence of support for unstructured data
•         Â
The use of this data model on IBM mainframe systems
Â
Â
1
Which of the following creates one of the most common types of bottlenecks?
•         Â
Sequential transactions
•         Â
Data cache
•         Â
Shared buffers and locks
•         Â
Unused memory resources
2
Which of the following criteria was a key milestone for the object-relational model created in the mid-1980s?
•         Â
A focus on high performance and fault tolerance
•         Â
The use of inheritance to have a structure inherit attributes and methods of classes above it
•         Â
The ability to have very large storage in petabytes
•         Â
The creation of a relation or a table as a two-dimensional structure composed of rows and columns
3
Which of the following is not a reason to identify and document business rules?
•         Â
It can allow the designer to understand business processes.
•         Â
It can allow the designer to create appropriate relationships.
•         Â
It can allow the designer to create appropriate constraints.
•         Â
It can solve issues that are enforced by the application software.
4
Which of the following is a key feature of a relational database?
•         Â
It is designed for highly available systems that should provide a consistent, high-quality experience for all users globally.
•         Â
It uses primary keys and foreign keys as a means to provide efficient access to data and is supported directly in the database rather than maintained in the application code.
•         Â
It has flexible data models that make it easy to store and combine data of any structure and allow dynamic changes to the schema.
•         Â
It has high scalability and performance that can enable almost unlimited growth.
5
In each milestone, you may want or need to use the database and query tool to answer some of the questions. We suggest you open the tool in another browser tab while you are working on this assessment.
https://postgres.sophia.org/
Which term is the part of the database system that is the collection of stored facts?
•         Â
Hardware
•         Â
Software
•         Â
Procedures
•         Â
Data
6
In each milestone, you may want or need to use the database and query tool to answer some of the questions. We suggest you open the tool in another browser tab while you are working on this assessment.
https://postgres.sophia.org/
As compared to databases, flat files have worse __________. This means they have issues with data correctness, reliability, and accuracy.
•         Â
redundancy
•         Â
security
•         Â
flexibility
•         Â
integrity
7
What is a data type that is implemented differently by database vendors quite frequently?
•         Â
Int
•         Â
Date and time
•         Â
String
•         Â
Char
8
Which of the following is a key feature of a data warehouse?
•         Â
This type of database uses insert, update and delete statements quickly.
•         Â
This type of database is optimized for a large number of concurrent users making changes or querying the database.
•         Â
This type of database is used to process day-to-day operations in real time.
•         Â
This type of database generally only has data loads with extremely rare updates or deletes to the data.
9
Which data model(s) introduced the use of a data definition language?
•         Â
Network
•         Â
Hierarchical
•         Â
Both hierarchical and network
•         Â
Neither
10
Which of the following types of outer joins is implemented in SQLite?
•         Â
LEFT OUTER JOIN
•         Â
RIGHT OUTER JOIN
•         Â
FULL OUTER JOIN
•         Â
All of the above
11
What is true about table sizes with databases?
•         Â
Databases may have limitations based on the number of table rows or specific storage size, while others are unlimited.
•         Â
There is no maximum size regardless of the database.
•         Â
There is a constant set maximum size due to compliance with ANSI SQL.
•         Â
The maximum size in many cases can be unlimited depending on the amount of disk space allocated for the database.
12
Which of the following is a key part of conceptual design in an entity relationship model?
•         Â
In this model, all table structures including column names, data types, column constraints, primary keys, foreign keys, and relationships are included.
•         Â
In this model, entities are specified.
•         Â
This model converts entities into tables.
•         Â
This model has normalization that occurs.
13
Consider the following command:
UPDATE product
SET sale_price = price --5;
What happens if we run this command in MySQL?
•         Â
The sale_price in the product table for all records is decremented by 5 from the price.
•         Â
The sale_price in the product table for all records is incremented by 5 from the price.
•         Â
The product table has every sale_price set to the same value as the price.
•         Â
An error is thrown due to the --.
14
In each milestone, you may want or need to use the database and query tool to answer some of the questions. We suggest you open the tool in another browser tab while you are working on this assessment.
Â
https://postgres.sophia.org/
In the context of a database, what is knowledge?
•         Â
Raw facts of interest to the end user
•         Â
A process that focuses on data collection, storage, and retrieval
•         Â
A computer structure that holds a collection of related data
•         Â
A body of information and facts about a specific topic
15
What notation and relationship does this refer to?
Â
•         Â
Crow's Foot notation showing a 1:1 relationship
•         Â
UML notation showing a 1:1 relationship
•         Â
Chen notation showing a 1:1 relationship
•         Â
UML notation showing a 1:M relationship
16
In each milestone, you may want or need to use the database and query tool to answer some of the questions. We suggest you open the tool in another browser tab while you are working on this assessment.
https://postgres.sophia.org/
What is the best example of a scenario in which a new database should be created to support the business?
•         Â
An organization would like to display the results of an external book review database in real time on their website.
•         Â
An organization would like to add a review system to its existing book purchase database.
•         Â
An organization would like to create a book review application allowing users to identify what books they have purchased, what they have read, and how much they liked a book.
•         Â
An organization would like to pull the current reviews of books from different sites to display on their own website.
17
Which of the following is not a common commercial database option?
•         Â
SQL Express
•         Â
SQL Server
•         Â
MariaDB
•         Â
MS Access
18
Which of the following would help protect data security during database migrations?
•         Â
Normalizing data
•         Â
Converting schemas
•         Â
Encrypting the data
•         Â
Testing for data loss
19
Which of the following is a key part of logical design in an entity relationship model?
•         Â
This model does not depend on the database management software or the hardware used to implement the model.
•         Â
This model converts attributes into columns.
•         Â
This data model includes all table structures including column names, data types, column constraints, primary keys, foreign keys, and relationships.
•         Â
This model resolves the many-to-many relationships to multiple one-to-many relationships.
20
Which of the following criteria was a key milestone for the relational model created in the mid-1970s?
•         Â
The ability to have very large storage in petabytes
•         Â
The use of inheritance to have a structure inherit attributes and methods of classes above it
•         Â
The creation of a relation or a table as a two-dimensional structure composed of rows and columns
•         Â
A focus on high performance and fault tolerance
21
What was the fifth generation of major data models created during the mid-1990s?
•         Â
XML Hybrid
•         Â
Object-oriented
•         Â
Relational
•         Â
Key-value store and wide-column store
22
Which of the following is a key part of physical design in an entity relationship model?
•         Â
This model does not depend on the database management software or the hardware used to implement the model.
•         Â
This model avoids any database model-specific details.
•         Â
This model resolves the many-to-many relationships to multiple one-to-many relationships.
•         Â
This model converts attributes into columns.
Â
Â
1
Which of the following ALTER TABLE features is NOT available in SQLite?
•         Â
RENAME COLUMN
•         Â
RENAME TABLE
•         Â
ADD CONSTRAINT
•         Â
ADD COLUMN
2
Which of the following creates one of the most common types of bottlenecks?
•         Â
Data cache
•         Â
Unused memory resources
•         Â
Sequential transactions
•         Â
Shared buffers and locks
3
Which of the following is not a common commercial database option?
•         Â
MySQL
•         Â
Teradata
•         Â
SQLite
•         Â
Oracle
4
In each milestone, you may want or need to use the database and query tool to answer some of the questions. We suggest you open the tool in another browser tab while you are working on this assessment.
https://postgres.sophia.org/
What is the best example of a scenario in which a new database should be created to support the business?
•         Â
An organization would like to build a support ticketing system for its custom ticketing application. None of the existing ticketing applications fit the workflow of the organization.
•         Â
An organization would like to create a support ticketing tracking tool that anyone can access and change. There does not need to be any versioning or tracking of who changed items as long as they are being addressed.
•         Â
An organization would like to build a support ticketing system. An open-source solution has the majority of the features that the organization needs. There are some improvements that still need to be made.
•         Â
An organization has found a support ticketing tool that they could use. It is missing some features that they require in which the third party can build and add on.
5
In each milestone, you may want or need to use the database and query tool to answer some of the questions. We suggest you open the tool in another browser tab while you are working on this assessment.
https://postgres.sophia.org/
__________ is/are the instructions and rules that determine the design and use of the database.
•         Â
Procedures
•         Â
People
•         Â
Hardware
•         Â
Software
6
Consider the following command:
UPDATE product
SET sale_price = price --5;
What happens if we run this command in MySQL?
•         Â
The product table has every sale_price set to the same value as the price.
•         Â
The sale_price in the product table for all records is decremented by 5 from the price.
•         Â
The sale_price in the product table for all records is incremented by 5 from the price.
•         Â
An error is thrown due to the --.
7
Which of the following criteria was a key milestone for the relational model created in the mid-1970s?
•         Â
The creation of a single structure that contained both data and its relationships
•         Â
The use of this data model on IBM mainframe systems
•         Â
The identification of all of the data to be stored in a collection of tables with each table being independent and each of the rows in a table being related by common values
•         Â
The existence of support for unstructured data
8
Which of the following is a key part of logical design in an entity relationship model?
•         Â
This model converts entities into tables.
•         Â
This model has normalization that occurs.
•         Â
This model avoids any database model-specific details.
•         Â
In this model, no attributes are specified.
9
Which of the following is a key part of conceptual design in an entity relationship model?
•         Â
This model has normalization that occurs.
•         Â
This model converts entities into tables.
•         Â
In this model, entities are specified.
•         Â
In this model, all table structures including column names, data types, column constraints, primary keys, foreign keys, and relationships are included.
10
In each milestone, you may want or need to use the database and query tool to answer some of the questions. We suggest you open the tool in another browser tab while you are working on this assessment.
https://postgres.sophia.org/
As compared to databases, flat files have __________.
•         Â
less flexibility
•         Â
more consistency
•         Â
less redundancy
•         Â
more security
11
In each milestone, you may want or need to use the database and query tool to answer some of the questions. We suggest you open the tool in another browser tab while you are working on this assessment.
Â
https://postgres.sophia.org/
In the context of a database, how is data different from information?
•         Â
Data is the total body of knowledge.
•         Â
Data consists of metadata.
•         Â
Data is processed information that has meaning.
•         Â
Data consists of raw facts and has no meaning.
12
Which of the following is not a reason to identify and document business rules?
•         Â
It can allow developers to create an accurate data model.
•         Â
It can allow the designer to understand business processes.
•         Â
It can be used as a communication tool between users and designers.
•         Â
It can ensure that the rules are based on the interpretation of senior management.
13
Which of the following is a key part of physical design in an entity relationship model?
•         Â
This model avoids any database model-specific details.
•         Â
This model does not depend on the database management software or the hardware used to implement the model.
•         Â
This model resolves the many-to-many relationships to multiple one-to-many relationships.
•         Â
This model converts attributes into columns.
14
Which data model(s) introduced the use of a data definition language?
•         Â
Network
•         Â
Hierarchical
•         Â
Both hierarchical and network
•         Â
Neither
15
What notation and relationship does this refer to?
Â
•         Â
Crow's Foot notation showing a 1:M relationship
•         Â
UML notation showing a 1:M relationship
•         Â
Crow's Foot notation showing a 1:1 relationship
•         Â
Chen notation showing a 1:1 relationship
16
Which of these databases can be unlimited in terms of database size?
•         Â
Oracle
•         Â
SQL Server
•         Â
PostgreSQL
•         Â
SQLite
17
Which of the following would help protect data security during database migrations?
•         Â
Testing for data loss
•         Â
Normalizing data
•         Â
Converting schemas
•         Â
Encrypting the data
18
Which of the following is a key feature of a data warehouse?
•         Â
This type of database is often denormalized with a focus on performance.
•         Â
This type of database uses insert, update, and delete statements quickly.
•         Â
This type of database focuses on reducing data redundancy.
•         Â
This type of database has processing that is immediate to when the user makes a request.
19
What is the term related to a specific implementation of ANSI SQL by a vendor?
•         Â
T-SQL
•         Â
Dialect
•         Â
Implementation
•         Â
Version
20
What are the emerging major data models created between the early 2000s to the current day?
•         Â
XML Hybrid
•         Â
Relational
•         Â
Key-value store and wide-column store
•         Â
File system
21
Which of the following criteria was a key milestone for the object relational model created in the mid-1980s?
•         Â
The existence of support for unstructured data
•         Â
The ability to have very large storage in petabytes
•         Â
The ability to hide the complexities of the model from the user through the use of the database management system
•         Â
The collection of similar structures that consisted of shared attributes and behaviors
22
Which of the following is a key feature of a relational database?
•         Â
They have a broad umbrella of a variety of approaches with data storage and manipulation.
•         Â
They make sorting, filtering, and computing various calculations with expressive query languages easy.
•         Â
They are designed to be highly available systems that provide a consistent high-quality experience for all users globally.
•         Â
They offer high scalability and performance that can enable almost unlimited growth.
Â
Which of the following is a key feature of a data warehouse?
•         Â
This type of database is used to process day-to-day operations in real time.
•         Â
This type of database focuses on reducing data redundancy.
•         Â
This type of database is optimized to execute a small number of complex queries.
•         Â
This type of database is optimized for a large number of concurrent users making changes or querying the database.
Â
Which of the following is a key part of logical design in an entity relationship model?
•         Â
This model uses column names instead of attributes.
•         Â
In this model, the characteristics such as location, path, and format are described.
•         Â
Different database management systems may have different options for this type of model.
•         Â
In this model, no primary keys are specified in the entities.
Â
Which of the following represents a security issue related to database migrations?
•         Â
Having data be read from a third party during the transfer
•         Â
Having databases in different departments
•         Â
Having the physical drives get damaged during migration
•         Â
Having databases in different geographies
Which of the following is a key part of physical design in an entity relationship model?
•         Â
In this model, no attributes are specified.
•         Â
This model adds all of the attributes for each entity.
•         Â
This model has normalization that occurs.
•         Â
This model converts entities into tables.
In each milestone, you may want or need to use the database and query tool to answer some of the questions. We suggest you open the tool in another browser tab while you are working on this assessment.
https://postgres.sophia.org/
As compared to databases, file sizes in flat files can be much larger due to __________.
•         Â
flexibility
•         Â
security
•         Â
redundancy
•         Â
data integrity
Â
Which data model do databases like Oracle, MS SQL Server, Postgres, and MySQL fall under?
•         Â
Object-oriented
•         Â
XML Hybrid
•         Â
Hierarchical and network
•         Â
Relational
Which statement is true of the network data model, but not true of the hierarchical data model?
•         Â
It introduced the use of data commands like SELECT and INSERT.
•         Â
It depicts a set of one-to-many relationships.
•         Â
In this data model, each parent can have multiple children, but a child can only have one parent.
•         Â
It was the first of the widely used data models in the 1970s.
Â
1
What is a benefit of using a lookup table?
•         Â
It resolves weak entities.
•         Â
There is data modification flexibility.
•         Â
It transforms an M:N relationship into two 1:M relationships.
•         Â
It guarantees that there will be no data redundancies due to functional dependencies.
2
Is this dataset in 2NF or not? If not, why not?
Â
•         Â
It is already in 2NF.
•         Â
No, there are repeating groups.
•         Â
No, there are no transitive functional dependencies.
•         Â
No, there are columns that are not dependent on the primary key.
3
In each milestone, you may want or need to use the database and query tool to answer some of the questions. We suggest you open the tool in another browser tab while you are working on this assessment.
https://postgres.sophia.org/
What is wrong with the following ERD meant to show the attributes of an entity?
Â
Â
•         Â
The attributes are not correctly linked to the entity.
•         Â
The symbols used are swapped.
•         Â
There is nothing wrong with the ERD.
•         Â
The primary key is not indicated correctly.
4
What is a key feature of fifth normal form?
•         Â
This normal form resolves any multivalued dependencies.
•         Â
This normal form has the tables broken down into as many tables as possible to avoid redundancy.
•         Â
Foreign keys are created in this normal form.
•         Â
A key step in this normal form has every determinant in a table as a candidate key.
5
Review the sample movie ratings ERD after 3NF.
Â
What is the relationship between tables Movie and User?
•         Â
1:1
•         Â
M:N
•         Â
1:M
•         Â
N:1
6
What type of connection trap could be created due to a convergence of two one-to-many relationships on a single table?
•         Â
Fan trap
•         Â
Chasm trap
•         Â
Design trap
•         Â
System trap
7
What is true about normalization?
•         Â
It should take into account business rules and data constraints.
•         Â
It reduces the number of joins.
•         Â
Each normal form provides faster performance.
•         Â
It adds layers of data redundancy.
8
What is the purpose of an associative entity?
•         Â
To combine multiple 1:M relationships into a single M:N relationship
•         Â
To break down an M:N relationship into multiple 1:M relationships
•         Â
To ensure that all relationships in the database are 1:1
•         Â
To eliminate any 1:1 relationships from the database design
9
Is this dataset in 3NF? If not, why not?
Â
Â
•         Â
Yes, it is in 3NF.
•         Â
No, it is not yet in 2NF.
•         Â
No, there is an issue with the functional dependency.
•         Â
No, there are repeating groups.
10
In each milestone, you may want or need to use the database and query tool to answer some of the questions. We suggest you open the tool in another browser tab while you are working on this assessment.
https://postgres.sophia.org/
What type of cardinality is demonstrated by the following ERD?
Â
Â
•         Â
A department has multiple professors. A professor is part of multiple departments.
•         Â
A department has a professor. A professor is part of a department.
•         Â
A department has a professor. A professor is part of multiple departments.
•         Â
A department has multiple professors. A professor is part of a department.
11
Review the sample eCommerce ERD after 3NF.
Â
What is the relationship between tables Product and Order?
•         Â
N:1
•         Â
1:1
•         Â
M:N
•         Â
1:M
12
In each milestone, you may want or need to use the database and query tool to answer some of the questions. We suggest you open the tool in another browser tab while you are working on this assessment.
https://postgres.sophia.org/
What is used to indicate a weak entity in an ERD?
•         Â
Double diamond
•         Â
Single rectangular box
•         Â
Single diamond
•         Â
Double rectangular box
13
What is a reason to denormalize a database?
•         Â
To decrease redundancy in the database
•         Â
To remove multivalued dependencies from the database
•         Â
To reduce the database’s processing needs
•         Â
To prioritize data anomalies rather than performance
14
What is a criterion of a table being in first normal form?
•         Â
For every functional dependency where X is functionally dependent on Y, X should be the super key of the table.
•         Â
No non-prime attributes dependent on the candidate key should be included.
•         Â
All transitive functional dependencies of a non-prime attribute of a super key should be removed.
•         Â
Every cell of a table should have a single value.
15
Identify the normal form in which we have no independent multivalued dependencies.
•         Â
None of the first three normal forms
•         Â
2NF
•         Â
3NF
•         Â
1NF
16
What is a disadvantage associated with a simpler ERD design?
•         Â
Simpler application code
•         Â
Slower application development
•         Â
Simpler queries
•         Â
More redundancy
17
In each milestone, you may want or need to use the database and query tool to answer some of the questions. We suggest you open the tool in another browser tab while you are working on this assessment.
Â
https://postgres.sophia.org/
What is wrong with the following ERD meant to show a relationship between two entities?
Â
•         Â
There is no relationship between the entities.
•         Â
One of the items is set up as an attribute.
•         Â
There is nothing wrong with the ERD.
•         Â
Both of the objects are attributes.
Â
Â
1
What could be a reason to denormalize a database?
•         Â
We want to eliminate repeating groups.
•         Â
We want to reduce redundancy.
•         Â
We want to remove multivalued dependencies.
•         Â
We want to store pre-aggregated or derived data.
2
Is this dataset in 1NF? If not, why not?
Â
Â
•         Â
This data set is in 1NF already.
•         Â
There are repeating groups with the actor_names and possibly the genre_names.
•         Â
There are no foreign keys.
•         Â
There is no primary key.
3
Review the sample eCommerce ERD after 3NF.
Â
What is the relationship between tables Customer and Order?
•         Â
M:N
•         Â
N:1
•         Â
1:1
•         Â
1:M
4
What is true about normalization?
•         Â
It adds layers of data redundancy.
•         Â
It is typically performed between conceptual and logical data modeling.
•         Â
It increases the chance of data anomalies.
•         Â
Each normal form provides faster performance.
5
Identify the normal form in which all of the attributes are set up to be dependent on the primary key.
•         Â
3NF
•         Â
None of the first three normal forms
•         Â
2NF
•         Â
1NF
6
Is this dataset in 3NF? If not, why not?
Â
Â
•         Â
No, it is not yet in 2NF.
•         Â
No, there are repeating groups.
•         Â
No, there is an issue with the functional dependency.
•         Â
Yes, it is in 3NF.
7
In each milestone, you may want or need to use the database and query tool to answer some of the questions. We suggest you open the tool in another browser tab while you are working on this assessment.
https://postgres.sophia.org/
What type of cardinality is demonstrated by the following ERD?
Â
Â
•         Â
A song can belong to multiple playlists. A playlist can contain multiple songs.
•         Â
A song can belong to a playlist. A playlist can contain multiple songs.
•         Â
A song can belong to multiple playlists. A playlist can contain a song.
•         Â
A song can belong to a playlist. A playlist can contain a song.
8
What is NOT another name for an associative entity?
•         Â
Strong entity
•         Â
Composite entity
•         Â
Linking table
•         Â
Bridge entity
9
In each milestone, you may want or need to use the database and query tool to answer some of the questions. We suggest you open the tool in another browser tab while you are working on this assessment.
https://postgres.sophia.org/
What is used to indicate a weak relationship in an ERD in Crow’s Foot notation?
•         Â
Single rectangular box
•         Â
Solid line between entities
•         Â
Dashed line between entities
•         Â
Double rectangular box
10
Review the sample movie ratings ERD after 3NF.
Â
What is the relationship between tables Movie and Genre?
•         Â
1:M
•         Â
N:1
•         Â
M:N
•         Â
1:1
11
What is a benefit of using a lookup table?
•         Â
It models pure relationships rather than entities.
•         Â
It transforms an M:N relationship into two 1:M relationships.
•         Â
It resolves weak entities.
•         Â
It centralizes data about the key.
12
What is introduced as a criterion of a table in second normal form?
•         Â
There should be no repeating groups.
•         Â
All attributes in a table are dependent on the primary key.
•         Â
Each cell of a table should have a single value.
•         Â
There should be repeating groups.
13
What would need to be done to fix an issue with a chasm trap?
•         Â
Create a foreign key for each primary key in the relationships.
•         Â
Remove the middle table and connect the tables directly.
•         Â
Create a direct link between the two tables rather than depend on the middle relationship.
•         Â
The entire database design needs to be re-evaluated.
14
In each milestone, you may want or need to use the database and query tool to answer some of the questions. We suggest you open the tool in another browser tab while you are working on this assessment.
Â
https://postgres.sophia.org/
What is wrong with the following ERD meant to show a relationship between two entities?
Â
Â
Â
•         Â
One of the items is set up as an attribute.
•         Â
There is no relationship between the entities.
•         Â
There is nothing wrong with the ERD.
•         Â
Both of the objects are attributes.
15
What is an advantage associated with a simpler ERD design?
•         Â
Increased storage needs
•         Â
Slower application development
•         Â
More complex application code
•         Â
Simpler SQL queries
16
What is a key feature of fourth normal form?
•         Â
It is focused on eliminating join dependencies.
•         Â
It should already satisfy the properties of BCNF.
•         Â
It breaks tables down into as many tables as possible to avoid redundancy.
•         Â
It creates multivalued dependencies.
17
In each milestone, you may want or need to use the database and query tool to answer some of the questions. We suggest you open the tool in another browser tab while you are working on this assessment.
https://postgres.sophia.org/
What is wrong with the following ERD meant to show the attributes of an entity?
Â
•         Â
The primary key is not indicated correctly.
•         Â
The symbols used are swapped.
•         Â
The attributes are not correctly linked to the entity.
•         Â
There is nothing wrong with the ERD.
Why is 5NF less practical than 3NF or 4NF in a real-world setting?
•         Â
It contains very little redundancy but sacrifices performance.
•         Â
It eliminates multivalued dependencies.
•         Â
Each table contains more than one candidate key.
•         Â
It creates too much data redundancy.
Â
In each milestone, you may want or need to use the database and query tool to answer some of the questions. We suggest you open the tool in another browser tab while you are working on this assessment.
Â
https://postgres.sophia.org/
What is wrong with the following ERD meant to show a relationship between two entities?
Â
Â
Â
•         Â
Both of the objects are attributes.
•         Â
There is no relationship between the entities.
•         Â
One of the items is set up as an attribute.
•         Â
There is nothing wrong with the ERD.
Is this dataset in 3NF? If not, why not?
Â
Â
Â
•          No, there are still repeating groups.
•         Â
No, there are not enough attributes for the entity.
•         Â
No, it is not yet in 2NF.
•         Â
Yes, it could be considered to be in 3NF.
Â
What could be a reason to denormalize a database?
•         Â
The database may require us to value performance over storage and redundancy issues.
•         Â
We want to eliminate repeating groups.
•         Â
We want to increase performance for inserts, updates, and deletes.
•         Â
We want to increase the number of joins between tables to optimize performance.
Â
In each milestone, you may want or need to use the database and query tool to answer some of the questions. We suggest you open the tool in another browser tab while you are working on this assessment.
https://postgres.sophia.org/
What is wrong with the following ERD meant to show the attributes of an entity?
Â
•          The symbols used are swapped.
•         Â
The primary key is not indicated correctly.
•         Â
There is nothing wrong with the ERD.
•         Â
The attributes are not correctly linked to the entity.
Â
In each milestone, you may want or need to use the database and query tool to answer some of the questions. We suggest you open the tool in another browser tab while you are working on this assessment.
https://postgres.sophia.org/
What is wrong with the following ERD meant to show the attributes of an entity?
 Â
•         Â
The attributes are not correctly linked to the entity.
•         Â
The symbols used are swapped.
•         Â
There is nothing wrong with the ERD.
•         Â
The primary key is not indicated correctly.
Â
Â
What is a disadvantage associated with a simpler ERD design?
•         Â
More complicated queries
•         Â
Faster application development
•         Â
Less adaptable if business rules change
•         Â
Increased storage needs
Â
Identify the normal form in which we have all of the key attributes defined.
•         Â
3NF
•         Â
2NF
•         Â
None of the first three normal forms
•         Â
1NF
Â
What is a criterion of a table being in first normal form?
•         Â
No non-prime attributes dependent on the candidate key should be included.
•         Â
This normal form guarantees that there will be no data redundancies due to functional dependencies.
•         Â
No cell should have repeating groups.
•         Â
All transitive functional dependencies of a non-prime attribute of a super key should be removed.
Â
Is this dataset in 2NF or not? If not why not?
Â
Â
Â
•          No, there are no transitive functional dependencies.
•         Â
No, the dataset is not yet in 1NF.
•         Â
No, there are still functional dependencies.
•         Â
It is in 2NF.
Â
What is a benefit of using a lookup table?
•         Â
It resolves weak relationships.
•         Â
It guarantees that there will be no data redundancies due to functional dependencies.
•         Â
It provides fast answers to some questions.
•         Â
It models pure relationships rather than entities.
Â
What is true about normalization?
•         Â
It adds layers of data redundancy.
•         Â
It increases the chance of data anomalies.
•         Â
The second nomal form is typically the highest level necessary.
•         Â
It may decrease performance due to additional joins.
Â
n each milestone, you may want or need to use the database and query tool to answer some of the questions. We suggest you open the tool in another browser tab while you are working on this assessment.
https://postgres.sophia.org/
What type of cardinality is demonstrated by the following ERD?
Â
Â
•         Â
A country can have multiple capital cities. A capital city can belong to multiple countries.
•         Â
A country can have a capital city. A capital city can be part of one country.
•         Â
A country can have multiple capital cities. A capital city can be part of one country.
•         Â
A country can have a capital city. A capital city can belong to multiple countries.
Â
In each milestone, you may want or need to use the database and query tool to answer some of the questions. We suggest you open the tool in another browser tab while you are working on this assessment.
Â
https://postgres.sophia.org/
What is wrong with the following ERD meant to show a relationship between two entities?
Â
 Â
Â
•         Â
One of the items is set up as an attribute.
•         Â
There is nothing wrong with the ERD.
•         Â
Both of the objects are attributes.
•         Â
There is no relationship between the entities.
Â
What type of key can be used in an associative entity?
•         Â
A natural primary key
•         Â
A surrogate primary key
•         Â
A composite primary key
•         Â
No key is needed with an associative entity.
Â
Identify the component that is unrelated to hardware that could create query processing bottlenecks and affect database performance.
•         Â
CPU
•         Â
Application code
•         Â
RAM
•         Â
Hard disk
Â
In each milestone, you may want or need to use the database and query tool to answer some of the questions. We suggest you open the tool in another browser tab while you are working on this assessment.
Â
https://postgres.sophia.org/
Which of the following queries will use a subquery to find all of the rows in the track table that has the composer as Miles Davis and has the length of the song in milliseconds shorter than the maximum track length of all songs where the media_type_id = 1?
•         Â
SELECT *
FROM TRACK
WHERE milliseconds <
(SELECT max(milliseconds)
FROM track
WHERE media_type_id = 1)
AND composer = 'Miles Davis';
•         Â
SELECT *
FROM TRACK
WHERE milliseconds >
SELECT MIN(milliseconds)
FROM track
WHERE media_type_id = 1
AND composer = 'Miles Davis';
•         Â
SELECT *
FROM TRACK
WHERE milliseconds >
(SELECT MIN(milliseconds)
FROM track
WHERE media_type_id = 1)
AND composer = 'Miles Davis';
•         Â
SELECT *
FROM TRACK
WHERE milliseconds >
(SELECT max(milliseconds)
FROM track
WHERE media_type_id = 1)
AND composer = 'Miles Davis';
Â
In each milestone, you may want or need to use the database and query tool to answer some of the questions. We suggest you open the tool in another browser tab while you are working on this assessment.
Â
https://postgres.sophia.org/
Genre
genre_id         name
1Â Â Â Â Â Â Â Â Â Broadway
2Â Â Â Â Â Â Â Â Â Rock
3Â Â Â Â Â Â Â Â Â Classical
4Â Â Â Â Â Â Â Â Â Salsa
Â
Â
Track
track_id          name  genre_id
1         Highway to Hell        2
2Â Â Â Â Â Â Â Â Â Symphony #5Â 3
Â
Â
Â
Given the above genres and tracks, how many results will be returned for the following query?
Â
SELECT genre.name, track.name
FROM track
RIGHT JOIN genre
USING (genre_id);
•         Â
2
•         Â
3
•         Â
4
•         Â
1
Â
Review the sample eCommerce ERD after 3NF.
Â
Which tables are lookup tables?
•         Â
PhoneType, AddressType
•         Â
Category, AddressType, PhoneType
•         Â
Customer, Category
•         Â
Category
Â
In each milestone, you may want or need to use the database and query tool to answer some of the questions. We suggest you open the tool in another browser tab while you are working on this assessment.
https://postgres.sophia.org/
Use the following data model for this question:
Â
Fish
fish_id
name
Â
DailyCatch
catch_id
date
Â
Fish_Catch
fish_catch_id
catch_id
fish_id
Â
Â
Which of the following is a situation where an OUTER JOIN could be useful?
•         Â
When a fisherman wants to see the fish that belong to a certain species
•         Â
When a fisherman wants to see only fish in the database that she has caught
•         Â
When a fisherman wants to see all fish in the database including those that she has caught and those that she has not caught before
•         Â
When a fisherman wants to see only the fish that she has not caught
Â
Which of the following criteria was a key milestone for the relational model created in the mid-1970s?
•         Â
The ability to hide the complexities of the model from the user through the use of the database management system
•         Â
The existence of support for unstructured data
•         Â
The collection of similar structures that consisted of shared attributes and behaviors
•         Â
The ability to have very large storage in petabytes
Â
In each milestone, you may want or need to use the database and query tool to answer some of the questions. We suggest you open the tool in another browser tab while you are working on this assessment.
Â
https://postgres.sophia.org/
Given the initial tables in our example database, the organization would like to remove a playlist.
What order should the table data be deleted from?
•         Â
playlist_track
playlist
•         Â
track
playlist_track
playlist
•         Â
playlist
playlist_track
track
•         Â
playlist
playlist_track
Â
In each milestone, you may want or need to use the database and query tool to answer some of the questions. We suggest you open the tool in another browser tab while you are working on this assessment.
https://postgres.sophia.org/
Which of the following scenarios reflects the isolation property?
•         Â
1. In the library database, there are 50 books available.
2. Billy has checked and there are 50 books.
3. Sam has checked and there are 50 books.
4. Billy has taken out 5 books.
5. The library system informs Sam of the update and Sam now checks that there are 45 books.
6. Sam checks out 10 books.
7. There are now 35 books in the library database.
•         Â
1. In the flower database, there are 50 flowers available.
2. Reese has checked and there are 50 flowers.
3. Reese has attempted to take out 5 flowers.
4. Which trying to take them out, there was an error in trying to dispense.
5. While checking, there are still 50 flowers available in the system.
•         Â
1. Tiffany has updated a customer's address while on the phone with them.
2. The server restarted after Tiffany clicked on save.
3. When the server comes back up, Tiffany was able to verify that the address was updated.
•         Â
1. A user attempts to do a product transfer between companies.
2. The quantity of the product is moved from the first company.
3. Only once the product is verified to have been deducted, the quantity is moved to the second company.
4. Verification is done and identifies that the total amounts before and after the transactions are not maintained.
5. The transaction is reverted.
Â
In each milestone, you may want or need to use the database and query tool to answer some of the questions. We suggest you open the tool in another browser tab while you are working on this assessment.
Â
https://postgres.sophia.org/
Which query would be more efficient?
Â
1. SELECT *
FROM customer
WHERE city IN
(SELECT city
FROM employee
WHERE reports_to = 2);
Â
2. SELECT customer.*
FROM customer
INNER JOIN employee
ON customer.city = employee.city
WHERE reports_to = 2;
•         Â
Query #1 would be more efficient as it is based on primary and foreign keys.
•         Â
Query #2 would be more efficient as it is based on primary and foreign keys.
•         Â
Both would be the same as both use the same indices for the join and filter.
•         Â
Query #1 would be more efficient as it is not using indexed columns.
Â
Using the AND or OR statement, filter the employee table for employees who live in the city Lethbridge or have IT within their title.
Identify the first name of the 2nd record.
•         Â
Michael
•         Â
Laura
•         Â
King
•         Â
Robert
Â
In each milestone, you may want or need to use the database and query tool to answer some of the questions. We suggest you open the tool in another browser tab while you are working on this assessment.
Â
https://postgres.sophia.org/
In which of the following cases would it make the most sense to use a b-tree index?
•         Â
SELECT *
FROM track
WHERE track_id < 10 AND track_id > 15;
•         Â
SELECT *
FROM artist
WHERE artist_id < 10;
•         Â
SELECT *
FROM album
WHERE email LIKE '%t%';
•         Â
SELECT *
FROM customer
WHERE email LIKE '%apple.com';
Â
Which of the following commands must be supported in the same way by the commercial database management system to comply with ANSI standards?
•         Â
ALTER DATABASE
•         Â
WHERE
•         Â
DROP TABLE
•         Â
CREATE VIEW
Â
In each milestone, you may want or need to use the database and query tool to answer some of the questions. We suggest you open the tool in another browser tab while you are working on this assessment.
Â
https://postgres.sophia.org/
Ingredient
ID: 1, Name: Cayenne Pepper
ID: 2, Name: Pasta noodle
ID: 3, Name: Fresh tomato
ID: 4, Name: Sugar
Â
Recipe
ID: 1, Name: Lasagna
ID: 2, Name: Chocolate Chip Cookies
Â
Given the above data for a recipe database, how many records would be included in the result set for the following query?
Â
SELECT Recipe.name, Ingredient.name
FROM Recipe
CROSS JOIN Ingredient;
•         Â
2
•         Â
4
•         Â
8
•         Â
6
Â
CIS----------- 11-----------1 S-----------OPH-----------IA------------STR-----------AYE-----------R I-----------ntr-----------odu-----------cti-----------on -----------to -----------Rel-----------ati-----------ona-----------l D-----------ata-----------bas-----------e M-----------ana-----------gem-----------ent----------- Sy-----------ste-----------ms -----------Uni-----------t 5----------- Fi-----------nal----------- Ex-----------am ------------so-----------bte-----------ll.-----------com----------- C-----------lic-----------k l-----------ink----------- fo-----------r A-----------nsw-----------ers----------- Al-----------l C-----------orr-----------ect-----------