D427 Data Management Applications Pre-Assessment Leave the first rating Students also studied Terms in this set (25) Western Governors UniversityD 426 Save WGU - D427 - Data Management - ...66 terms helen_robertson4 Preview WGU - D427 Data Management - Ap...27 terms helen_robertson4 Preview
WGU C952
239 terms njlasjdPreview WGU D 160 term Mo 4San Francisco, CA 94110 USA How many attributes are present in the address fragment?
TrackingNumberThe Package table has the following columns:
Weight—decimal Description—optional variable length string LastChangedDate—date TrackingNumber—integer Which column should be designated the primary key for the Package table?DATETIMEWhich data type will store "2022-01-10 14:22:12" as a temporal value without loss of information?CREATE, ALTER DROPWhich SQL command is an example of data definition language (DDL)?The update would be rejected by the database. How would a database engine process an update that violates a RESTRICT referential integrity constraint?CREATE TABLE Member (
ID INT UNSIGNED,
FirstName VARCHAR(100), MiddleInitial CHAR(1), LastName VARCHAR(100), DateOfBirth DATE, AnnualPledge DECIMAL(8,2) UNSIGNED );
The Member table will have the following columns:
ID—positive integer FirstName—variable-length string with up to 100 characters MiddleInitial—fixed-length string with 1 character LastName—variable-length string with up to 100 characters DateOfBirth—date AnnualPledge—positive decimal value representing a cost of up to $999,999, with
- digits for cents
Write a SQL statement to create the Member table.
CREATE TABLE Movie( Title VARCHAR(30), RatingCode VARCHAR(5), FOREIGN KEY(RatingCode) REFERENCE Rating(RatingCode) );
The Rating table has the following columns:
RatingCode—variable-length string, primary key RatingDescription—variable-length string
The Movie table should have the following columns:
Title—variable-length string, maximum 30 characters RatingCode—variable-length string, maximum 5 characters Write a SQL statement to create the Movie table. Designate the RatingCode column in the Movie table as a foreign key to the RatingCode column in the Rating table.The underlying data must be periodically refreshed. Which restriction applies when using a materialized view?ALTER TABLE Movie ADD Score DECIMAL(3,1);
The Movie table has the following columns:
ID—integer, primary key Title—variable-length string Genre—variable-length string RatingCode—variable-length string Year—integer
A new column must be added to the Movie table:
Column name: Score
Data type: decimal(3,1)
Write a SQL statement to add the Score column to the Movie table.CREAT VIEW MyMovies AS SELECT Title, Genre, Year FROM Movie;
The Movie table has the following columns:
ID—integer, primary key Title—variable-length string Genre—variable-length string RatingCode—variable-length string Year—integer Write a SQL statement to create a view named MyMovies that contains the Title, Genre, and Year columns for all movies. Ensure your result set returns the columns in the order indicated.DROP VIEW MovieView;A database has a view named MovieView.Write a SQL statement to delete the view named MovieView from the database.ALTER TABLE Movie
ADD PRIMARY KEY(ID);
The Movie table has the following columns:
ID—integer Title—variable-length string Genre—variable-length string RatingCode—variable-length string Year—integer Write a SQL statement to modify the Movie table to make the ID column the primary key.
ALTER TABLE Movie ADD FOREIGN KEY(Year) REFERENCES YearStats(Year);
The Movie table has the following columns:
ID—integer, primary key Title—variable-length string Genre—variable-length string RatingCode—variable-length string Year—integer
The YearStats table has the following columns:
Year—integer TotalGross—bigint unsigned Releases—integer Write a SQL statement to designate the Year column in the Movie table as a foreign key to the Year column in the YearStats table.CREATE VIEW idx_year ON Movie(Year);
The Movie table has the following columns:
ID—integer, primary key Title—variable-length string Genre—variable-length string RatingCode—variable-length string Year—integer Write a SQL statement to create an index named idx_year on the Year column of the Movie table INSERT INTO Movie(Title, Genre, RatingCode,Year) VALUES('Pride and Prejudice', 'Romance', 'G', '2005')'
The Movie table has the following columns:
ID—integer, primary key, auto-increment Title—variable-length string Genre—variable-length string RatingCode—variable-length string Year—integer
The following data needs to be added to the Movie table:
TitleGenreRatingCodeYearPride and PrejudiceRomanceG2005 Write a SQL statement to insert the indicated data into the Movie table.DELETE FROM Movie
WHERE ID='3';
The Movie table has the following columns:
ID—integer, primary key Title—variable-length string Genre—variable-length string RatingCode—variable-length string Year—integer Write a SQL statement to delete the row with the ID value of 3 from the Movie table.UPDATE Movie SET Year='2022' WHERE Year='2020'
The Movie table has the following columns:
ID—integer, primary key Title—variable-length string Genre—variable-length string RatingCode—variable-length string Year—integer Write a SQL statement to update the Year value to be 2022 for all movies with a Year value of 2020.
SELECT Title, Genre FROM Movie WHERE Year='2020' (Number 15)
The Movie table has the following columns:
ID—integer, primary key Title—variable-length string Genre—variable-length string RatingCode—variable-length string Year—integer Write a SQL query to retrieve the Title and Genre values for all records in the Movie table with a Year value of 2020. Ensure your result set returns the columns in the order indicated.
SELECT *
FROM Movie; The database contains a table named Movie.Write a SQL query to return all data from the Movie table without directly referencing any column names.Input to program SELECT Title FROM Movie ORDER BY Title ASC;
The Movie table has the following columns:
ID—integer, primary key Title—variable-length string Genre—variable-length string RatingCode—variable-length string Year—integer Write a SQL query to display all Title values in alphabetical order A–Z.SELECT DISTINCT(RatingCode) COUNT(*) AS RatingCodeCount FROM Movie GROUP BY Rating Code ASC, ORDER BY RatingCode ASC;
The Movie table has the following columns:
ID—integer, primary key Title—variable-length string Genre—variable-length string RatingCode—variable-length string Year—integer Write a SQL query to output the unique RatingCode values and the number of movies with each rating value from the Movie table as RatingCodeCount. Sort the results by the RatingCode in alphabetical order A–Z. Ensure your result set returns the columns in the order indicated.SELECT M.Title, A.Actor FROM Movie M LEFT JOIN Movie MB ON M.ID Actor A Which query illustrates performing an outer join of the Movie table with a different table?Only rows in Table A and B that share the join condition Assume there are two tables, A and B.Which rows will always be included in the result set if Table A is inner joined with Table B?