Questions
Oz Company was started when it issued bonds with a $170,000 face value on January 1,...

Oz Company was started when it issued bonds with a $170,000 face value on January 1, 2016. The bonds were issued for cash at 99. Oz uses the straight-line method of amortization. They had a 20-year term to maturity and an 5 percent annual interest rate. Interest was payable on December 31 of each year. Oz Company immediately purchased land with the proceeds (cash received) from the bond issue. Oz leased the land for $10,625 cash per year. On January 1, 2019, the company sold the land for $169,300 cash. Immediately after the sale of the land, Oz redeemed the bonds at 100. Assume that no other accounting events occurred during 2019.


Required

Prepare an income statement, statement of changes in equity, balance sheet, and statement of cash flows for the 2016, 2017, 2018, and 2019 accounting periods. Assume that the company closes its books on December 31 of each year. Prepare the statements using a vertical statements format. (Hint: Record each year’s transactions in T-accounts prior to preparing the financial statements.) (Amounts to be deducted should be indicated with minus sign.)

OZ COMPANY

Income Statements

For the Year Ended December 31

2016

2017

2018

2019

Lease revenue

$10,625

$10,625

$10,625

$0

Interest expense

Operating income

$10,625

$10,625

$10,625

Non-Operating income/expense

Loss on bond redemption

Gain on sale of land

Net income(loss)

$10,625

$10,625

$10,625

$0

OZ COMPANY

Statement of Changes in Stockholders’ Equity

For the Year Ended December 31

2016

2017

2018

2019

Common stock

Net income(loss)

Total stockholders’ equity

OZ COMPANY

Balance Sheets

As of December 31

2016

2017

2018

2019

Assets

Total Assets

Liabilities

Total Liabilities

Stockholders’ equity

Total liabilities and stockholders’ equity

OZ COMPANY

Statements of Cash Flows

For the Year Ended December 31

2016

2017

2018

2019

Cash flows from operating activities:

Net cash flow from operating activities:

Cash flow from investing activities:

Net cash flow from investing activities

Cash flow from financing acttivities

Net cash flow from financing activities

Net change in cash

Ending cash balance

In: Accounting

This project should be completed using Excel (with formulas and linked data). Below are the deliverables:...

This project should be completed using Excel (with formulas and linked data). Below are the deliverables: 1. Prepare a Multi-Step Income Statement for the year ended 2018. This statement should be flexibly designed (formulas in cells). To the right of your dollars in this statement, show common-sized percentages based on sales (vertical analysis). 2. Show journal entries, adjusting entries and closing entries for the below additional information…none of the journal entries for 2018 have been posted to the ledger. 3. Prepare a Statement of Retained Earnings for the year ended 2018. This statement should be flexibly designed. 4. Prepare a Classified Balance Sheet dated Dec. 31, 2018. Again, a flexible design is required so any changes will automatically update the balance sheet. 5. Prepare a Statement of Cash Flows using the indirect method for the year ended 2018. The Statement of Cash Flows (operating section) should automatically change when assumptions are changed. Your Name, Inc. Balance Sheet 12/31/2017 Current Assets Cash $18,000 Marketable Securities (Short-term) 2,000 Accounts Receivable 14,000 Allowance for Bad Debt (2,000) Inventory 15,000 Prepaid Insurance 5,000 Total Current Assets $52,000 Property, Plant, and Equipment Land $30,000 Building 150,000 Accumulated Dep. – Building (45,000) Equipment 100,000 Accumulated Dep. - Equipment (20,000) Total PPE $215,000 Total Assets $267,000 Current Liabilities Accounts Payable $9,000 Unearned Revenue 3,000 Income Taxes Payable 3,000 Total Current Liabilities $15,000 Long-term Liabilities Bonds, 10%, due in 2021 $100,000 Equity Common Stock $ 50,000 (100,000 authorized, 50,000 issued) cont. Additional Pd.-in Capital 80,000 Retained Earnings not given (must be calc.) Total Equity $152,000 Total Liabilities & Equity $267,000 Additional Information (for all entries): 1. Sales for 2018 are $250,000. All sales are on credit. 2. Gross Margin/Profit ratio is 40 percent 3. Accounts Receivable: i. $180,000 of the accounts receivable is paid by the end of the year (the remaining balance remains on the balance sheet). ii. $3,000 of A/R is written off during the year. iii. 5% of Accounts Receivable (after write-off and collections) is considered to be uncollectible. 4. Inventory: i. Inventory purchases is $175,000, all on credit (the periodic method is used). ii. All accounts payable is from inventory purchases; all but $12,000 of inventory purchased is paid by the end of the year. 5. Additional equipment is purchased on 4/1/18 for $20,000 cash. All equipment when new, including the new purchase, has/had a five year life, no salvage value, and is depreciated using the straight-line method. 6. The building depreciates at $5,000 per year. 7. Half of the marketable securities were sold for $1,300. The FMV of the other half of the securities is also $1,300 and an adjustment to FMV is required. 8. Salaries are $2,100 per month (12 months of salaries expense must be booked). It is expected that one-half month will be owed on 12/31/18 because of when payday falls (therefore, 11.5 months of salaries have been paid and ½ month is still owed to the employees at year end). 9. $60,000 in cash is borrowed on 10/31/18 by issuing a Note Payable. Interest is 8% per year. 10. The bonds were sold at face value last December and pay interest on Dec. 31, 2018. 11. 10,000 additional shares of stock were sold for $4 a share (for EPS purposes, assume these shares were outstanding all year). 12. Insurance costing $20,000 was purchased on 7/1/18 (the same time in which the policy purchased in 2017 expired. The new policy was for 12 months). 13. On Dec. 31, 2018, 1000 shares of stock are repurchased from the market at $2.80/share (treasury stock). 14. The tax rate is 30 percent. Income taxes for the current year are due and therefore paid during the first two months of the next year (you will have to complete an entry to pay the 2017 taxes, however the 2018 taxes will not be paid until the end of January 2019). 15. Dividends of $4,000 were paid during 2018. 16. The unearned revenue has been earned during the year (classified as other revenue on the multi-step income stmt.). Required Labeled Sheets in Excel (all statements should be for 2018): 1. Data Sheet (the ending balances from 2017 – provided on the 2017 balance sheet) 2. Entries: Basic and Adjusting (you do not have to separate these entries) 3. Adjusted Trial Balance for 2018 (includes the posted amounts of all entries and adjusting entries) 4. Multi-step Income Statement 5. Retained Earnings Statement 6. Classified Balance Sheet 7. Cash Flow Statement (using the indirect method) 8. Post-Close Trial Balance for 2018 (include your closing entries above your post close trial balance)

Basic entries and adjusting entries and Multi-step Income Statement has been answered. Will require solutions for remaining 6 questions that will be Q 3, 5, 6, 7 and 8.

Thanks!

In: Accounting

1. Data on students in liberal arts colleges in the U.S. was collected, and the average...

1. Data on students in liberal arts colleges in the U.S. was collected, and the average cost per student was recorded for each school. The following five-number summary was calculated for this data set: minimum= $17,554; first quartile = $23,115; median = $26,668; third quartile = $45,879; maximum=$102,262.

WHEN TYPING CORRECT NUMERICAL ANSWER TYPE: 12,345 NOT 12345 or $12345 or $12,345

a. Calculate the Upper Fence

__________________

b. Using the definition of outlier discussed in your textbook, is the maximum an outlier (Yes/No)?

__________________

c. Calculate the Lower Fence

___________________

d. Using the definition of outlier discussed in your textbook, is the maximum an outlier (Yes/No)?

___________________

2.

Suppose an algebra professor found that the correlation (r) between study time (in hours) and exam score (out of 100) is +.80, and the regression line was found to be ExamScore = 20 + 4*HoursStudied. He arrived at this equation through years of collecting data on his students.

What is the explanatory variable?

What is the response variable?

Is there a positive relationship, a negative relationship or no relationship?

Is the relationship strong or weak?

What is the slope (type number):

What is the intercept (type number):

Predict the exam score for a student who studies 10 hours. (type number)

3.

The quantitative reasoning GRE scores are known to approximately have a Normal distribution with a mean of μ = 151 points and a standard deviation of σ = 8 points.  

FORMAT FOR PARTS 1-3: lowerbound, upperbound. using numbers as example:  5,10

1.  Use the Empirical Rule to specify the ranges into which 68% of test takers fall.

2. Use the Empirical Rule to specify the ranges into which 95% of test takers fall.

3. Use the Empirical Rule to specify the ranges into which 99.7% of test takers fall .

FOR ANSWERS 4-5 type number ONLY: for example if 10% just type 10

4.  What percentage of test takers score lower than 159?

5. What percentage of test takers scored between 135 and 151?

In: Statistics and Probability

Date Close 7/3/2017 898.700012 7/5/2017 911.710022 7/6/2017 906.690002 7/7/2017 918.590027 7/10/2017 928.799988 7/11/2017 930.090027 7/12/2017 943.830017...

Date Close
7/3/2017 898.700012
7/5/2017 911.710022
7/6/2017 906.690002
7/7/2017 918.590027
7/10/2017 928.799988
7/11/2017 930.090027
7/12/2017 943.830017
7/13/2017 947.159973
7/14/2017 955.98999
7/17/2017 953.419983
7/18/2017 965.400024
7/19/2017 970.890015
7/20/2017 968.150024
7/21/2017 972.919983
7/24/2017 980.340027
7/25/2017 950.700012
7/26/2017 947.799988
7/27/2017 934.090027
7/28/2017 941.530029
7/31/2017 930.5
8/1/2017 930.830017
8/2/2017 930.390015
8/3/2017 923.650024
8/4/2017 927.960022
8/7/2017 929.359985
8/8/2017 926.789978
8/9/2017 922.900024
8/10/2017 907.23999
8/11/2017 914.390015
8/14/2017 922.669983
8/15/2017 922.219971
8/16/2017 926.960022
8/17/2017 910.97998
8/18/2017 910.669983
8/21/2017 906.659973
8/22/2017 924.690002
8/23/2017 927
8/24/2017 921.280029
8/25/2017 915.890015
8/28/2017 913.809998
8/29/2017 921.289978
8/30/2017 929.570007
8/31/2017 939.330017
9/1/2017 937.340027
9/5/2017 928.450012
9/6/2017 927.809998
9/7/2017 935.950012
9/8/2017 926.5
9/11/2017 929.080017
9/12/2017 932.070007
9/13/2017 935.090027
9/14/2017 925.109985
9/15/2017 920.289978
9/18/2017 915
9/19/2017 921.809998
9/20/2017 931.580017
9/21/2017 932.450012
9/22/2017 928.530029
9/25/2017 920.969971
9/26/2017 924.859985
9/27/2017 944.48999
9/28/2017 949.5
9/29/2017 959.109985
10/2/2017 953.27002
10/3/2017 957.789978
10/4/2017 951.679993
10/5/2017 969.960022
10/6/2017 978.890015
10/9/2017 977
10/10/2017 972.599976
10/11/2017 989.25
10/12/2017 987.830017
10/13/2017 989.679993
10/16/2017 992
10/17/2017 992.179993
10/18/2017 992.809998
10/19/2017 984.450012
10/20/2017 988.200012
10/23/2017 968.450012
10/24/2017 970.539978
10/25/2017 973.330017
10/26/2017 972.559998
10/27/2017 1019.27002
10/30/2017 1017.109985
10/31/2017 1016.640015
11/1/2017 1025.5
11/2/2017 1025.579956
11/3/2017 1032.47998
11/6/2017 1025.900024
11/7/2017 1033.329956
11/8/2017 1039.849976
11/9/2017 1031.26001
11/10/2017 1028.069946
11/13/2017 1025.75
11/14/2017 1026
11/15/2017 1020.909973
11/16/2017 1032.5
11/17/2017 1019.090027
11/20/2017 1018.380005
11/21/2017 1034.48999
11/22/2017 1035.959961
11/24/2017 1040.609985
11/27/2017 1054.209961
11/28/2017 1047.410034
11/29/2017 1021.659973
11/30/2017 1021.409973
12/1/2017 1010.169983
12/4/2017 998.679993
12/5/2017 1005.150024
12/6/2017 1018.380005
12/7/2017 1030.930054
12/8/2017 1037.050049
12/11/2017 1041.099976
12/12/2017 1040.47998
12/13/2017 1040.609985
12/14/2017 1049.150024
12/15/2017 1064.189941
12/18/2017 1077.140015
12/19/2017 1070.680054
12/20/2017 1064.949951
12/21/2017 1063.630005
12/22/2017 1060.119995
12/26/2017 1056.73999
12/27/2017 1049.369995
12/28/2017 1048.140015
12/29/2017 1046.400024
1/2/2018 1065
1/3/2018 1082.47998
1/4/2018 1086.400024
1/5/2018 1102.22998
1/8/2018 1106.939941
1/9/2018 1106.26001
1/10/2018 1102.609985
1/11/2018 1105.52002
1/12/2018 1122.26001
1/16/2018 1121.76001
1/17/2018 1131.97998
1/18/2018 1129.790039
1/19/2018 1137.51001
1/22/2018 1155.810059
1/23/2018 1169.969971
1/24/2018 1164.23999
1/25/2018 1170.369995
1/26/2018 1175.839966
1/29/2018 1175.579956
1/30/2018 1163.689941
1/31/2018 1169.939941
2/1/2018 1167.699951
2/2/2018 1111.900024
2/5/2018 1055.800049
2/6/2018 1080.599976
2/7/2018 1048.579956
2/8/2018 1001.52002
2/9/2018 1037.780029
2/12/2018 1051.939941
2/13/2018 1052.099976
2/14/2018 1069.699951
2/15/2018 1089.52002
2/16/2018 1094.800049
2/20/2018 1102.459961
2/21/2018 1111.339966
2/22/2018 1106.630005
2/23/2018 1126.790039
2/26/2018 1143.75
2/27/2018 1118.290039
2/28/2018 1104.72998
3/1/2018 1069.52002
3/2/2018 1078.920044
3/5/2018 1090.930054
3/6/2018 1095.060059
3/7/2018 1109.640015
3/8/2018 1126
3/9/2018 1160.040039
3/12/2018 1164.5
3/13/2018 1138.170044
3/14/2018 1149.48999
3/15/2018 1149.579956
3/16/2018 1135.72998
3/19/2018 1099.819946
3/20/2018 1097.709961
3/21/2018 1090.880005
3/22/2018 1049.079956
3/23/2018 1021.570007
3/26/2018 1053.209961
3/27/2018 1005.099976
3/28/2018 1004.559998
3/29/2018 1031.790039
4/2/2018 1006.469971
4/3/2018 1013.409973
4/4/2018 1025.140015
4/5/2018 1027.810059
4/6/2018 1007.039978
4/9/2018 1015.450012
4/10/2018 1031.640015
4/11/2018 1019.969971
4/12/2018 1032.51001
4/13/2018 1029.27002
4/16/2018 1037.97998
4/17/2018 1074.160034
4/18/2018 1072.079956
4/19/2018 1087.699951
4/20/2018 1072.959961
4/23/2018 1067.449951
4/24/2018 1019.97998
4/25/2018 1021.179993
4/26/2018 1040.040039
4/27/2018 1030.050049
4/30/2018 1017.330017
5/1/2018 1037.310059
5/2/2018 1024.380005
5/3/2018 1023.719971
5/4/2018 1048.209961
5/7/2018 1054.790039
5/8/2018 1053.910034
5/9/2018 1082.76001
5/10/2018 1097.569946
5/11/2018 1098.26001
5/14/2018 1100.199951
5/15/2018 1079.22998
5/16/2018 1081.77002
5/17/2018 1078.589966
5/18/2018 1066.359985
5/21/2018 1079.579956
5/22/2018 1069.72998
5/23/2018 1079.689941
5/24/2018 1079.23999
5/25/2018 1075.660034
5/29/2018 1060.319946
5/30/2018 1067.800049
5/31/2018 1084.98999
6/1/2018 1119.5
6/4/2018 1139.290039
6/5/2018 1139.660034
6/6/2018 1136.880005
6/7/2018 1123.859985
6/8/2018 1120.869995
6/11/2018 1129.98999
6/12/2018 1139.319946
6/13/2018 1134.790039
6/14/2018 1152.119995
6/15/2018 1152.26001
6/18/2018 1173.459961
6/19/2018 1168.060059
6/20/2018 1169.839966
6/21/2018 1157.660034
6/22/2018 1155.47998
6/25/2018 1124.810059
6/26/2018 1118.459961
6/27/2018 1103.97998
6/28/2018 1114.219971
6/29/2018 1115.650024
7/2/2018 1127.459961

Project 3 instructions

Based on Larson & Farber: sections 5.2–5.3

Using the provided data. Assume that the closing prices of the stock form a normally distributed data set. This means that you need to use Excel to find the mean and standard deviation. Then, use those numbers and the methods you learned in sections 5.2–5.3 of the course textbook for normal distributions to answer the questions. Do NOT count the number of data points.

Complete this portion of the assignment within a single Excel file. Show your work or explain how you obtained each of your answers. Answers with no work and no explanation will receive no credit.

Show all work

1) If a person bought 1 share of Google stock within the last year, what is the probability that the stock on that day closed at less than the mean for that year? Hint: You do not want to calculate the mean to answer this one. The probability would be the same for any normal distribution. (5 points)

2) If a person bought 1 share of Google stock within the last year, what is the probability that the stock on that day closed at more than $825? (5 points)

3a) If a person bought 1 share of Google stock within the last year, what is the probability that the stock on that day closed within $50 of the mean for that year? (5 points)

3b) If a person bought 1 share of Google stock within the last year, what is the probability that the stock on that day closed at less than $700 per share. (5 points)

3c) At what prices would Google have to close in order for it to be considered statistically unusual? You will have a low and high value. Use the definition of unusual from the course textbook that is measured as a number of standard deviations. (5 points)

4) What are Quartile 1, Quartile 2, and Quartile 3 in this data set? Use Excel to find these values. This is the only question that you must answer without using anything about the normal distribution. (5 points)

5) Is the normality assumption that was made at the beginning valid? Why or why not? Hint: Does this distribution have the properties of a normal distribution as described in the course textbook? Real data sets are never perfect, however, it should be close. One option would be to construct a histogram like you did in Project 1 to see if it has the right shape. Something in the range of 10 to 12 classes is a good number. (5 points)

There are also 5 points for miscellaneous items like correct date range, correct mean, correct SD, etc.

In: Statistics and Probability

Subject - DataBase / MySQL * Which of the following is not correct about the statement...

Subject - DataBase / MySQL

* Which of the following is not correct about the statement provided?

SELECT Customer#, FirstName, LastName

FROM Customers C JOIN Orders O ON C.Customer# = O.Customer#

JOIN OrderItems OI ON O.Order# = OI.Order#

JOIN Books B ON OI.ISBN = B.ISBN

WHERE Category = 'Fitness' AND Category = 'Computers';

Select one:
a. Joins the OrderItems table to the Books table using the field ISBN
b. All of these are correct
c. Joins the Customer table to the Books table using Customer#
d. Joins the Customer table to the Orders table using the field Customer#
e. Joins the Orders table to the OrderItems table using the field Order#

* Which statement is NOT true about joining tables using an inner join?

Select one:
a. Only records that exist in both tables will be returned
b. The field names used to join must to be identical
c. The values in the fields used to join must be identical

* Which join type returns all possible combination of records, so that if a table that has 5 records is joined to a table with 3 records, 15 records are listed?

Select one:
a. Full join
b. Outer join
c. Inner join
d. Cross Join
e. Self-join

-THANK YOU

In: Computer Science

The schema for the Academics database is as follows. Understanding this schema is necessary to answer...

The schema for the Academics database is as follows. Understanding this schema is necessary to answer the questions in Part B.

DEPARTMENT(deptnum, descrip, instname, deptname, state, postcode) 
ACADEMIC(acnum, deptnum*, famname, givename, initials, title) 
PAPER(panum, title) 
AUTHOR(panum*, acnum*) 
FIELD(fieldnum, id, title) 
INTEREST(fieldnum*, acnum*, descrip) 

The semantics of most attributes are self-explanatory. For each relation, the primary key is underlined and any foreign keys are denoted by an asterisk (*). Some additional information for relations is given below:

  • DEPARTMENT: Each academic department (deptnum) belongs to an institution (instname).  
  • ACADEMIC: Each academic (acnum) belongs to one department (deptnum).  
  • AUTHOR: A paper (panum) may be written by more than one academic (acnum).  
  • FIELD: The relation describes research areas, where id is a classification code like B.1.1.  
  • INTEREST: The relation describes that an academic may have research interests in several fields (fieldnum), and provide description (descrip) of his/her research.

Question1 SQL

calculate the number of academics that have more than 10 papers?

Question 2 SQL

find the departments where at most 10 academics have more than 2 research fields, and display in alphabetical order the names of institutions and names of departments?

In: Computer Science

You are hired to design a database for a fitness center. As the fitness center is...

You are hired to design a database for a fitness center. As the fitness center is expanding with more than one branch, they want to create a database to keep track of its customers, facilities and employees. Each branch has a unique id and address (building number, street, district, and city). A branch may have more than one facility (e.g. swimming pool, spa, etc.). Each facility must belong to only one branch, and the information for a facility is name and fees. In addition, each fitness branch offers different classes (such as Yoga, Pilates, Zumba, etc.). All classes should be led by at most one trainer, who is an employee.

Employees must work at one and only one branch. Each employee has an id, name, address (building number, street, district, and city) and can have multiple phone numbers. An employee can only be an admin, managing the facility or working as a clerk, or a trainer. An employee cannot be a trainer and an admin because the trainer id compensated an hourly wage while an admin staff paid a monthly salary. Trainers can train individual customers at different time sessions.

A customer must register at one branch. Each customer has a membership number, name (stored as first name and last name), email, and only one phone number. A customer can join more than one class or uses any number of facilities. A customer may also decide to be trained by at most one personal trainer.


Given the above description: 1. Draw an ERD for the database, identifying the following: a. All the entities, attributes and relationships b. Primary key and (discriminator in weak entity, if any). Don’t forget each entity has to have PK. c. Participation and cardinality constraints. (Explain your choices for two constraints- i.e. identify the words the guided your decision) d. Specialization and completeness constraints (if there is an ISA relationship).

2. Write a schema for two entities and two relationships of your choice. Remember, sometimes a relationship is better not be represented in a separate schema; if this is the case with your chosen relationship explain what you will do.

In: Computer Science

You are hired to design a database for a fitness center. As the fitness center is...

You are hired to design a database for a fitness center. As the fitness center is expanding with more than one branch, they want to create a database to keep track of its customers, facilities and employees. Each branch has a unique id and address (building number, street, district, and city). A branch may have more than one facility (e.g. swimming pool, spa, etc.). Each facility must belong to only one branch, and the information for a facility is name and fees. In addition, each fitness branch offers different classes (such as Yoga, Pilates, Zumba, etc.). All classes should be led by at most one trainer, who is an employee.

Employees must work at one and only one branch. Each employee has an id, name, address (building number, street, district, and city) and can have multiple phone numbers. An employee can only be an admin, managing the facility or working as a clerk, or a trainer. An employee cannot be a trainer and an admin because the trainer id compensated an hourly wage while an admin staff paid a monthly salary. Trainers can train individual customers at different time sessions.

A customer must register at one branch. Each customer has a membership number, name (stored as first name and last name), email, and only one phone number. A customer can join more than one class or uses any number of facilities. A customer may also decide to be trained by at most one personal trainer.

Given the above description:

1. Draw a Chen's Notation ER Diagram for the database, identifying the following:

a.All the entities, attributes and relationships

b.Primary key and (discriminator in weak entity, if any). Don’t forget each entity has to have PK.

c.Participation and cardinality constraints. (Explain your choices for two constraints- i.e. identify the words the guided your decision)

d.Specialization and completeness constraints (if there is an ISA relationship).

2. Write a schema for two entities and two relationships of your choice. Remember, sometimes a relationship is better not be represented in a separate schema; if this is the case with your chosen relationship explain what you will do.

In: Computer Science

Create the Database: The data is the same as was described in the ER Design Project...

Create the Database:

The data is the same as was described in the ER Design Project assignment. In that assignment you were asked to map the ER diagram to relations in the database. Here is a formal description of the relations that you will use in this assignment:

streamTV Database Relations

shows(showID, title, premiere_year, network, creator, category)

episode(showID, episodeID, airdate, title)

  • showID is a foreign key to shows

actor(actID, fname, lname)

main_cast(showID, actorID, role)

  • showID is a foreign key to shows
  • actID is a foreign key to actor

recurring_cast(showID, episodeID, actorID, role)

  • showID is a foreign key to shows episodeID is a foreign key to episode
  • actID is a foreign key to actor

customer(custID, fname, lname, email, creditcard,membersince,renewaldate, password, username)

cust_queue(custID, showID, datequeued)

  • custID is a foreign key to customer
  • showID is a foreign key to shows

watched(custID, showID, episodeID, datewatched)

  • custID is a foreign key to customer
  • showID is a foreign key to shows
  • (showID, episodeID) is a foreign key to episode
  • (custID, showID) is a foreign key to cust_queue

Primary keys are in bold.

Question:

SQL Queries:

The management at streamTV needs to retrieve certain information about their the data in the database. Specify the SQL queries for the questions listed here:

1. Find the titles and premiere years of all shows that were created after 2005.

2. Find the number of episodes watched by each customer, sorted by customer last name.

3. Find the names and roles of all actors in the main cast of Friday Night Lights.

4. Find all actors who are in the main cast of at least one show and in the recurring cast of at least one show. Display the actor's first name, last name, the title of the show in which the actor is in the main cast, the title of the show in which the actors is in the recurring cast, and the role the actor plays in each show.

5. How many shows have episodes with the word "good" in the title.

6. List the show title, episode number, date and episode title for all of the shows with the word "good" in the title. Sort the list by airdate.

7. Which episodes that have been watched originally aired in 2005. Display the show title, the episode title and the original air date.

8. Display the names of all actors who have had recurring roles in shows on NBC. Include the name of the actor, the title of the show and the role.

9. A customer wants to add to her queue every show that Amy Poehler has appeared in. List all of these shows by title.

10. For each customer (display first and last name), display which show and episode was the first one watched by that customer. Sort the result by the customer's last name.

11. Find all shows that have more than 5 seasons. Display the title of the show, and the number of seasons. Sort the result by the number of seasons. Note that the first digit of each episode number represents the season number.

12. Find the titles of all shows that were not watched by any customers in August of 2013.


13. List the title of the show that has been watched the most by customers. Also display the number of times it has been watched.

14. For each show, list the number of customers who have that show in their queue. Display the show title and the number of customers. Sort by show title.

In: Computer Science

Consider the design of a database for a web site of a web site of videos...

Consider the design of a database for a web site of a web site of videos that teach people how to do things by yourself, such as house renovation. We will call videos as DIY videos. First, all registered users can post DIY questions, such as “how to paint a wall”. Each DIY question is identified by a question ID, the question itself, and a list of tags (each tag is a lower case word) to annotate the question, and the date the question is posted,. For example, for the question “how to paint a wall”, we can add the tags “wall, paint, roller, brush”. A registered user can also post a DIY video (from the existing video website) to an existing DIY question. Each video is identified by a unique URL (use the URL when you click the share button at the video website page, a title and a description of the video, the date on which the video is posted to your database system. A registered user can search for videos by typing a question (ideally, support fuzzy search since a user might not be able to type the exact phrase in a question), all relevant video links will be returned as a list so that a user can click any video link in the result list to play that video. Each registered user is identified by a unique username, which must be an email, a password, a first name, a last name, the gender, and his/her birthday. A registered user can give at most one review for each video, but on a particular day, the user can post at most three videos. The review given by a user has a score of {“Poor”, “Fair”, “Good”, “Excellent”} and then a short remark. A user can also modify an existing review as well as deleting an existing review. Each user has a private favorite list of DIY videos(called my favorite DIYs). Each user can insert or delete a DIY video from that favorite list. When each video is shown, the DIY question will also be shown beside the title of the video, so that a user can click it to see other videos for this DIY question. While a video is on display, there is a button under the video called “Add to my favorite DIYs” so that a user can easily add this video to his/her favorite DIYs. The system has a distinguished user called “root” whose username is root (this is the only username that is not an email).

- Draw an E-R diagram for the system, in particular, use arrows or thick lines to represent constraints appropriately. Write down your assumptions and justifications briefly and clearly.

- Translate the above E-R diagram into a relational model, i.e., write a set of CREATE TABLE statements. In particular, specify primary key, foreign key and other constraints whenever possible.

In: Computer Science