1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

database stuff

Discussion in 'Software' started by zxspectrum, Jan 7, 2009.

  1. zxspectrum

    zxspectrum Gigabyte Poster Premium Member

    1,666
    54
    139
    Ive got an exam next week and im struggling on database queries, and i was wondering if there would be a volunteer to have a look at these practice exam questons for me and give me their answers to see if im right or totally off the beaten track.

    Any help with be gratefuly appreciated and ill post them to you via PM

    Thanks

    ZX
     
    Certifications: BSc computing and information systems
    WIP: 70-680
  2. JonGlory

    JonGlory Byte Poster

    212
    6
    22
    Ill help if I can, not the greatest at sql, but enjoy it all the same.
     
    WIP: LIFE
  3. Fergal1982

    Fergal1982 Petabyte Poster

    4,196
    171
    211
    depends on the sql. post it up and see what people say about it.
     
    Certifications: ITIL Foundation; MCTS: Visual Studio Team Foundation Server 2010, Administration
    WIP: None at present
  4. zxspectrum

    zxspectrum Gigabyte Poster Premium Member

    1,666
    54
    139
    Here it is boys

    Thanks for your help

    ZX

    Imhaving trouble with this doc, ive scanned it and you need to open it in pdf, not word
     

    Attached Files:

    Certifications: BSc computing and information systems
    WIP: 70-680
  5. Fergal1982

    Fergal1982 Petabyte Poster

    4,196
    171
    211
    why dont you give us your answers and we will comment on them. You might want to make sure that you havent posted copyright material either.
     
    Certifications: ITIL Foundation; MCTS: Visual Studio Team Foundation Server 2010, Administration
    WIP: None at present
  6. hbroomhall

    hbroomhall Petabyte Poster Gold Member

    6,623
    115
    224
    Hm - a number of nasties in the question format. The major one being spaces in attribute names!

    I'd suggest the following to start with, but I would state that the exact syntax is a bit DB specific. In particular the quoting - the questions have specific capitalization, but the SQL standard does not.

    1) select "Last Name", "Employee Id" from "Employees" where "Department" = 'catering' and "Salary" > 10000;

    2) select "Last Name", "Employee Id", "Salary" from "Employees" order by "Salary" asc;

    3) select sum("Salary") from "Employees" natural join "Works" on "Employee Id" group by "Project";

    4) select "Last Name", "Employee Id", "Salary" from "Employees" natural join "Works" on "Employee Id" order by "Project Number";

    (Not certain about this last - not something I've often done, and needs a bit of testing)

    5) This one is a bit vague. I'm having to guess what is really required: select "Last Name", "Role", "Project Name" from select * from "Employees" natural join (select * from "Works" natural join "Project" on "Project Number" as a) on "Employee Id";

    That last one is *heavily* dependant on the syntax of the DB in question. Things like parentheses could be very different. And not every DB requires the 'as a' syntactic sugar.

    None of these have been tested - so there could be errors!

    Harry.
     
    Certifications: ECDL A+ Network+ i-Net+
    WIP: Server+
  7. JonGlory

    JonGlory Byte Poster

    212
    6
    22
    Q1. would be something like

    Select 'Last name' Employee_ID
    from employees
    where department = catering
    and salary > "10000";

    1 and 2 can be done without joins, the rest look like you will need to join the tables.

    Q3 you will need to count the salary and group by project


    Post what answers you have so far

    You should check out this site, has loads of examples

    http://www.w3schools.com/sql/default.asp

    http://www.w3schools.com/sql/default.asp
     
    WIP: LIFE
  8. zxspectrum

    zxspectrum Gigabyte Poster Premium Member

    1,666
    54
    139
    Well i know im near as im not far from what you have put down Harry, just wanted to see how far away i was, ill carry on and let you know how i get on

    Thanks again huys

    Zx
     
    Certifications: BSc computing and information systems
    WIP: 70-680
  9. hbroomhall

    hbroomhall Petabyte Poster Gold Member

    6,623
    115
    224
    Looking at my number 5) I see it suffers from the bottle of wine I have just finished....

    select "Last Name", "Role", "Project Name" from "Employees" natural join (select * from "Works" natural join "Project" on "Project Number" as a) on "Employee Id";

    I did say that it was only approximate!

    Harry
     
    Certifications: ECDL A+ Network+ i-Net+
    WIP: Server+
  10. Sharepointengine

    Sharepointengine Bit Poster

    10
    0
    2
    Depends on the sql.

    Position it positive as well as observe what did you say? community declare regarding it.
     
  11. supernova

    supernova Gigabyte Poster

    1,422
    21
    80
    This is basic ... i know easy for me to say, i used to be a software developer in the area of databases

    whats this for? what do you get after?

    At this level i would only expect ANSI SQL, otherwise it would state the plateform
     
    Certifications: Loads
    WIP: Lots

Share This Page

Loading...