Monday, August 26, 2013

Week Two Begins

Today we worked with SQL Server Management Studio and looked at working with a database at a somewhat lower level than we will be using from here on out.  We created some new tables and performed some of the basic CRUD functions.

Create
INSERT INTO <Table>(ID, Name, EmployeeNum)  VALUES (1, 'James', 23) 

Read
SELECT * FROM <Table>
WHERE Name='James'

SELECT * From <Table1> AS t1
JOIN <Table2> AS t2 ON t1.<field> = t2.<field>  

Update
UPDATE <Table> 
SET Name = 'Jamie' 
WHERE ID = 1

Delete
DELETE FROM <Table>
WHERE ID = 1

The JOIN above is what is known as an inner join and seems to be the most common type of join.  If the fields in the tables match then that row is included in the result set. Left Outer Join and Right Outer Join can also be used to join tables (among a few other ways). In say a left outer join the result set is similar to a normal inner join except that if no match is found in the second table then the row from the first table is still included in the results (every row from the left table is in the result set).  

Since we are using the code first approach we will not be spending much time on learning SQL. We also touched on transforming our data model classes from the code first approach into a database. And using Visual Studio's Package Manager Console to perform commands such as Enable-migrations, Add-migration, and update-database.  




Monday, August 19, 2013

Coder Camps Day 1

I've finished my first day at Coder Camps. It was fun meeting everyone in the troop and getting started on the path to becoming a jr web developer.  Our troop will be working on a crowd-funding web site over the next nine weeks. So, we started thinking about that and also touched on a few other things.  One being an overview of OOP concepts.  These included inheritance, polymorphism and encapsulation (data hiding). I'm looking forward to another great day tomorrow.