Transcript Slide 1

Wrapping up
What are a couple things to consider (as
discussed in class) with regards to insert
statements?
• If you do not specify the columns you are
inserting data into SQL expects there to be a
value for each column that exists in the table
• If you do not specify the columns SQL will
insert the first value listed into the first
column, the second value listed into the
second column, and so forth
Does anyone know what SQL Azure is?
Microsoft SQL Azure is a highly available, and scalable
cloud database service built on SQL Server
technologies. With SQL Azure, developers do not have
to install, setup, patch or manage any software. High
availability and fault tolerance is built-in and no
physical administration is required. Additionally,
developers can get productive on SQL Azure quickly by
using the same familiar T-SQL based relational model
and the same powerful development and management
tools used for on-premises databases (excerpt
retrieved from http://www.microsoft.com/enus/sqlazure/database.aspx)
SQL Azure Video
• http://www.microsoft.com/enus/sqlazure/videos.aspx?display=mms://wm.
microsoft.com/ms/Windowsazure/SQLAzure_
720x480_FINAL_101609.wmv
What do you know about “cloud”
technologies?
SQL Challenge #1
• Using EXISTS in your query, list the first and
last names of all owners who have a boat in a
40 foot slip.
SELECT
FIRST_NAME,
LAST_NAME
FROM
a_OWNER
WHERE
EXISTS
(
SELECT
*
FROM
a_MARINA_SLIP
WHERE
a_MARINA_SLIP.OWNER_NUM = a_OWNER.OWNER_NUM AND
LENGTH = 40
)
SQL Challenge #2
• Using IN in your query, list the first and last
names of all owners who have a boat in a 40
foot slip.
SELECT
FIRST_NAME,
LAST_NAME
FROM
a_OWNER
WHERE
OWNER_NUM IN
(
SELECT
OWNER_NUM
FROM
a_MARINA_SLIP
WHERE
LENGTH = 40
)
SQL Challenge #3
• Return owners’ first & last names and rental
fees. Be sure to return all owners, but only
rental fees that are greater than $2,000
select
first_name,
last_name,
rental_fee
from
a_owner o
left outer join
a_marina_slip ms on
ms.owner_num = o.owner_num and
ms.rental_fee > 2000