Question 3 Given the file structure shown in Figure, answer Problems a – d. The figure has shown below. Assignment #1 Page 1 of 2 Introduction to Database Systems COMP112 a) How many records does the file contain? How many fields are there per record? b) What problem would you encounter if you wanted to produce a listing by city? How would you solve this problem by altering the file structure? c) If you wanted to produce a listing of the file contents by last name, area code, city, state, or zip code, how would you alter the file structure? d) What data redundancies do you detect? How could those redundancies lead to anomalies?
Question 3
Given the file structure shown in Figure, answer Problems a – d. The figure has shown below.
Assignment #1 Page 1 of 2
Introduction to
a) How many records does the file contain? How many fields are there per record?
b) What problem would you encounter if you wanted to produce a listing by city? How would you solve this problem by altering the file structure?
c) If you wanted to produce a listing of the file contents by last name, area code, city, state, or zip code, how would you alter the file structure?
d) What data redundancies do you detect? How could those redundancies lead to anomalies?
Question 4 :
Refer to the tables in the JustLee Books database, write the following basic statement. Each statement should be tested to ensure its validity.
-
Create a list of each book title stored in the BOOKS table and the category in which each book belongs. Reverse the sequence of the columns so that the category of each book is listed first.
-
Create a list of authors that displays the last name followed by the first name for each author. The last names and first names should be separated by a comma and a blank space.
-
List all information for each order item. Include an item total, which can be calculated by multiplying the Quantity and Paideach columns. Use a column alias for the calculated value to show the heading “Item Total” in the output.
-
Create a mailing list from the CUSTOMERS table. The mailing list should display the name, address, city, state, and zip code for each customer. Each customer’s name should be listed in order of last name followed by first name, separated with a comma, and have the column header “Name.” The city and state should be listed as one column of output, with the values separated by a comma and the column header “Location.”
-
To determine the percentage of profit for a particular item, subtract the item’s cost from the retail price to calculate the dollar amount of profit, and then divide the profit by the item’s cost. The solution is then multiplied by 100 to determine the profit percentage for each book. Use a SELECT statement to display each book’s title and percentage of profit. For the column displaying the percentage markup, use “Profit %” as the column heading.
Trending now
This is a popular solution!
Step by step
Solved in 2 steps