Database Administration Fundamentals (SF17SQL1001) – Day 8

We are almost done with the course. This means that we have one more day to learn new material and review all the material. Then we take care of our final (just another lab, but a tad longer).

In the meantime, we have covered how to CREATE and ALTER database objects — DATABASEs, SCHEMAs, TABLEs, VIEWs and COLUMNs.

CREATE object_type object_name
  [code_to_create_object]

DROP object_type object_name
  [code_to_drop_object]

ALTER object_type object_name
  ADD/DROP/ALTER object_type
  [code_to_alter_object]

Download the class notes for day 8.

Database Administration Fundamentals (SF17SQL1001) – Day 7

We are almost done with the course. We started to

  1. CREATE, DROP and ALTER database objects
  2. and INSERT and UPDATE values into tables.

We also covered how to create a table from another table — including `CREATE SELECT` also referred to as `CREATE TABLE AS` that T-SQL does not support.

Download the class notes for day 7.

Database Administration Fundamentals (SF17SQL1001) – Day 6

Last night, aside from INNER JOIN that allows us to retrieve all data shared by table1 and table2

SELECT field1, field2 ...
FROM table1         -- all data related to table2
INNNER JOIN table2  -- all data related to table1
  ON table1.fieldX = table2.fieldX;

we covered LEFT JOIN that allows us to retrieve data from table1 and any related data from table2

SELECT field1, field2 ...
FROM table1         -- all data
LEFT JOIN table2    -- corresponding data related to table1
  ON table1.fieldX = table2.fieldX;

and RIGHT JOIN that allows us to retrieve data from table2 and any related data from table1.

SELECT field1, field2 ...
FROM table1         -- corresponding data related to table2
RIGHT JOIN table2   -- all data
  ON table1.fieldX = table2.fieldX;

Download the class notes for day 6.

Database Administration Fundamentals (SF17SQL1001) – Day 5

We are 50% done with the course.

  1. Understanding core database concepts — lots of theory
  2. Creating database objects — next week
  3. Manipulating data — what we have done in the past two weeks

We have covered various T-SQL functions for strings and numbers. For example, we covered a way to capitalize the first character of a-single-word field or variable (@word declared as a VARCHAR(10) and initialized as 'tImE', in the example below).

DECLARE @word VARCHAR(10) = 'tImE';

PRINT CONCAT (
    UPPER(LEFT(@word, 1)),
    LOWER(SUBSTRING(@word, 2, LEN(@word)-1))
    );

You can download the 845-page PDF from Microsoft Docs for much more information.

Download the class notes for day 5.

Database Administration Fundamentals (SF17SQL1001) – Day 3

We started working with built-in functions.

“In information technology, the term function (pronounced FUHNK-shun) has a number of meanings. It’s taken from the Latin ‘functio’ — to perform.
1) In its most general use, a function is what a given entity does in being what it is.
2) In C language and other programming, a function is a named procedure that performs a distinct service. The language statement that requests the function is called a function call, Programming languages usually come with a compiler and a set of ‘canned’ functions that a programmer can specify by writing language statements. These provided functions are sometimes referred to as library routines. Some functions are self-sufficient and can return results to the requesting program without help. Other functions need to make requests of the operating system in order to perform their work.
3) In mathematics, a function is a relationship between two variables called the independent variable and the dependent variable. The dependent variable has at most one value for any specific value of the independent variable. A function is usually symbolized by a lowercase, italicized letter of the alphabet, followed by the independent variable in parentheses. For example, the expression y = f ( x ), read ‘y equals f of x,’ means that a dependent variable y is a function of the independent variable x, Functions are often graphed, and they usually appear as lines or curves on a coordinate plane.
4) In a hardware device, a function is one complete physical movement that has a discernible consequence relative to the device’s purposes. In a printer, for example, this might be a carriage return or a line feed.”

http://whatis.techtarget.com/definition/function

Download the class notes for day 3.

How Did Python Become A Data Science Powerhouse? – Coding Tech

Although I teach SQL, I recommend studying Python if you are interested in data analytics rather than using MATLAB or R.

Although Python is not a data science language, there are several libraries designed to analyze data in Python.

  1. Conda – package manager
  2. IPythonshell for interactive computing
  3. Jupyter – facility to write documentation
  4. NumPy – alternative to MATLAB
  5. pandas – graphical data analytics
  6. SciPy – scientific & technical computing

Database Administration Fundamentals (SF17SQL1001) – Day 2

Yesterday we covered how to import data from an external file into SQL Server (white paper).

We also covered how to retrieve (SELECT) data from one or multiple tables (JOIN).

SELECT table1.field1,
  table1.field2,
  table2.field1,
  table2.field2 ...
FROM table1
INNER/LEFT/RIGHT JOIN table2
  ON table1.common_field1 = table2.common_field1
    AND table1.common_field2 = table2.common_field2
INNER/LEFT/RIGHT JOIN table3
  ON table1.common_field1 = table3.common_field1
    AND table1.common_field2 = table3.common_field2 ...

Download the class notes for day 2.

Remember that next Monday the 4th is Labor Day and BMCC will be closed. Enjoy the holiday and we will meet back on Wednesday the 6th.

If you have any questions, do not hesitate to contact me via email or https://introtosql.slack.com/.

Database Administration Fundamentals (SF17SQL1001) – Day 1

Yesterday we had some “technical difficulties” with the SQL Server Express installation. At times, we can learn the hard way.

When installing SQL Server Express on your computer at home and work, make sure you are the user (administrator) of the server instance.

SQL Server Management Studio is simpler to install — no special configuration.

Download the class notes for day 1.

  • special thanks to Wise Owl for the videos

Free Technical Books & Magazines from TradePub & Mercury Magazines

As I have mentioned many times, you should know where to go when you need help in technology. Mercury Magazines and TradePub offer free technical magazines and books, but there is one catch. They ask for your job information — your email, where you work, how big the organization is and what you do. If you are okay giving out personal/job information, take advantage of this offer.

http://mercurymagazines.tradepub.com/category/information-technology/1207/

Note that this is not an advertisement, but simply me telling where you can get resources for free.