DATABASE SYSTEMS-MINDTAPV2.0
DATABASE SYSTEMS-MINDTAPV2.0
13th Edition
ISBN: 9780357427873
Author: Coronel
Publisher: CENGAGE L
Question
Book Icon
Chapter 10, Problem 6P

a)

Program Plan Intro

Transaction:

A transaction is a logical unit of work.

  • A sequence of process that must be completely completed or aborted.
  • Intermediate states are not acceptable in the process of transaction.
  • To make a transaction use a keyword “BEGIN TRANSACTION;”, insert SQL queries and commit the transaction.

Syntax for “TRANSACTION”:

BEGIN {TRANSACTION|TRAN};

SQL queries;

COMMIT;

“insert” query:

The INSERT command in SQL is employed to add records to an existing table. INSERT will increase the number of rows in a table.

Syntax for INSERT command:

INSERT INTO table_name VALUES (value1, value2…);

Example:

INSERT INTO employee VALUES(101, ‘Smith’,10);

“update” query:

The UPDATE command is employed to update information present in a table.

It is always used with SET keyword either in bulk or individually. UPDATE will not increase the number of rows in a table.

Syntax for UPDATE command:

UPDATE table_name SET column_name1 = value WHERE some_condition;

Example:

UPDATE employee SET name= ‘Presil’ age= 24 WHERE id=115;

b)

Explanation of Solution

Program plan:

The following SQL query is to make a customer payment for a customer “10010” of “$100” in cash using the payment ID “3428”.

  • Begin the transaction.
    • Insert the appropriate values into “payments” table using “insert” query.
    • Update the customer details to reduce the customer balance by “100” for the customer “10010” using “update” query...

Blurred answer
Students have asked these similar questions
How to develop a C program that receives the message sent by the provided program and displays the name and email included in the message on the screen?Here is the code of the program that sends the message for reference: typedef struct {    long tipo;    struct {        char nome[50];        char email[40];    } dados;} MsgStruct; int main() {    int msg_id, status;    msg_id = msgget(1000, 0600 | IPC_CREAT);    exit_on_error(msg_id, "Creation/Connection");    MsgStruct msg;    msg.tipo = 5;    strcpy(msg.dados.nome, "Pedro Silva");    strcpy(msg.dados.email, "pedro@sapo.pt");    status = msgsnd(msg_id, &msg, sizeof(msg.dados), 0);    exit_on_error(status, "Send");    printf("Message sent!\n");}
9. Let L₁=L(ab*aa), L₂=L(a*bba*). Find a regular expression for (L₁ UL2)*L2. 10. Show that the language is not regular. L= {a":n≥1} 11. Show a derivation tree for the string aabbbb with the grammar S→ABλ, A→aB, B→Sb. Give a verbal description of the language generated by this grammar.
14. Show that the language L= {wna (w) < Nь (w) < Nc (w)} is not context free.
Knowledge Booster
Background pattern image
Similar questions
SEE MORE QUESTIONS
Recommended textbooks for you
Text book image
Database Systems: Design, Implementation, & Manag...
Computer Science
ISBN:9781305627482
Author:Carlos Coronel, Steven Morris
Publisher:Cengage Learning
Text book image
Database Systems: Design, Implementation, & Manag...
Computer Science
ISBN:9781285196145
Author:Steven, Steven Morris, Carlos Coronel, Carlos, Coronel, Carlos; Morris, Carlos Coronel and Steven Morris, Carlos Coronel; Steven Morris, Steven Morris; Carlos Coronel
Publisher:Cengage Learning
Text book image
A Guide to SQL
Computer Science
ISBN:9781111527273
Author:Philip J. Pratt
Publisher:Course Technology Ptr