Hey there! Sign in to join this conversationNew here? Join for free
    • Thread Starter
    Offline

    2
    ReputationRep:
    Hi,

    Not so much advanced in SQL, am a newbie kinda , so plz explain as fully as possible plz. Sorry in advance if I've posted this thread in the wrong forum.

    plz see these PICs:

    "first" and "second" tables I'm supposed to have are given by:
    https://app.box.com/s/5a95bbb3hmquwrk4b7b7dzi1evz34loi

    I created these same exact tables:
    https://app.box.com/s/5a95bbb3hmquwrk4b7b7dzi1evz34loi
    https://app.box.com/s/2p01nzzht9i6jjzhf2dyvjk8nmsmcorb

    Now, the SQL query itself I do is:
    https://app.box.com/s/6n69eka4yu7tnijiazayk292hkm7iplf

    [Oh, and BTW, hovering my mouse over that cross in the red circle on the left of the middle line just tells me: Unrecognized statement type. (near ALL)]

    Running my SQL query then gives:
    https://app.box.com/s/u2ic9nph6wunilhiq6jsd9mwlbz4ke6s

    which sadly fails to match what they got:
    https://app.box.com/s/h9a5ot7goj8tdef6h7zt05pxf9y98mm5

    just can't see where exactly I'm going wrong - why???!! ((

    BIG thanks!
    • Thread Starter
    Offline

    2
    ReputationRep:
    WOW, OMG!!!

    I tried round brackets, so like (first) and (second). This worked PERFECTLY .

    Yet, square brackets had failed.

    Why these 2 observations:eek:? Any ideas?


    Also, aside from all this, may I just ask, is it really possible to make the name a table actually BEGIN with an upper-case letter? E.g. is it really possible to name a table as "First" instead of "first"? Or is it that the name strictly must be "first"?
    Offline

    21
    ReputationRep:
    SQL is not case sensitive so if you name a table "First", it is also called "firsT"
    • Thread Starter
    Offline

    2
    ReputationRep:
    (Original post by shawn_o1)
    SQL is not case sensitive so if you name a table "First", it is also called "firsT"
    yh true. but one thing I just don't get is how when I actually made the table, I seriously did name it as "First", but still it appears as if it got forced to be named as just "first":confused:
    • Thread Starter
    Offline

    2
    ReputationRep:
    why the sudden need now, just out of nowhere, for me to place round brackets around any table names I mention in the SQL queries I do that contain the UNION ALL keyword in? Why specifically they must be round brackets and not square brackets? kinda lost tbh:confused::eek::eek::eek:
    Offline

    21
    ReputationRep:
    now that depends on which SQL "dialect" you're using.
    • Thread Starter
    Offline

    2
    ReputationRep:
    (Original post by shawn_o1)
    now that depends on which SQL "dialect" you're using.
    SQL "dialect":eek::confused::eek::eek:. How to change the SQL "dialect" of some given table back to the normal one then?
    Offline

    21
    ReputationRep:
    (Original post by krisshP)
    SQL "dialect":eek::confused::eek::eek:. How to change the SQL "dialect" of some given table back to the normal one then?
    no, that's not what I'm talking about. Whether you're using Oracle PL/SQL, Transact-SQL (SQL Server), MySQL or PostgreSQL, they all employ SQL slightly differently. Know which one you're using and refer to the online manual
    • Thread Starter
    Offline

    2
    ReputationRep:
    (Original post by shawn_o1)
    no, that's not what I'm talking about. Whether you're using Oracle PL/SQL, Transact-SQL (SQL Server), MySQL or PostgreSQL, they all employ SQL slightly differently. Know which one you're using and refer to the online manual
    I'm pretty sure I've got MySQL here that I'm using. I got it from installing XAMPP.
    • Thread Starter
    Offline

    2
    ReputationRep:
    (Original post by shawn_o1)
    no, that's not what I'm talking about. Whether you're using Oracle PL/SQL, Transact-SQL (SQL Server), MySQL or PostgreSQL, they all employ SQL slightly differently. Know which one you're using and refer to the online manual
    Server: 127.0.0.1 via TCP/IP
    Server type: MariaDB
    Server version: 10.1.13-MariaDB - mariadb.org binary distribution

    This is version of MySQL I got here. I went to the top right hand side of the homepage of phpMyAdmin.

    EDIT: MySQL 5.7 it is
 
 
 
  • See more of what you like on The Student Room

    You can personalise what you see on TSR. Tell us a little about yourself to get started.

  • Poll
    Would you like to hibernate through the winter months?
  • See more of what you like on The Student Room

    You can personalise what you see on TSR. Tell us a little about yourself to get started.

  • The Student Room, Get Revising and Marked by Teachers are trading names of The Student Room Group Ltd.

    Register Number: 04666380 (England and Wales), VAT No. 806 8067 22 Registered Office: International House, Queens Road, Brighton, BN1 3XE

    Quick reply
    Reputation gems: You get these gems as you gain rep from other members for making good contributions and giving helpful advice.