الانتقال إلى المحتوى

ارجو المساعدة في Pl/sql Assignment


samira-27

Recommended Posts

 

السلام عليكم ورحمة الله ..

انا طالبة مبتدئه في معهد للحاسب وجديدة ع المنتدى كنت احضر محاضرتكم و لم اكن عضوه

سجلت طمعا بمساعدتكم عندي هوموورك ورح يساعدني في رفع درجاتي هو بسيط لكن مو راضي يزبط معايا

ارجووو مساعدتكم ولكم خالص الدعاء..

السؤال كالتالي:

 PL/SQL Assignment

1. Clean up the database objects

 

2. Create three Tables

 Account: account_id, cust_id,amount,creation_date

 Customer:cust_id,cust_name,cust_mobile,cust_birthdate

 Employee: emp_id,emp_name

 

3. Create] stored procedures AccountDeleteCommand : which has as input num. This SP deletes the account number num

 AccountInsertCommand: which has as input account_id, cust_id,amount,creation_date. This SP

 inserts a new account

 AccountUpdateCommand: which has as input account_id, cust_id,amount,creation_date. This SP

 updates an account number num

 AccountSelectCommand : which has as input num and returns an account number num

 

4. Create a function

 AccountSelectAllCommand: which returns all accounts : creation of new type TABLE

 

5. Create a package bank which contain the already created stored procedures and function

 

6. Create Triggers (insert, update, delete), to maintain data integrity where check constraints would be ineffective.

 

 

رابط هذا التعليق
شارك

التفاعل في المنتدى ضعيف جدا , نصيحة متستنيش .

1- not clear to me .

2- google for " oracle sql create table statement " .

3 , 4 - you have to read about procedures and functions .

رابط هذا التعليق
شارك

التفاعل في المنتدى ضعيف جدا , نصيحة متستنيش .

1- not clear to me .

2- google for " oraclesql create table statement " .

3 , 4 - you have to read about procedures and functions .

شكرا لك ع الرد ما انا بحثت كثير مالقيت حل الا انو اسال ناس بروفشنال

ولسى عندي امل ان حد يساعدني 

رابط هذا التعليق
شارك

السلام عليكم ورحمة الله 

 

السؤال الثاني 

/*==============================================================*/
/* Table: ACCOUNT                                             */
/*==============================================================*/
CREATE TABLE ACCOUNT 
(
   ACCOUNT_ID         VARCHAR2(20)         NOT NULL,
   CUST_ID            NUMBER(10),
   AMOUNT             NUMBER(12,2),
   CREATION_DATE      DATE,
   CONSTRAINT PK_ACCOUNT PRIMARY KEY (ACCOUNT_ID)
);


/*==============================================================*/
/* Table: CUSTOMER                                            */
/*==============================================================*/
CREATE TABLE CUSTOMER 
(
   CUST_ID            NUMBER(10)           NOT NULL,
   CUST_NAME          VARCHAR2(60),
   CUST_MOBILE        NUMBER(10),
   CUST_BIRTHDATE     DATE,
   CONSTRAINT PK_CUSTOMER PRIMARY KEY (CUST_ID)
);


/*==============================================================*/
/* Table: EMPLOYEE                                            */
/*==============================================================*/
CREATE TABLE EMPLOYEE 
(
   EMP_ID             NUMBER(5)            NOT NULL,
   EMP_NAME           VARCHAR2(60),
   CONSTRAINT PK_EMPLOYEE PRIMARY KEY (EMP_ID)
);


ALTER TABLE ACCOUNT
   ADD CONSTRAINT FK_ACCOUNT_REFERENCE_CUSTOMER FOREIGN KEY (CUST_ID)
      REFERENCES CUSTOMER (CUST_ID);
رابط هذا التعليق
شارك

 

السلام عليكم ورحمة الله 

 

السؤال الثاني 

/*==============================================================*/
/* Table: ACCOUNT                                             */
/*==============================================================*/
CREATE TABLE ACCOUNT 
(
   ACCOUNT_ID         VARCHAR2(20)         NOT NULL,
   CUST_ID            NUMBER(10),
   AMOUNT             NUMBER(12,2),
   CREATION_DATE      DATE,
   CONSTRAINT PK_ACCOUNT PRIMARY KEY (ACCOUNT_ID)
);


/*==============================================================*/
/* Table: CUSTOMER                                            */
/*==============================================================*/
CREATE TABLE CUSTOMER 
(
   CUST_ID            NUMBER(10)           NOT NULL,
   CUST_NAME          VARCHAR2(60),
   CUST_MOBILE        NUMBER(10),
   CUST_BIRTHDATE     DATE,
   CONSTRAINT PK_CUSTOMER PRIMARY KEY (CUST_ID)
);


/*==============================================================*/
/* Table: EMPLOYEE                                            */
/*==============================================================*/
CREATE TABLE EMPLOYEE 
(
   EMP_ID             NUMBER(5)            NOT NULL,
   EMP_NAME           VARCHAR2(60),
   CONSTRAINT PK_EMPLOYEE PRIMARY KEY (EMP_ID)
);


ALTER TABLE ACCOUNT
   ADD CONSTRAINT FK_ACCOUNT_REFERENCE_CUSTOMER FOREIGN KEY (CUST_ID)
      REFERENCES CUSTOMER (CUST_ID);

الله يسعدك وشاكره لك لكن مشكلتي موانشاء الجداول الانشاء عملتو

وعلى كل حال اشكرك مره ثانيه ع الرد والله يرزقك من حيث لاتحتسب

رابط هذا التعليق
شارك

السلام عليكم ورحمة الله

 

السؤال الثالث ...

المطلوب الأول 

 

CREATE OR REPLACE PROCEDURE AccountDelete(account_number IN number)
IS
BEGIN

  DELETE Account where account_ID = account_number;
  
  COMMIT;

END;


Call from PL/SQL

exec AccountDelete(3);

المطلوب الثاني 

CREATE OR REPLACE PROCEDURE AccountInsert(
       p_account_id IN ACCOUNT.account_id%TYPE,
       p_cust_id IN ACCOUNT.cust_id%TYPE,
       p_creation_date IN ACCOUNT.creation_date%TYPE)
   
IS
BEGIN

  INSERT INTO ACCOUNT (account_id, cust_id, creation_date ) 
  VALUES (p_account_id, p_cust_id, p_creation_date);

  COMMIT;

END;


to call from pl-sql

begin
 AccountInsert(555,100,SYSDATE);
end;
رابط هذا التعليق
شارك

 

السلام عليكم ورحمة الله

 

السؤال الثالث ...

المطلوب الأول 

 

CREATE OR REPLACE PROCEDURE AccountDelete(account_number IN number)
IS
BEGIN

  DELETE Account where account_ID = account_number;
  
  COMMIT;

END;


Call from PL/SQL

exec AccountDelete(3);

المطلوب الثاني 

CREATE OR REPLACE PROCEDURE AccountInsert(
       p_account_id IN ACCOUNT.account_id%TYPE,
       p_cust_id IN ACCOUNT.cust_id%TYPE,
       p_creation_date IN ACCOUNT.creation_date%TYPE)
   
IS
BEGIN

  INSERT INTO ACCOUNT (account_id, cust_id, creation_date ) 
  VALUES (p_account_id, p_cust_id, p_creation_date);

  COMMIT;

END;


to call from pl-sql

begin
 AccountInsert(555,100,SYSDATE);
end;

بارك الله فيك وشكرا لتفاعلك ولكن مشكلتي هنا

Create a function

 AccountSelectAllCommand: which returns all accounts : creation of new type TABLE

 

5. Create a package bank which contain the already created stored procedures and function

 

6. Create Triggers (insert, update, delete), to maintain data integrity where check constraints would be ineffective

رابط هذا التعليق
شارك

انضم إلى المناقشة

يمكنك المشاركة الآن والتسجيل لاحقاً. إذا كان لديك حساب, سجل دخولك الآن لتقوم بالمشاركة من خلال حسابك.

زائر
أضف رد على هذا الموضوع...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   تمت استعادة المحتوى السابق الخاص بك.   مسح المحرر

×   You cannot paste images directly. Upload or insert images from URL.

جاري التحميل
×
×
  • أضف...

برجاء الإنتباه

بإستخدامك للموقع فأنت تتعهد بالموافقة على هذه البنود: سياسة الخصوصية