Skip to content

jmathtech/sql-language

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

23 Commits
 
 
 
 
 
 

Repository files navigation

SQL language

SQL language code here.

Example of Left, Right, Full Outer Join statements

SELECT a.*, b.*

    FROM sec1413_fruits a
    
    LEFT OUTER JOIN sec1413_colors b -- Left outer join statement collects data from 'sec1413_colors b' of rows to the right side column so that it matches with the data on the left side of the table.
    
    ON a.f_num = b.c_num
    
    UNION

SELECT a.*, b.*

    FROM sec1413_fruits a

    RIGHT OUTER JOIN sec1413_colors b -- Right outer join statement collects data from 'sec1413_colors b' of rows to the left side column so that it matches with the data on the right side of the table.
    
    ON a.f_num = b.c_num;

image

Example of using a Substring (SUBSTR) to concatenate names

SELECT employee_id,

    last_name || ' ' || SUBSTR(first_name, 1, 1) AS full_name -- NOTE: SUBSTR can extract strings from a variable string (such as a person, place or thing).
    -- (1 - starting position, 1 - means the length of the character)
    
FROM l_employees;

image

About

All sql language data from class goes here.

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published