cs1011-unit-1-practice-milestone

pdf

School

Western Governors University *

*We aren’t endorsed by this school

Course

1011

Subject

Computer Science

Date

Jan 9, 2024

Type

pdf

Pages

36

Uploaded by CorporalGoldfinch1005

Report
1 CONCEPT ALTER TABLE to Change Columns: Add/Drop 9/36 that's 25% RETAKE THIS PRACTICE MILESTONE 9 questions were answered correctly . 27 questions were skipped . These were marked incorrect. Identify the correctly constructed ALTER TABLE statement that removes the password column from the user table. ALTER TABLE user ADD password VARCHAR (100); ALTER TABLE user DROP password; ALTER TABLE user DROP password VARCHAR (100); ALTER TABLE user DROP pass; UNIT 1 — PRACTICE MILESTONE 1 Download Practice Milestone PDF 9/36
2 CONCEPT AVG to Average Values 3 Report an issue with this question Using the SELECT statement, query the track table to find the average length of a track that has an album_id equal to 10. RATIONALE Common mistakes when using the AVG function include not selecting the right column, omitting the ( ) around the column, and failing to add in the filter conditions. Report an issue with this question Using the SELECT statement, query the invoice table to find the maximum invoice_date where the billing_country is equal to USA. 393599.2121 280550.9286 394052.8309 244370.8837 UNIT 1 — PRACTICE MILESTONE 1 Download Practice Milestone PDF 9/36
CONCEPT MAX & MIN to Find Extremes 4 RATIONALE Common mistakes when using the MAX function include not selecting the right column, omitting the ( ) around the column, and failing to add in the filter conditions. Report an issue with this question Which of these constraints ensures that all values in a column are different, although they may be empty? 2013-12-22 2009-01-11 2013-12-05 2013-12-06 NOT NULL FOREIGN KEY PRIMARY KEY UNIT 1 — PRACTICE MILESTONE 1 Download Practice Milestone PDF 9/36
Your preview ends here
Eager to read complete document? Join bartleby learn and gain access to the full version
  • Access to all documents
  • Unlimited textbook solutions
  • 24/7 expert homework help
CONCEPT Table Constraints 5 RATIONALE The UNIQUE constraint ensures that all values in a column are different, but they can be empty or NULL. Report an issue with this question Given the track 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? UNIQUE ALTER TABLE track ALTER composer TYPE VARCHAR (50); ALTER TABLE track ALTER COLUMN name TEXT; ALTER TABLE track ALTER COLUMN bytes TYPE VARCHAR (100); UNIT 1 — PRACTICE MILESTONE 1 Download Practice Milestone PDF 9/36
CONCEPT ALTER TABLE to Change Columns: Data Type 6 RATIONALE Common mistakes when modifying the data type of a column include: not casting the variables if needed; not including the table and column names to change; the column being a primary or foreign key; and failing to consider the error messages that may occur when converting the existing data in the table. Report an issue with this question Identify the SQL command that uses an aggregate function that could be used to find the oldest (by age) employee in the employee table. ALTER TABLE track ALTER COLUMN bytes TYPE VARCHAR (1); SELECT max(birth_date) FROM employee; SELECT min birth_date FROM employee; SELECT min(birth_date) FROM employee; UNIT 1 — PRACTICE MILESTONE 1 Download Practice Milestone PDF 9/36
CONCEPT Aggregate Functions 7 RATIONALE Common mistakes when using aggregate functions include not choosing the right aggregate function, omitting the ( ) around the columns, and misspelling the aggregate function name. Report an issue with this question Using the SELECT statement, query the track table to find the number of tracks that are in the genre_id column and not equal to 3. RATIONALE Common mistakes when using the COUNT function include not selecting the right column, omitting the ( ) around the column, SELECT sum(birth_date) FROM employee; 3129 2206 374 3503 UNIT 1 — PRACTICE MILESTONE 1 Download Practice Milestone PDF 9/36
Your preview ends here
Eager to read complete document? Join bartleby learn and gain access to the full version
  • Access to all documents
  • Unlimited textbook solutions
  • 24/7 expert homework help
CONCEPT COUNT to Count Records 8 and failing to add in the filter conditions. Report an issue with this question 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 live in the country Canada? INSERT INTO contact SELECT phone FROM customer WHERE country = 'Canada'; INSERT INTO contact (phone) SELECT phone FROM customer WHERE country = 'Canada'; INSERT INTO contact (phone) SELECT phone FROM customer; INSERT INTO contact (user_id, phone) UNIT 1 — PRACTICE MILESTONE 1 Download Practice Milestone PDF 9/36
CONCEPT INSERT to Add Queried Data 9 RATIONALE Common mistakes when inserting data queried from another table include: not setting the value for the sequence; not having the same number of values as the number of columns; not including data for rows with a NOT NULL constraint; not adhering to the UNIQUE constraint; not considering foreign keys; not quoting string data; and not having the set of values in the same order as the column list. Report an issue with this question In each milestone, you may want or need to use the database and query tool to answer some 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 group of terms represents the three main SQL clauses? SELECT phone FROM customer WHERE country = Canada; SOURCE, FOR, and WHAT SELECT, FROM, and WHAT SOURCE, FOR, and WHERE UNIT 1 — PRACTICE MILESTONE 1 Download Practice Milestone PDF 9/36
CONCEPT SQL Clauses 10 Report an issue with this question You skipped this question and it was marked incorrect. Using the WHERE and HAVING clauses, filter the invoice table for a billing_address starting with the number 1, and grouped by the country having a minimum total of orders less than 2. Provide the list of countries and the sum of the totals that fit these criteria. Which of the following queries would provide the correct results? SELECT, FROM, and WHERE SELECT billing_country, MIN(total) FROM invoice WHERE billing_address LIKE '1%' GROUP BY billing_country HAVING SUM(total) < 2; SELECT billing_country, SUM(total) FROM invoice GROUP BY billing_country HAVING MIN(total) < 2 WHERE billing_address LIKE '1%'; SELECT billing_country, SUM(total) FROM invoice UNIT 1 — PRACTICE MILESTONE 1 Download Practice Milestone PDF 9/36
Your preview ends here
Eager to read complete document? Join bartleby learn and gain access to the full version
  • Access to all documents
  • Unlimited textbook solutions
  • 24/7 expert homework help
CONCEPT Filters to Specify Data 11 RATIONALE Common mistakes when using both the WHERE and HAVING clause include using the aggregate function in the WHERE clause, listing the clauses in the incorrect order, failing to include all of the columns listed in the SELECT clause in the GROUP BY clause, and using the incorrect aggregate functions. Report an issue with this question You skipped this question and it was marked incorrect. Using the ORDER BY clause, sort the customer table by the city of the customer in ascending order and identify the 9th row's city in the list from among the answer options. WHERE billing_address LIKE '1%' GROUP BY billing_country HAVING MIN(total) < 2; SELECT billing_country, SUM(total) FROM invoice WHERE MIN(total) < 2 GROUP BY billing_country HAVING billing_address LIKE '1%'; Brazil São José dos Campos UNIT 1 — PRACTICE MILESTONE 1 Download Practice Milestone PDF 9/36
CONCEPT ORDER BY to Sort Data 12 RATIONALE Some common mistakes in using ORDER BY are sorting by ASC rather than DESC or vice versa, reporting the wrong column, and using the wrong column for the sort. Report an issue with this question You skipped this question and it was marked incorrect. Using the LIKE operator in the WHERE clause, utilize the necessary wildcards to filter the tracks table to find the tracks that have Toni anywhere in the composer's field. Remember that capitalization is important in the search query. Identify the 5th track's song. Stockholm Budapest A Estrada Berlim Podes Crer UNIT 1 — PRACTICE MILESTONE 1 Download Practice Milestone PDF 9/36
CONCEPT LIKE Wildcards 13 RATIONALE Common mistakes when using the LIKE operator are filtering the wrong column of data, using the wrong data table, omitting the single quotes around the data, and forgetting to include the wild cards in all parts of the string rather than just on one end. Report an issue with this question You skipped this question and it was marked incorrect. Using the BETWEEN operator, filter the invoice table to find the invoices dated between 2009-06-01 and 2009-06-30. Identify the 3rd customer ID. RATIONALE Firmamento 17 13 15 21 UNIT 1 — PRACTICE MILESTONE 1 Download Practice Milestone PDF 9/36
Your preview ends here
Eager to read complete document? Join bartleby learn and gain access to the full version
  • Access to all documents
  • Unlimited textbook solutions
  • 24/7 expert homework help
CONCEPT BETWEEN to Filter Data 14 Common mistakes include filtering the wrong column of data, using the wrong table, using incorrect boundaries in the BETWEEN clause, and omitting the word 'and' between the values. Report an issue with this question You skipped this question and it was marked incorrect. Which of the following UPDATE statements would successfully update the employee table, where the first name is Robert and the last name is King, to set the reports_to value to 1 and set the title to IT Manager? UPDATE employee WHERE last_name = 'King' AND first_name = 'Robert' SET reports_to = 1, title = 'IT Manager'; UPDATE employee SET reports_to = 1, title = 'IT Manager' WHERE last_name = 'King' AND first_name = 'Robert'; UPDATE employee SET reports_to = 1, title = 'IT Manager' WHERE last_name = 'King', first_name = 'Robert'; UNIT 1 — PRACTICE MILESTONE 1 Download Practice Milestone PDF 9/36
CONCEPT UPDATE to Edit Row 15 RATIONALE Common mistakes when using the UPDATE statement that impacts a single row in a table include omitting commas between each variable set, not including the WHERE clause to identify specific rows, not updating all fields, and using AND in the SET clause. Report an issue with this question You skipped this question and it was marked incorrect. Using the WHERE clause, filter the customer table to include individuals who live in the country of Brazil. Identify the company of the 2nd individual listed. UPDATE employee SET reports_to = 1 AND title = 'IT Manager' WHERE last_name = 'King' AND first_name = 'Robert'; Woodstock Discos Martins Prague Rocha UNIT 1 — PRACTICE MILESTONE 1 Download Practice Milestone PDF 9/36
CONCEPT WHERE to Filter Data 16 RATIONALE Common mistakes when using a WHERE clause include using the wrong inequality operator, filtering on the wrong column of data, using the wrong data table, omitting single quotes on string data, and forgetting that string data is case sensitive. Report an issue with this question You skipped this question and it was marked incorrect. Given the track 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 track ALTER COLUMN track_id TYPE VARCHAR (50); ALTER TABLE track ALTER COLUMN name TYPE VARCHAR (200); ALTER TABLE track ALTER COLUMN bytes TYPE VARCHAR (100); ALTER TABLE track ALTER COLUMN composer TYPE UNIT 1 — PRACTICE MILESTONE 1 Download Practice Milestone PDF 9/36
Your preview ends here
Eager to read complete document? Join bartleby learn and gain access to the full version
  • Access to all documents
  • Unlimited textbook solutions
  • 24/7 expert homework help
CONCEPT ALTER TABLE to Change Columns: Data Characteristics 17 RATIONALE Common mistakes when modifying the data type of a column include: not casting the variables if needed; not including the table and column names to change; the column being a primary or foreign key; and failing to consider the error messages that may occur when converting the existing data in the table. If your column has a foreign key reference in another table, the data type needs to be the same as the primary key. Report an issue with this question You skipped this question and it was marked incorrect. Which of the following UPDATE statements would update the unit_price to 1.29 where the genre_id is set between 2 and 5? VARCHAR (500); UPDATE track WHERE genre_id BETWEEN 2 AND 5 SET unit_price = 1.29; UPDATE track SET unit_price = 1.29 WHERE genre_id BETWEEN 2, 5; UPDATE track SET unit_price = 1.29 UNIT 1 — PRACTICE MILESTONE 1 Download Practice Milestone PDF 9/36
CONCEPT UPDATE to Edit Multiple Rows 18 RATIONALE Common mistakes when using the UPDATE statement to edit multiple rows in a table include omitting commas between each variable set, not including the WHERE clause to identify specific rows, not updating all fields, and using AND in the SET clause. Report an issue with this question You skipped this question and it was marked incorrect. The following CREATE TABLE statement creates a table called 'department' that consists of the department_id as the primary key, the department_name, and the manager_id. 1 CREATE TABLE department( 2 department_id int PRIMARY KEY, 3 department_name, 4 manager_id int 5 ); Identify the line of code that would generate an error in this CREATE TABLE statement. WHERE track_id BETWEEN 2 AND 5; UPDATE track SET unit_price = 1.29 WHERE genre_id BETWEEN 2 AND 5; UNIT 1 — PRACTICE MILESTONE 1 Download Practice Milestone PDF 9/36
CONCEPT CREATE TABLE Syntax 19 RATIONALE Common mistakes with creating a table are: not including all column names, not matching the names exactly, not including data types, not including sizes for strings, omitting commas to separate out each column, and not using ( ) around the entire table set. Report an issue with this question You skipped this question and it was marked incorrect. Using the GROUP BY and HAVING clauses, filter the customer table by country. How many countries have more than 5 customers? 1 4 2 3 4 UNIT 1 — PRACTICE MILESTONE 1 Download Practice Milestone PDF 9/36
Your preview ends here
Eager to read complete document? Join bartleby learn and gain access to the full version
  • Access to all documents
  • Unlimited textbook solutions
  • 24/7 expert homework help
CONCEPT HAVING to Filter On Aggregates 20 RATIONALE Common mistakes when using the HAVING clause with the GROUP BY clause in a SELECT statement include: not using aggregate functions in the SELECT clause; not including each column in the SELECT clause in the GROUP BY clause; using the incorrect aggregate function; and incorrectly including the filter in the WHERE clause instead of the HAVING clause. Report an issue with this question You skipped this question and it was marked incorrect. Consider the following table: CREATE TABLE song( song_id SERIAL PRIMARY KEY, song_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? 5 3 2 UNIT 1 — PRACTICE MILESTONE 1 Download Practice Milestone PDF 9/36
CONCEPT INSERT to Add Data 21 RATIONALE Common mistakes when inserting a new record into an existing table using an auto-incremented ID include: not setting the value for the sequence; not having the same number of values as the number of columns; not including data for rows with a NOT NULL constraint; not adhering to the UNIQUE constraint; not considering foreign keys; not quoting string data; and not having the set of values in the same order as the column list. Report an issue with this question You skipped this question and it was marked incorrect. Using the GROUP BY clause and the count aggregate function, filter the track table to group the tracks based on album_id. INSERT INTO song (song_name) VALUES (Happy Birthday); INSERT INTO song (song_name) VALUES ('Happy Birthday' ); INSERT INTO song (song_id, song_name) VALUES (1, 'Happy Birthday' ); INSERT INTO song (song_id, song_name) VALUES (nextval, 'Happy Birthday'); UNIT 1 — PRACTICE MILESTONE 1 Download Practice Milestone PDF 9/36
CONCEPT GROUP BY to Combine Data 22 How many tracks are in album 251? RATIONALE Common mistakes when using the GROUP BY clause in a SELECT statement include not using aggregate functions in the SELECT clause, not including each column in the SELECT clause in the GROUP BY clause, and using the incorrect aggregate function. Report an issue with this question You skipped this question and it was marked incorrect. Using the IN operator, filter the album table to find those with the artist ID set to 1, 68, 58, or 27. Identify the title of the 6th record. 25 15 17 9 The Final Concerts [Disc 2] UNIT 1 — PRACTICE MILESTONE 1 Download Practice Milestone PDF 9/36
Your preview ends here
Eager to read complete document? Join bartleby learn and gain access to the full version
  • Access to all documents
  • Unlimited textbook solutions
  • 24/7 expert homework help
CONCEPT IN to Filter Data 23 RATIONALE Common mistakes include filtering the wrong column of data, using the wrong table, not using commas to separate out each criterion, omitting single quotes around string data, and incorrectly spelling the values. Report an issue with this question You skipped this question and it was marked incorrect. Using the SELECT statement, query the invoice table to find the average total cost for all orders purchased by customer_id not equal to 5, rounded to the nearest cent. Fireball Deep Purple in Rock Come Taste the Band 5.704 5.70 5.706 UNIT 1 — PRACTICE MILESTONE 1 Download Practice Milestone PDF 9/36
Your preview ends here
Eager to read complete document? Join bartleby learn and gain access to the full version
  • Access to all documents
  • Unlimited textbook solutions
  • 24/7 expert homework help
CONCEPT ROUND to Round Numbers 24 RATIONALE Common mistakes when using the ROUND function include not selecting the right column, not including the precision level, omitting the ( ) around the column/function, and failing to add in the filter conditions. Report an issue with this question You skipped this question and it was marked incorrect. Using the LIKE operator in the WHERE clause, filter the customer table to list the individuals who have a first name starting with F. Identify the 4th individual's customer ID. RATIONALE 5.71 16 37 13 24 UNIT 1 — PRACTICE MILESTONE 1 Download Practice Milestone PDF 9/36
Your preview ends here
Eager to read complete document? Join bartleby learn and gain access to the full version
  • Access to all documents
  • Unlimited textbook solutions
  • 24/7 expert homework help
CONCEPT LIKE to Search Data 25 CONCEPT SUM to Add Values Common mistakes when using the LIKE operator are filtering the wrong column of data, using the wrong data table, omitting the single quotes around the data, and forgetting to include the wild card % in the correct location of the LIKE operator. Report an issue with this question You skipped this question and it was marked incorrect. 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 1. RATIONALE Common mistakes when using the SUM function include not selecting the right column, omitting the ( ) around the column, and failing to add in the filter conditions. 2311 40 7 4 UNIT 1 — PRACTICE MILESTONE 1 Download Practice Milestone PDF 9/36
Your preview ends here
Eager to read complete document? Join bartleby learn and gain access to the full version
  • Access to all documents
  • Unlimited textbook solutions
  • 24/7 expert homework help
26 CONCEPT Filter by Date Report an issue with this question You skipped this question and it was marked incorrect. Using the WHERE clause, filter the invoice table to find the invoices dated on or after June 1st, 2013. Identify the first customer ID of the invoice. RATIONALE A common mistake when filtering dates can be incorrectly identifying the day, month, and year, as different countries may list them in a different order. Always check your data first to ensure the correct order of the day, month, and year. Other common errors are using the wrong inequality comparison (e.g., > rather than <), filtering on the wrong column of data, and using the wrong data table. Also, make sure that you use the correct format for the date, using yyyy-mm-dd. Report an issue with this question 29 31 37 33 UNIT 1 — PRACTICE MILESTONE 1 Download Practice Milestone PDF 9/36
Your preview ends here
Eager to read complete document? Join bartleby learn and gain access to the full version
  • Access to all documents
  • Unlimited textbook solutions
  • 24/7 expert homework help
27 You skipped this question and it was marked incorrect. Which of the following is a correctly formatted INSERT statement that will insert three records into the album table? RATIONALE Common mistakes when inserting multiple records using a single INSERT statement include not using commas between INSERT INTO album (artist_id, title, album_id) VALUES (1, 'My Album', 348), (1, 'Newest Album','Song Writer') (1, 'Great Album', 350); INSERT INTO album (artist_id, title, album_id) VALUES (1, 'My Album', 348), (1, 'Newest Album', 349), (1, 'Great Album', 350); INSERT INTO album (album_id, title, artist_id) VALUES (1, 'My Album', 348), (1, 'New Album', 349), (1, 'Great Album', 350); INSERT INTO album (artist_id, title, album_id) VALUES (1, 'My Album', 348) (1, 'Newest Album', 349) (1, 'Great Album', 350); UNIT 1 — PRACTICE MILESTONE 1 Download Practice Milestone PDF 9/36
Your preview ends here
Eager to read complete document? Join bartleby learn and gain access to the full version
  • Access to all documents
  • Unlimited textbook solutions
  • 24/7 expert homework help
CONCEPT INSERT INTO to Add Multiple Rows 28 each set of criteria, not adhering to the constraints, not including the same number of parameters for each statement, and mixing up the types. Report an issue with this question You skipped this question and it was marked incorrect. Identify the correctly constructed ALTER TABLE statement to add a UNIQUE constraint to the column address with the constraint name address_unique on the table called 'employee'. RATIONALE ALTER TABLE employee ADD CONSTRAINT address UNIQUE (address_unique); ALTER TABLE employee ADD CONSTRAINT address_unique UNIQUE (address); ALTER TABLE employee ADD CONSTRAINT address UNIQUE (address); ALTER TABLE employee ADD UNIQUE address CONSTRAINT (address_unique); UNIT 1 — PRACTICE MILESTONE 1 Download Practice Milestone PDF 9/36
Your preview ends here
Eager to read complete document? Join bartleby learn and gain access to the full version
  • Access to all documents
  • Unlimited textbook solutions
  • 24/7 expert homework help
CONCEPT UNIQUE to Validate Data 29 Common mistakes with adding the UNIQUE constraint to an existing column include not having ( ) around the column names, omitting the keyword UNIQUE, incorrectly spelling the column name, and not including the constraint name. Report an issue with this question You skipped this question and it was marked incorrect. Which of the following is a correctly formatted INSERT statement that will successfully add a record into the artist table? RATIONALE INSERT INTO artist (artist_id, name) VALUES (400, New Artist); INSERT INTO artist (artist_id, name) VALUES (400, 'New Artist' ); INSERT INTO artist (artist_id, name) VALUES ('New Artist', 400 ); INSERT INTO artist (artist_id, name) VALUES (5, 'New Artist' ); UNIT 1 — PRACTICE MILESTONE 1 Download Practice Milestone PDF 9/36
Your preview ends here
Eager to read complete document? Join bartleby learn and gain access to the full version
  • Access to all documents
  • Unlimited textbook solutions
  • 24/7 expert homework help
CONCEPT INSERT INTO to Add Row 30 Common mistakes when inserting a new record into an existing table include: not having the same number of values as the number of columns; not including data for rows with a NOT NULL constraint; not adhering to the UNIQUE constraint; not considering foreign keys; not quoting string data; and not having the set of values in the same order as the column list. Report an issue with this question You skipped this question and it was marked incorrect. In each milestone, you may want or need to use the database and query tool to answer some 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 two columns of data from the invoice table? SELECT invoice_id and total FROM invoice; SELECT * FROM invoice; SELECT invoice_id, total FROM invoice; UNIT 1 — PRACTICE MILESTONE 1 Download Practice Milestone PDF 9/36
Your preview ends here
Eager to read complete document? Join bartleby learn and gain access to the full version
  • Access to all documents
  • Unlimited textbook solutions
  • 24/7 expert homework help
CONCEPT SELECT to Display Data 31 RATIONALE Common mistakes when displaying columns of data by using a SELECT statement include using the * wildcard when the table has more than the desired number of columns; misspelling a clause name, table name, or column name; and forgetting to use commas appropriately. Report an issue with this question You skipped this question and it was marked incorrect. Which of the following statement(s) would successfully delete all of the employees with the title IT Staff from the employee table? SELECT invoiceID total FROM invoice; DELETE FROM employee WHERE employee_id = 'IT Staff'; DELETE FROM employee; DELETE FROM employee WHERE title = 'IT Staff'; UNIT 1 — PRACTICE MILESTONE 1 Download Practice Milestone PDF 9/36
Your preview ends here
Eager to read complete document? Join bartleby learn and gain access to the full version
  • Access to all documents
  • Unlimited textbook solutions
  • 24/7 expert homework help
CONCEPT DELETE FROM to Remove Row 32 RATIONALE Common mistakes when deleting from tables include not removing tables that reference their foreign keys, not deleting from the tables in the right order, not deleting data from all of the tables, not using quotes around string literals, and not using the right syntax. Report an issue with this question You skipped this question and it was marked incorrect. Using the AND or OR statement, filter the customer table for customers who live in the country USA and have an address that starts with a 1. Identify the last name of the 2nd record. DELETE FROM employee WHERE title = IT Staff; Goyer Harris Silk Smith UNIT 1 — PRACTICE MILESTONE 1 Download Practice Milestone PDF 9/36
Your preview ends here
Eager to read complete document? Join bartleby learn and gain access to the full version
  • Access to all documents
  • Unlimited textbook solutions
  • 24/7 expert homework help
CONCEPT Multiple Filters 33 RATIONALE Common mistakes include using the = instead of LIKE when utilizing wild cards, filtering the wrong column of data, using the wrong data table, omitting the single quotes around the data, and forgetting to include the wild cards in all parts of the string rather than just on one end. Another common mistake when using the AND and OR statements is selecting the incorrect option; the AND operator should be used when both conditions need to apply whereas the OR operator should be used when only one condition of the two should apply. Report an issue with this question You skipped this question and it was marked incorrect. 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 invoice_line; DROP TABLE playlist_track; DROP TABLE invoice; DROP TABLE track; DROP TABLE playlist_track; DROP TABLE playlist; UNIT 1 — PRACTICE MILESTONE 1 Download Practice Milestone PDF 9/36
Your preview ends here
Eager to read complete document? Join bartleby learn and gain access to the full version
  • Access to all documents
  • Unlimited textbook solutions
  • 24/7 expert homework help
CONCEPT DROP TABLE to Remove Tables 34 RATIONALE Common mistakes when dropping a table include not considering the foreign keys linked to the table, not removing the foreign keys on the table, and not including the correct table name. Report an issue with this question You skipped this question and it was marked incorrect. Select the correctly constructed CHECK constraint to validate the mailing_list column of type char, to ensure that values placed into it are either Y or N. DROP TABLE playlist_track DROP TABLE playlist; DROP TABLE genre; CHECK (mailing_list = 'Y' OR 'N') CHECK (mailing_list = 'Y' AND mailing_list = 'N') CHECK (mailing_list = 'Y' OR mailing_list = 'N') UNIT 1 — PRACTICE MILESTONE 1 Download Practice Milestone PDF 9/36
Your preview ends here
Eager to read complete document? Join bartleby learn and gain access to the full version
  • Access to all documents
  • Unlimited textbook solutions
  • 24/7 expert homework help
CONCEPT CHECK to Validate Data 35 RATIONALE Common mistakes with CHECK constraints include having the incorrect range, incorrectly using AND and OR, using the incorrect comparison operator, incorrectly naming columns, not considering the right data type, and omitting quotes around string data. Report an issue with this question You skipped this question and it was marked incorrect. The following CREATE TABLE statement creates a table called 'department' that consists of the department_id as the primary key that is auto-incremented, the department_name, and the manager_id. 1 CREATE TABLE department( 2 department_id serial, 3 department_name VARCHAR (100), 4 manager_id int 5 ); Identify the line of code that would either generate a syntax, logical, or requirements error in this CREATE TABLE statement. CHECK (mailing_list = Y OR mailing_list = N) 2 UNIT 1 — PRACTICE MILESTONE 1 Download Practice Milestone PDF 9/36
Your preview ends here
Eager to read complete document? Join bartleby learn and gain access to the full version
  • Access to all documents
  • Unlimited textbook solutions
  • 24/7 expert homework help
CONCEPT Primary Key and Auto-increment 36 RATIONALE Common mistakes with creating a table are: not including all column names, not matching the names exactly, not including data types, not including sizes for strings, omitting commas to separate out each column, not using ( ) around the entire table set, not using SERIAL in the primary key, and listing SERIAL for multiple columns. Report an issue with this question You skipped this question and it was marked incorrect. USING the SELECT statement, query the track table ordered by the track_id. Set the LIMIT to 5 and OFFSET to 5. What is the name of the last row returned? 4 1 3 Evil Walks Princess of the Dawn Snowballed UNIT 1 — PRACTICE MILESTONE 1 Download Practice Milestone PDF 9/36
Your preview ends here
Eager to read complete document? Join bartleby learn and gain access to the full version
  • Access to all documents
  • Unlimited textbook solutions
  • 24/7 expert homework help
CONCEPT LIMIT and OFFSET to Cap Results RATIONALE Common mistakes with the LIMIT and OFFSET clauses include mixing up the two, not using the ORDER BY clause to enforce a predictable result set, and not using the rows skipped using OFFSET. Report an issue with this question Put The Finger On You About Contact Us Privacy Policy Cookie Policy Terms of Use Your Privacy Choices © 2023 SOPHIA Learning, LLC. SOPHIA is a registered trademark of SOPHIA Learning, LLC. UNIT 1 — PRACTICE MILESTONE 1 Download Practice Milestone PDF 9/36
Your preview ends here
Eager to read complete document? Join bartleby learn and gain access to the full version
  • Access to all documents
  • Unlimited textbook solutions
  • 24/7 expert homework help