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

  Explaining instruction format of operation code field

Operation code field, a mode field, to specify one of seven addressing modes, a register address field to specify one of 60 processor registers, and memory address. Specify instruction format and number of bits in each field if the instruction ..

  Converting arithmetic expression in reverse polish notation

Convert the following numerical arithmetic expression into reverse Polish notation and show the stack operations for evaluating the numerical result.

  Write algorithm using pseudo code consensus algorithm

Write an algorithm, using pseudo code, "Consensus algorithm": A group of ten people need to decide which one flavor of ice cream they will all order, out of three options.

  Effective address-addressing mode of instruction is direct

Evaluate the effective address if the addressing mode of the instruction is (a) direct; (b) immediate; (c) relative; (d) register indirect.

  Algorithm to minimize average difference between height

The problem is to assign each skier a ski to minimize the average difference between height of a skier and his/her ski. Give pseudocode and write its asymptotic running time.

  Describe open source and proprietary databases

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

  Creating a database with asp.net

Make a database with a table called "MyUsers" and "MyRole" The table should have the following columns.

  Implementing the banker algorithm

Prompt user to enter the size of matrix n and m. Your program should accept any n x m matrix and m vectors where n and m are positive integer less than ten.

  Find the checksum field in a single parity bit scheme

Assume that the information content of a packet is the bit pattern 1111000010100101 and an even parity is being used

  Designing and populating a course table

Use data to design and populate a course table. Designate the CourseID field as a Primary Key and permit your database to automatically produce a value for this field.

  Sketch flowchart for logic of program to enter three values

Sketch a flowchart or write psuedocode to represent logic of a program that alllows the user to enter three values .

  Create a program that reads product number and prices

The Rinky Dooflingy Corporation produces different kinds of doofingies, each identified b a product number. Create a program that reads product number and rates and stores these values in two arrays,

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