Answer to Question #204006 in Databases | SQL | Oracle | MS Access for TALHA AFZAL

Question #204006

ORACLE transaction is a logical unit of work which contains one or more than one SQL commands. It is an atomic unit which means that all SQL commands in the transaction can be either committed (Done) or rolled back (Undone).

Accounts:

Ac_Ttile  Ac_Number Ac_Type Balance 



You are required to write PL/SQL code for an ORACLE transaction on Accounts table (given above) containing the following SQL commands. 

  • INSERT (ADD) a new account having title as “Waqar Hassan” , account number 2025660 ,account type   as “Current” and balance 1000. 
  • DELETE an already existing account having account number 2025665 .
1
Expert's answer
2021-06-07T01:58:50-0400
-- Table: public.Account

-- DROP TABLE public."Account";

CREATE TABLE public."Account"
(
    "Ac_Ttile" "char"[] NOT NULL,
    "Ac_Type" "char"[] NOT NULL,
    "AccountNumber" integer[] NOT NULL,
    "Balance" "char" NOT NULL,
    CONSTRAINT "Account_pkey" PRIMARY KEY ("AccountNumber")
)

TABLESPACE pg_default;

ALTER TABLE public."Account"
    OWNER to postgres;
INSERT INTO public."Account"(
    "Ac_Ttile", "Ac_Type", "AccountNumber", "Balance")
    VALUES ("WaqarHassan","Current", 2025660,"1000");

DELETE FROM public."Account"
    WHERE AccountNumber=2025660;

Need a fast expert's response?

Submit order

and get a quick answer at the best price

for any assignment or question with DETAILED EXPLANATIONS!

Comments

No comments. Be the first!

Leave a comment

LATEST TUTORIALS
New on Blog
APPROVED BY CLIENTS