Results 1 to 7 of 7
  1. #1
    Lawlington is offline Novice
    Windows 10 Access 2016
    Join Date
    May 2017
    Posts
    3

    SQL issues occurring on database project

    So I am trying to create queries using the SQL design view. I honestly haven't a clue if I am doing this right. This:


    Code:
    SELECT tblOperativesFROM tblOperatives
    SQL01All
    SQL02OnlyMe
    SQL03Fem
    SQL04PayG3
    SQL05Noc
    SQL06MI6Only
    SQL07CertOnly
    SQL08CertNone
    SQL09CertFem
    SQL10CertM
    SQL11LT75K
    SQL12Pay1&3
    SQL13Sal25to75
    SQL14LastNameS
    SQL15Yr09to14
    SQL16MayOnly
    SQL17HowMany
    SQL18JobRatio
    SQL19RatioLT50
    SQL20UpdateKS;
    And is producing syntax errors. Can someone please either help or direct me to resources specific to this particular type of query?

  2. #2
    June7's Avatar
    June7 is online now VIP
    Windows 7 64bit Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    53,644
    If you are using Access query Design View and pulled fields from tables down to the design grid, how in the world did you end up with that?
    How to attach file: http://www.accessforums.net/showthread.php?t=70301 To provide db: copy, remove confidential data, run compact & repair, zip w/Windows Compression.

  3. #3
    Lawlington is offline Novice
    Windows 10 Access 2016
    Join Date
    May 2017
    Posts
    3
    I dunno if I am using what you think I am, I am supposed to put all of the SQL queries that are listed up there into the database.

    How do I do it properly?

    WHat am I doing wrong?

  4. #4
    orange's Avatar
    orange is online now Moderator
    Windows 10 Access 2010 32bit
    Join Date
    Sep 2009
    Location
    Ottawa, Ontario, Canada; West Palm Beach FL
    Posts
    16,850
    How do I do it properly?

    WHat am I doing wrong?
    I don't think anyone can answer without knowing or better understanding what you are trying to do.

    Who assigned you this work? Did you have any questions for them?

    Can you tell us in 2 or 3 lines, WHAT are you trying to do?

  5. #5
    Lawlington is offline Novice
    Windows 10 Access 2016
    Join Date
    May 2017
    Posts
    3
    Apologies, I will be more clear, here is the actual spec sheet. The database in question is one that is basic, it has customer information and the like already entered and formatted.

    I asked questions to my instructors email and they have not responded, and it's getting rather close to deadline. I'm guessing this isn't too difficult, but the handouts I was given don't really help a whole lot.
    Code:
     
     
     
    Tasks:
    ·         Create the following queries using Microsoft’s SQL environment
    ·         MAKE A COPY of the SpyEmployee SINGLE-TABLE database that you created in project #01.
    ·         Rename the DATABASE name FROM its current name to the new name P3-Queries-SQL-YourName
    ·         Use the single table to create the following queries.
     
    ** When creating the queries, use ALL of the fields in the records except where stated.
    ** When saving the query, make all query names have a prefix of SQL followed by the number and name.
     
     
    NOTE: This is an exercise using SQL, DO NOT use the QBE for this assignment, 
    If you do, points will be deducted points from your final score for doing so.
     
     
    CREATE THE FOLLOWING QUERIES USING SQL NOT THE QBE
     
    
    Query Name DESCRIPTION SORT FIELD SORT Order
    SQL01All List ALL records in the table LastName DESC
    SQL02OnlyMe List ONLY YOUR record NONE NONE
    SQL03Fem List ONLY FEMALE employees Salary DESC
    SQL04PayG3 Pay Grade 3 employees ONLY Salary DESC
    SQL05Noc ONLY employees with a STATUS OF NOC LastName NONE
    SQL06MI6Only List ONLY MI6 agents LastName ASC
    SQL07CertOnly List ALL LTT employees LastName ASC
    SQL08CertNone List Non LTT employees LastName ASC
    SQL09CertFem List LTT FEMALEs only Salary DESC
    SQL10CertM List Non LTT MALES LastName ASC
    SQL11LT75K ONLY Yearly salaries < = $75,000.00 Salary DESC
    SQL12Pay1&3 Paygrade 1 and 3 Only Paygrade DESC
    SQL13Sal25to75 Salaries between $25,000 and $75,000 - INCLUSIVE Salary DESC
    SQL14LastNameS Only employees last name starts with the letter S LastName ASC
    SQL15Yr09to14 List ONLY employees with hire dates between 01/01/2009 and 12/31/2014 INCLUSIVE DATES HireDate ASC
    SQL16MayOnly Only Employees hired in MAY of ANY year HireDate ASC
    SQL17HowMany Calculate the number of clients you have [count] NONE NONE
    SQL18JobRatio Calculate job assignment to completion ratio Job ratio Desc
    SQL19RatioLT50 Calculate job assignment Ratio less than 50% Job ratio Desc
    SQL20UpdateKS Update Query-Keith Salmon TO Bugs Bunny NONE NONE
    · Once complete, submit your database via the project #03 submittal link on Blackboard.

  6. #6
    June7's Avatar
    June7 is online now VIP
    Windows 7 64bit Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    53,644
    Your instructor wants you to build 20 queries without using the QBE. Seems to want you to write them like writing with pen on paper instead of letting the wizard write it for you. Wants to make sure you have an understanding of SQL syntax. How they would determine you did or did not use the QBE is beyond me. Build in the QBE then switch to SQLView to see the statement.

    For an example, the first query named SQL01All could look like:
    SELECT * FROM tablenamehere ORDER BY LastName DESC;

    Another, the last query named SQL20UpdateKS, could look like:
    UPDATE tablenamehere SET fieldnamehere = "Bugs Bunny" WHERE fieldnamehere = "Keith Salmon"

    Has your instructor provided any guidance on SQL construction? This is an online course so you are really self-teaching?

    Review this tutorial https://fisher.osu.edu/~muhanna.1/83...s/qbe_intr.pdf

    Also this site https://www.w3schools.com/sql/
    Last edited by June7; 05-07-2017 at 11:42 AM.
    How to attach file: http://www.accessforums.net/showthread.php?t=70301 To provide db: copy, remove confidential data, run compact & repair, zip w/Windows Compression.

  7. #7
    orange's Avatar
    orange is online now Moderator
    Windows 10 Access 2010 32bit
    Join Date
    Sep 2009
    Location
    Ottawa, Ontario, Canada; West Palm Beach FL
    Posts
    16,850
    June's response is spot on. The instructions you have seem to be quite clear. There are several free tutorials/articles/videos about SQL available via Google/Bing,

Please reply to this thread with any new information or opinions.

Similar Threads

  1. Duplicate field occurring with autonumber
    By thebourboncowboy in forum Database Design
    Replies: 4
    Last Post: 12-28-2016, 10:51 AM
  2. ADP Project Issues with Access 2010
    By johnson8809 in forum Access
    Replies: 2
    Last Post: 12-15-2015, 06:22 AM
  3. Replies: 4
    Last Post: 10-31-2013, 12:43 PM
  4. Replies: 6
    Last Post: 07-23-2013, 09:30 AM
  5. Need Help DataBAse Project
    By GuiGui34 in forum Database Design
    Replies: 0
    Last Post: 12-11-2010, 06:32 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Other Forums: Microsoft Office Forums