Assignment: Migrating Flat File Data into Relational Tables
Outcomes addressed in this activity:
· Use a variety of methods to populate a database table with data.
· Examine the data placed into the table using SQL queries.
IT234-2: Explore Data Definition Language (DDL) statements to define the database structure or schema.
There are varieties of ways to get data inserted into a table. One way entails manual data entry through use of the Designer tools contained in Microsoft SQL Server Management Studio (SSMS). Another way involves importing the data from an Excel file. You will import the Movies flat file dataset into a temporary table in the Movies database. The data from the temporary table will then be migrated to the normalized tables using a provided data migration script. Use the import instructions document to accomplish this task.
After you have entered new data, you will query the table, based on specific data requested. You can leverage the revised database design diagram as a resource for this assignment. Download and use this diagram for your analysis.
Before completing the Assignment, please watch the Unit 5 videos covering facets associated with querying and data manipulation. Navigate to the Academic Tools area of this course and select Library then Required Readings to access your texts and videos.
Part 1: Establish a New Movies Database Instance
Create a new version of the Movies database called “Movies_DB” using the following SQL script:
· Movies_DB Database Creation Script
The following document provides instructions on executing the script in a Microsoft SQL Server Management Studio (SSMS) query window:
· Instructions for Establishing the Movies_DB Database
Part 2: Manually Populate the Normalized Tables
Incorporate the first record from the Movies flat file dataset into the normalized tables in the Movies database. Use the Designer tools from the Microsoft SQL Server Management Studio (SSMS) to accomplish this task. Instructions for the manual data entry are provided in the following document:
· Instructions for Manual Entry of Data Into the Movies_DB Database
Flat data file record that needs to be incorporated into the normalized database tables.
Only enter the first record from the flat file dataset manually.
Part 3: Import the Flat File Dataset into the Database
Follow the directions for establishing a temporary table called Movies_Import_Temp in the Movies_DB database. The instruction document and flat file dataset, which is a comma-separated values (CSV) file, are provided below.
· Instructions for Importing the Movies Flat File Dataset
· Flat File Dataset
Part 4: Migrate Data to the Normalized Tables Using a Migration Script
After the manual insertions are completed, migrate the remaining data contained in the Movies_Import_Temp table using the provided data migration script. The data migration script along with Instructions for executing it in a Microsoft SQL Server Management Studio (SSMS) query window are provided below.
· Instructions for Executing the Data Migration Script
· Data Migration Script
Briefly describe the purpose and function of the individual INSERT statements in the provided data migration script.
Part 5: Contrast Data Migration Techniques
Write one or more paragraphs contrasting the techniques (i.e., manual versus scripted) used to populate the normalized tables. Provide pros and cons for each technique.
Part 6: Use basic SELECT statement to retrieve data from tables in the Movies database.
Create SQL statements to retrieve data from the Movies Database for the following. Create screenshots to show each SQL query and the results of each query execution.
1. List all of the directors with the last name of “Coppola.”
The expected query output listing all directors with the last name of ‘Coppola’.
2. Show the last names of movie producers whose last names start with the letter M.
The expected query output showing the names of movie producers whose last names start with the letter M.
3. List all movie titles and ratings for movies with a rating greater than or equal to 8. Show the results in alphabetical order by movie title.
The expected query output listing all movie titles and ratings for movies with a rating greater than or equal to 8.
4. List all movie titles and ratings for movies with a rating between 5 and 6. Show the results in alphabetical order by movie title.
The expected query output listing all movie titles and ratings for movies with a rating between 5 and 6.
5. Show the producer records that do not have first name values. In other words, the first name value is NULL for these producer records. Present the results in alphabetical order.
The expected query output showing the producers that do not have first name values.
Microsoft SQL Server Express and SQL Server Management Studio (SSMS) MUST be installed to complete this Assignment.
Compose your Assignment in a Word document and be sure to identify yourself, your class, and unit Assignment at the top of your paper. Embed the screenshots of your SQL statements and confirmatory output (e.g., table structure definitions) into the Word document.