Creating sql statements

Assignment Help Data Structure & Algorithms
Reference no: EM1380251

Consider the following relational database schema:

CREATE TABLE ACCOUNTS
(
account_no char(12),
amount money,
CONSTRAINT PK_ACCOUNTS PRIMARY KEY(account_no)
)

CREATE TABLE PENDING_TRANSFERS
(
from_account_no char(12),
to_account_no char(12),
amount money,
CONSTRAINT PK_ PENDING_TRANSFERS PRIMARY KEY(from_account_no,
to_account_no),
CONSTRAINT FK_PENDING_TRANSFERS_FROM_ACCOUNT
FOREIGN KEY(from_account_no) REFERENCES ACCOUNTS(account_no),
CONSTRAINT FK_PENDING_TRANSFERS_TO_ACCOUNT
FOREIGN KEY(to_account_no) REFERENCES ACCOUNTS(account_no),
)

(a) Create three SQL statements: the 1st statement should add pending amounts to appropriate accounts, the second statement should subtract the pending amounts from appropriate accounts, and the third statement should delete the pending balance transfer information.

(b) Explain the dangers of the sequence of statements in part (a) above, in terms of what would happen in case the database server or SQL interface were to crash in between two of these three statements.

(c) Show how to remove the dangers you described in part (b).

Reference no: EM1380251

Questions Cloud

Explain the three types of relationships : Provide an example of a one to one relationship and an example of a many-to-many relationship in a newspaper, magazine, book, or everyday situation you encounter.
Creating an effective physical design : Class, do IT database designers necessary to understand data volumes and number of users of database in order to create an effective physical design?
Creating visual studio asp .net web site : Make a Visual Studio 2008 ASP .NET Web Site with 2-Web Forms. Add a DropDownList server control and a Label server control to 1st Web Form.
Powerpoint presentation with the focus on stress management : Assume you have been asked to help new students identify ways in which they can manage their time so that they can be successful in an online learning environment.
Creating sql statements : Create three SQL statements: the 1st statement should add pending amounts to appropriate accounts, the second statement should subtract the pending amounts from appropriate accounts,
Creating a home inventory database : Construct one query of your selection. Remember a query answers a question. As an example, list all household electronics that are greater in value than $200.
Object oriented approach versus the relational database : Supporters of object oriented databases list many benefits for using the object oriented approach versus the relational one.
Theory of charisma described as a double-edge sword : Why is the theory of charisma described as a double-edge sword and please identify a leader that used charisma in a negative manner
Question about database administration : Should the data administrator really be on the same level as the DBA, generally somewhat low in corporate hierarchy or should this person have an elevated level of importance?

Reviews

Write a Review

Data Structure & Algorithms Questions & Answers

  Explain binary tree by induction

Binary tree is full if all of its vertices have either zero or two children. Let Bn denote number of full binary trees with n vertices. Illustrate by induction (substitution) that Bn is 2 (n) .

  Function to swap all the left-right subtrees of binary tree

Write a function, swapSubTrees, that swaps all of the left and right subtrees of a binary tree. write a method singleParent, that returns the number of nodes in a binary tree that have only one child.

  Describe open source and proprietary databases

Describe open source and proprietary databases. What are some drawbacks and benefits of each type of database?

  Design algorithm to produce list of customers

Design an algorithm to produce a list of customers from the Glad Rags Clothing Company's customer master file. Each record on the customer master file contains the customer's number.

  Creating villian

Announce a new Villian called sharpay who has a wit of 24, a stealth of sixteen, and who has currently claimed three victims: Chad, Troy, and Gabriella.

  Generalize 2-3 algorithms for insert and delete

Generalize the 2-3 algorithms for INSERT and DELETE to K-J trees, where non-leaf vertices have between K and J children for fixed integers K >=2, and J>= 2K-1.

  Build b tree for the part table

Build B+ tree for the PART table with n = 6 pointers; illustrate how B+ tree expand (show several intermediate trees) and what final tree will look like.

  Question about character array

The 2-most important design issues that are specific to character string types are the given, Should strings be simply a special kind of character array or a primitive type?

  Algorithm to produce schedule for least completion time

What is the best order for sending people out, if one wants whole competition to be over as early as possible? More precisely, provide efficient algorithm which produces schedule whose completion time is as small as possible.

  Create algorithm which generates access control matrix

Create an algorithm which generates the access control matrix A for any given history matrix H of the Chinese Wall model.

  Computing time complexity of procedure

What is the time complexity of the procedure? If A[l .. r] = [24, 30, 09, 46, 15, 19, 29, 86,78], what is the output?

  Use of primitives helps remove ambiguities in algorithm

Explain the distinction between an ambiguity in a proposed algorithm and an ambiguity in the representation of an algorithm. Describe how the use of primitives helps remove ambiguities in an algorithm's representation.

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