Build tables and populate them with data in your own

Assignment Help Other Subject
Reference no: EM133414688

In this and the following problems, you will use your student credentials to first create tables with and extract data from Redcat Shoes and then modify the data in those tables.

Because you are using your own database schema, you are not automatically connected to Redcat shoes. To retrieve data from the Redcat Shoes database the required syntax is to prefix table names with the database name. For example to access data in the Purchase table, you will specify it as "redcat.purchase".

Also remember that as you build tables and populate them with data in your own database schema, the tables and data remain unless you remove it. If you make a mistake or want to rerun your SQL you will need to remove tables. To do so use the Drop Table statement.

1. Enter your entire script below. Do not include statements to drop objects as your script will be executed against a clean schema. You may include select statements in sub queries in your insert statements, but do not include select queries that return records for display.

Create a new table (name it Purchase61) and insert into it the Purchase records of employee 61 that were made after Christmas in 2014 (i.e. between December 26, 2014 and December 31, 2014. (Use between. Use date format of 'yyyy-mm-dd')

Note: You will be working in your own workspace. To get access to tables in the Redcat database workspace, you will need to add a prefix, i.e. Redcat.Purchase.

2. Enter your entire script below. Do not include statements to drop objects as your script will be executed against a clean schema. You may include select statements in sub queries in your insert statements, but do not include select queries that return records for display.

Create a new table (name it PurchaseItem61) and insert into it the PurchaseItem records of employee 61 that were made after Christmas in 2014 (i.e. between December 26, 2014 and December 31, 2014. (Use between. Use date format of 'yyyy-mm-dd')

Note: You will be working in your own workspace. To get access to tables in the Redcat database workspace, you will need to add a prefix, i.e. Redcat.PurchaseItem.

3. Enter your entire script below. Do not include statements to drop objects as your script will be executed against a clean schema. You may include select statements in sub queries in your insert statements, but do not include select queries that return records for display.

In the previous problems you created two new tables, Purchase61 and PurchaseItem61. In this problem you are asked to delete records.

Delete from PurchaseItem61 the records for the manufacturer whose ID is 630.

4. Enter your entire script below. Do not include statements to drop objects as your script will be executed against a clean schema. You may include select statements in sub queries in your insert statements, but do not include select queries that return records for display.


Delete from Purchase61 the records for the manufacturer whose ID is 630.

5. Enter your entire script below. Do not include statements to drop objects as your script will be executed against a clean schema. You may include select statements in sub queries in your insert statements, but do not include select queries that return records for display.

6. Enter your entire script below. Do not include statements to drop objects as your script will be executed against a clean schema. You may include select statements in sub queries in your insert statements, but do not include select queries that return records for display.

In Chapter 5 you learned about the Alter statement to change the structure of tables in the database. In this problem use the Purchase61 and PurchaseItem61 tables that you created and modified in previous problems. In a previous problem you deleted records from the Purchase61 table and the PurchaseItem61 tables. By adding a foreign key constraint, you can simplify that process so that when purchase records are deleted, then the corresponding purchaseItem records are automatically deleted by the DBMS.

Alter the Purchase61 table and add PurchaseID as a primary key. Also alter the PurchaseItem61 table so that the PurchaseID is a foreign key constraint from Purchase61 table, including that when records are deleted in Purchase61 the corresponding records in PurchaseItem61 are also deleted.

Note: Do not delete any records, just configure the foreign key so that delete happens automatically.

Continue to use the Purchase61 and PurchaseItem61 tables that you created and modified in the previous problems.

Increase the shippping cost of every purchase from Manufacturers in Massachusetts ('MA') by 10%. Round your calculations to two decimal points.

Reference no: EM133414688

Questions Cloud

What element of national resilience appears : What element of national resilience appears to be the most in need of revision/re-enforcement and emphasis from your perspective?
Explain the relationship between mercy and justice : Explain the relationship between mercy and justice. Discuss the differences between teleological systems and deontological systems
Interview victim of sexual assault : Would it be difficult to avoid imposing your own judgment on the circumstances of the crime?
Explain the concept of disaster recovery-as-a-service : explain the concept of Disaster Recovery-as-a-Service (DRaaS). You should research this concept and provide the CEO a one page summary
Build tables and populate them with data in your own : Build tables and populate them with data in your own database schema, the tables and data remain unless you remove it
How it improves the health and reverses : how it improves the health and reverses the several hazardous health conditions. The Netflix game changers and fork over knives documentaries are good examples
Why did these police officers enforce the law : According to Westley. where and why did these police officers enforce the law? Do you think that fair to all involved? Why?
Develop a 3-4 page preliminary care coordination plan : Develop a 3-4 page preliminary care coordination plan for a selected health care problem. Include physical, psychosocial, and cultural considerations
Procedure in deliberate attempt to circumvent miranda : Warn later procedure condemned in Missouri v. Seibert involved a police department that used the procedure in a deliberate attempt to circumvent Miranda

Reviews

Write a Review

Other Subject Questions & Answers

  Cross-cultural opportunities and conflicts in canada

Short Paper on Cross-cultural Opportunities and Conflicts in Canada.

  Sociology theory questions

Sociology are very fundamental in nature. Role strain and role constraint speak about the duties and responsibilities of the roles of people in society or in a group. A short theory about Darwin and Moths is also answered.

  A book review on unfaithful angels

This review will help the reader understand the social work profession through different concepts giving the glimpse of why the social work profession might have drifted away from its original purpose of serving the poor.

  Disorder paper: schizophrenia

Schizophrenia does not really have just one single cause. It is a possibility that this disorder could be inherited but not all doctors are sure.

  Individual assignment: two models handout and rubric

Individual Assignment : Two Models Handout and Rubric,    This paper will allow you to understand and evaluate two vastly different organizational models and to effectively communicate their differences.

  Developing strategic intent for toyota

The following report includes the description about the organization, its strategies, industry analysis in which it operates and its position in the industry.

  Gasoline powered passenger vehicles

In this study, we examine how gasoline price volatility and income of the consumers impacts consumer's demand for gasoline.

  An aspect of poverty in canada

Economics thesis undergrad 4th year paper to write. it should be about 22 pages in length, literature review, economic analysis and then data or cost benefit analysis.

  Ngn customer satisfaction qos indicator for 3g services

The paper aims to highlight the global trends in countries and regions where 3G has already been introduced and propose an implementation plan to the telecom operators of developing countries.

  Prepare a power point presentation

Prepare the power point presentation for the case: Santa Fe Independent School District

  Information literacy is important in this environment

Information literacy is critically important in this contemporary environment

  Associative property of multiplication

Write a definition for associative property of multiplication.

Free Assignment Quote

Assured A++ Grade

Get guaranteed satisfaction & time on delivery in every assignment order you paid with us! We ensure premium quality solution document along with free turntin report!

All rights reserved! Copyrights ©2019-2020 ExpertsMind IT Educational Pvt Ltd