• Using Data Manipulation Function

    Issue with function is that they tend to be DBMS specific. Only few are supported by all popular DBMS. Although function is the same the implementations is not. Therefore they are not portable.

    Portable: Code that is written so that it will run on multiple systems.

    So if we decide to use functions, we need to make sure to comment code well.

    Most of SQL Implementations support the following types of functions:

    - Text func…

    • Sun, Mar 17 2013
  • SQL Creating Calculated Fields

    Field It really mean the same thing as column, although database columns are typically called columns and the term fields is normally used in conjunction with calculated fields.

    Concatenating Fields

    Concatenate Joining values together to form a single long value Depending witch DBMS you are using, this can be a plus sign (+) or two pipes (II)

    SELECT vend_name + ‘ (‘ + vend_country + ‘) ‘

    FROM Vendors

    ORDER BY vend_name

    Lesson7-1

    To return…

    • Tue, Dec 11 2012
  • SQL Wildcard Filtering

    Wildcards – Special characters used to mach parts of a value.

    Search Pattern -  A search condition made up of literal text, wildcards characters, or any combination of the two.

     

    The Percent Sing (%) Wildcard

    it means to mach any number of occurrences of any character. So we going to find all products that starts with the word Rabbit

    SELECT prod_id, prod_name

    FROM Products

    WHERE  prod_name LIKE ‘Rabbit%’;

    Lesson6-1

    So the DBMS retrieved all…

    • Wed, Nov 28 2012
  • SQL Advanced Data Filtering updated

    Here I show you how to combine WHERE clauses to create very efficient search conditions. Also we will be using Not and In operators.

    Combining WHERE Clauses

    Operator: A special keyword used to join or change clauses within a WHERE clause.  Can be called as logical operators as well.

    Using the AND Operator

    SELECT prod_id, prod_price, prod_name

    FROM Products

    WHERE vend_id = ‘DLL01’ AND prod_price <=4;

    Lesson5-1

    So the DBMS has retrieved…

    • Fri, Nov 23 2012
  • SQL Advanced Data Filtering

    Here I’ll show you how to combine WHERE clause so you can create more complex search conditions.

    Also we will see NOT and IN operators in action.

    Operator:  also know as Logical operator, used to join or change clauses within a WHERE clause.

     

    If we want to filter by more than one column, than we use AND operator.

    Using AND operator:

    AND : is keyword used in WHERE clause so DBMS retrieve only rows matching desired conditions…

    • Sat, Sep 8 2012
  • SQL Filtering Data

    Here I’ll show you how to use SELECT’s statement’s WHERE clause to specify search conditions.

    SELECT prod_name, prod_price

    FROM Products

    WHERE prod_price = 3.49;

    SQLSelect8

    So DBMS retrieved only rows with prod_price value of 3.49

    WHERE Clause Operators:

     

    OPERATOR

    DESCRIPTION

    =

    Equality

    <>

    Nonequality

    !=

    Nonequality

    <

    Less than

    <=

    Less than or equal to

    !<

    Not less than

    >

    Greater than

    >=

    Greater or…

    • Tue, Aug 28 2012
  • SQL Sorting Retrieved Data

    Here I’ll show you how to use the SELECT statement's ORDER BY clause to sort retrieved data as needed.

    Sorting by SINGLE column:

    SELECT prod_name

    FROM Products

    ORDER BY prod_name;

    SQLSelect5So the DMS has retrieved data and sort them alphabetically.

    Sorting by MULTIPLE columns:

    SELECT prod_id, prod_price, prod_name

    FROM Products

    ORDER BY prod_price, prod_name;

    SQLSelect6So the DMS has retrieved three columns and sorted the results first by price…

    • Tue, Aug 28 2012
  • SQL Retrieving Data

    So this is where we star learning.  I have to mention that my sample database came with the book I bought. Is it very helpful and it will speed up your learning.

    Open your SQL Server 2012.  You can right click on your database and select new query witch will open window for you. I do it this way because I like to write everything myself because I learn it faster.

    SQLSelect1

    Than we start with simple statement to retrieve single column…

    • Tue, Aug 28 2012
  • SQL Basics

    Here is some basic terminology used in SQL.

    SQL: Structured Query Language.

    Database: A container to store organized data.

    Table: A structured list of data of a specific type.

    Schema: Information about database and table layout and properties.

    Datatype: A type of allowed data. Every table column has an associated datatype that restricts ( or allows) specific data in that column.

    Column:  A single field in a table. All tables…

    • Tue, Aug 28 2012
  • How to start with SQL

    If you going to learn SQL you will need database management program. You can download SQL Server 2012 from here :

    http://technet.microsoft.com/en-gb/evalcenter

    Install and you are ready to go.

    • Mon, Aug 20 2012
  • At the beginning of a journey. . .

    Yes, indeed I am and looking forward to it.  In the end there is System Center 2012 Configuration Manager.

    To help me I have some companions with me:

    books1bookssams-teach-yourself-sql-in-10-minutes-3e

    Books are lovely. Very happy with them. Just the SCCM2012 is on the way by images

    And of course nothing of this would be possible without my mentor Rob.

    So good start, loads of good stuff ahead of me, happy days Smile

    • Sat, Aug 11 2012