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

  Business and professional communication

All companies have Transaction Processing Systems(TPS). TPS serve many functions including order entry, inventory control, payroll and others. Most TPS work with large amount of data on a daily basis. The data provides the basis for future strateg..

  Explain the value or constraint which you find with group

every group whether social or professional has roles that need to be filled in order for the group to function

  What are the most important elements of affordable care act

What are the most important elements of the Affordable Care Act in relation to community and public health? What is the role of the nurse in implementing this.

  How much should the ms grow to keep p constant

Assume money supply rule. Growth in Q is 5%; growth in V is 2%. How much should the MS grow to keep P constant?

  Describe principle of autonomy to the highest place

The four principles, especially in the context of bioethics in the United States, has often been critiqued for raising the principle of autonomy to the highest.

  Limited liability companies combine

Limited liability companies combine: A director of a corporation does NOT have a duty to: Which of the following has the highest priority for payment upon dissolution and winding up of a corporation?

  Main conversation is about sexual liberation

In a lot of so-called sex-positivity, the main conversation is about sexual liberation. How does this complication conflict with Marxism?

  Conduct a swot analysis of your care setting

Conduct a SWOT analysis of your care setting, with respect to quality and safety goals. Provide a narrative description of your analysis

  What questions are brought to your mind by the readings

What questions are brought to your mind by these readings? Can you go one step further and attempt to answer these questions, even if only hypothetically?

  Sentencing philosophies-models are created by legislatures

Sentencing philosophies and models are created by legislatures and imposed by courts. However, it falls to correctional agencies to administer the punishment

  How the state and local governments interact

How the state and local governments interact? How the power sharing takes place? How power sharing takes place between state and local governments through the ninth and tenth amendments?

  Hi does anyone help me to write a critical essay it is

hi does anyone help me to write a critical essay? it is about cultural anthropology and the question is does

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