Results 1 to 2 of 2
  1. #1
    Join Date
    Nov 2008
    Posts
    1

    Red face Unanswered: help with grant and view problem!!

    please help!!i does not know know write grant and view for the sql scripts

    this is the table i create
    CREATE TABLE EMPLOYEE(
    E# NUMBER(12) NOT NULL,
    L# NUMBER(8) NOT NULL,
    STATUS VARCHAR(10) NOT NULL,
    CONSTRAINT EMPLOYEE_PKEY PRIMARY KEY(E#),
    CONSTRAINT EMPLOYEE_UNIQUE UNIQUE(L#),
    CONSTRAINT EMPLOYEE_FKEY FOREIGN KEY(E#) REFERENCES BOSS(E#),
    CONSTRAINT EMPLOYEE_STATUS CHECK ( STATUS IN ('AVAILABLE', 'ON LEAVE', 'NOT AVAILABLE')) );

    CREATE TABLE WORKS(
    W# NUMBER(10) NOT NULL,
    L# NUMBER(8) NOT NULL,
    REG# VARCHAR(10) NOT NULL,
    WORK_DATE DATE NOT NULL,
    CONSTRAINT WORK_PKEY PRIMARY KEY (T#),
    CONSTRAINT WORK_FKEY1 FOREIGN KEY (L#) REFERENCES DRIVER(L#)



    but i struck in this 2 problems...
    i try but i not able to grant leave and update for first want and create intermediate views, display conents for second want
    please help!!!thank so much!!

    1)(implement sql scripts)
    Grant a leave to a employee that performed the largest number of workload so far.

    Create and load data into table TRIP that contains information (T#, L#, REG#, DATE) about the trips that have more than 2 workers and at least one workers starts (DEPARTURE) or ends (DESTINATION) in midnight. Display the contents of the table TRIP.

    Add a column TOTALTRIPS to a the table EMPLOYEE. Update EMPLOYEE such that a column TOTALTRIPS contains total number of trips performed by the respective employee. Display the columns L# and TOTALTRIPS after the update.




    2)(creates the relational views and list the contents of each view created)
    A view TWOWORKERS(T#,DEPARTURE,END,DESTINATION) should contain information about all trips that had exactly two workers,

    A view LASTWORKERS(T#,DEPARTURE,DESTINATION) should contain information about the last workers of each trip made in 2008. If a trip has only one worker then such worker is also considered as the last worker of the trip.

    (T# is trip number, DEPARTURE is the departuretime, END represents the time it end, and DESTINATION is the destinationtime)
    Last edited by munkmunk; 11-22-08 at 15:36.

  2. #2
    Join Date
    Jun 2004
    Location
    Liverpool, NY USA
    Posts
    2,509
    We will not spoon feed you your homework assignments, but we will help. Show us what you have tried all ready. And when they say grant a leave, they mean to give the person a leave.
    Bill
    You do not need a parachute to skydive. You only need a parachute to skydive twice.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •