SQL is a Declarative Language??

Discussion in 'Website Development & Design' started by Fergal, Feb 13, 2012.

  1. Fergal

    Fergal
    uix_expand uix_collapse
    Premium Member
    Premium Member

    Joined:
    Nov 18, 2007
    Messages:
    10,575
    Likes Received:
    1,165
    I've read that SQL is a declarative rather than a procedural programming language. Could anyone please explain what is meant by a declarative programming language?

    Thanks!
     
  2. rebecca16

    rebecca16
    uix_expand uix_collapse
    Member

    Joined:
    Sep 22, 2009
    Messages:
    202
    Likes Received:
    3
    Declarative programming language is the one where the logic of a calculation is depicted with out control flow( IF, while, for statements etc). and to say sql is a declarative language is only partly true, subset of some queries are indeed declarative but all of the sql flavors have got strong procedural component where you can program by using control flow.
     
    • Like Like x 1
  3. cesspadilla

    cesspadilla
    uix_expand uix_collapse
    Active Member

    Joined:
    Sep 8, 2011
    Messages:
    705
    Likes Received:
    194
    Actually SQL is indeed a Declarative Programming Language.

    It is the counterpart of Imperative Programming which is described as specifying the steps the program must take to reach the desired state.

    In my understanding and experience, SQL is a database language. It is used to manage data in RDBMS. In programming it, you use declarative statement such as SELECT.

    e.g. Imperative Language:
    int total = 0;
    int number1 = 5;
    int number2 = 10;
    int number3 = 15;
    total = number1 + number2 + number3;

    e.g. Declarative Language:
    SELECT po_OrderID, p.LastName, p.FirstName
    FROM Persons AS p,
    Product_Orders AS po
    WHERE p.LastName='Crawley' AND p.FirstName='Fergal'
     
    • Like Like x 1
  4. Fergal

    Fergal
    uix_expand uix_collapse
    Premium Member
    Premium Member

    Joined:
    Nov 18, 2007
    Messages:
    10,575
    Likes Received:
    1,165
    Thanks for the info Rebecca and Haley, that is very informative. Are you programmers?
     
  5. cesspadilla

    cesspadilla
    uix_expand uix_collapse
    Active Member

    Joined:
    Sep 8, 2011
    Messages:
    705
    Likes Received:
    194
    I do have some experience in Programming. I am a Computer Science graduate. Although I admit that I'm not really familiar with SQL. I do have some minor programming projects in the company that I did OJT. Some programming languages I'm familiar with is ASP, Java and VB. The only database I've worked on was MS Access, since the data only requires a temporary login-logout tasks. Sadly, I haven't got a company to make money with my knowledge because most of them requires at least 1 year experience. ;P
     
  6. rebecca16

    rebecca16
    uix_expand uix_collapse
    Member

    Joined:
    Sep 22, 2009
    Messages:
    202
    Likes Received:
    3
    I was very much interested in creating websites, So I taught myself php,html, css and MySQL through web based tutorials and books.
     
  7. Fergal

    Fergal
    uix_expand uix_collapse
    Premium Member
    Premium Member

    Joined:
    Nov 18, 2007
    Messages:
    10,575
    Likes Received:
    1,165
    Well done, I'm currently doing a Higher Diploma in Science in Computing, Java and MySQL are subjects this semester. It's quite challenging and very time consuming but I'm enjoying it.

    Have you considered offering your services on a contract / freelance basis Haley?

    What country are you based in?

    Well done Rebecca, I hope that you have created some nice sites with your knowledge.
     
  8. michal26

    michal26
    uix_expand uix_collapse
    New Member

    Joined:
    Feb 15, 2012
    Messages:
    11
    Likes Received:
    0
    Declarative programming language is the one where the logic of a calculation is depicted with out control flow( Loop statements). and to say sql is a declarative language is only partly true, subset of some queries are indeed declarative but all of the sql flavors have got strong procedural component where you can program by using control flow.
     
  9. rebecca16

    rebecca16
    uix_expand uix_collapse
    Member

    Joined:
    Sep 22, 2009
    Messages:
    202
    Likes Received:
    3
    Well Fregal so far I have got my hand dirty by working on customizing other's websites, yet to start work on my 'dream' website. I hope I get some time in future to do that.
     
  10. Fergal

    Fergal
    uix_expand uix_collapse
    Premium Member
    Premium Member

    Joined:
    Nov 18, 2007
    Messages:
    10,575
    Likes Received:
    1,165
    The Fiverr site in your sig looks great Rebecca. Please send me a PM if you would like to be able to add links to your sig.

    Thanks for your reply Michal.
     
  11. rebecca16

    rebecca16
    uix_expand uix_collapse
    Member

    Joined:
    Sep 22, 2009
    Messages:
    202
    Likes Received:
    3
    Many thanks Fregal for your compliment. Surely will send you a PM soon.
     
  12. Sahil

    Sahil
    uix_expand uix_collapse
    Active Member

    Joined:
    Jun 26, 2009
    Messages:
    1,003
    Likes Received:
    45
    Where are you doing that? I mean in a University or any where Online?

    I'm very much interested in choosing Computer Science as career to accomplish my goals and to achieve my dreams also I'm very passionate in that.
     
  13. cesspadilla

    cesspadilla
    uix_expand uix_collapse
    Active Member

    Joined:
    Sep 8, 2011
    Messages:
    705
    Likes Received:
    194
    Wow! So glad that you're having fun. I not good at Java although I know the language... I'm far better off using Visual Basic. Haha! I want to know C++ though. It's similar to Java when it comes to coding but I haven't got the time to study it...

    No I haven't. I was sort of scared of having a freelance job that they might not pay me. So far I'm still an SEO hehe. Anyway, I was planning on taking a risk on freelance but I'm still thinking about it.
     
  14. Fergal

    Fergal
    uix_expand uix_collapse
    Premium Member
    Premium Member

    Joined:
    Nov 18, 2007
    Messages:
    10,575
    Likes Received:
    1,165
    Thanks for asking Sahil, I'm currently doing this course at my local college. You should go for it Sahil, your posts on this forum are a clear demonstration of your passion for the subject. You have also displayed a remarkable knowledge of IT and Internet related topics here, especially given your young age.

    Are you working full time as a SEO? Perhaps you could do some freelancing in your spare time, so there would be very little risk involved.
     
  15. cesspadilla

    cesspadilla
    uix_expand uix_collapse
    Active Member

    Joined:
    Sep 8, 2011
    Messages:
    705
    Likes Received:
    194
    Yes, I'm a full-time SEO. I sent a PM :)
     

Share This Page