CSE 344 Section 3 [Srini] 1. Connecting to Azure and running - - PowerPoint PPT Presentation

cse 344 section 3 srini
SMART_READER_LITE
LIVE PREVIEW

CSE 344 Section 3 [Srini] 1. Connecting to Azure and running - - PowerPoint PPT Presentation

CSE 344 Section 3 [Srini] 1. Connecting to Azure and running queries 2. Nested Queries Connect to Azure Hostname: wsxq8lmids.database.windows.net Username: <your UW id> Password: <yourpass> Databases: master and IMDB


slide-1
SLIDE 1

CSE 344 Section 3 [Srini]

  • 1. Connecting to Azure and running queries
  • 2. Nested Queries
slide-2
SLIDE 2

Connect to Azure

  • Hostname: wsxq8lmids.database.windows.net
  • Username: <your UW id>
  • Password: <yourpass>
  • Databases: master and IMDB
slide-3
SLIDE 3

Connect using Web interface

  • Install Silverlite

  • http://www.microsoft.com/getsilverlight/Get-

Started/Install/Default.aspx

  • Visit https://wsxq8lmids.database.windows.net
  • Enter connection details to login
  • Change password by logging into the master db


ALTER LOGIN yourlogin WITH PASSWORD='some_new_password' OLD_PASSWORD

= ‘old_pass'

slide-4
SLIDE 4

Using SQL Management Studio

  • Use one of the lab windows machines OR connect

to a virtual windows instance using VDI

  • http://vdi.cs.washington.edu/vdi/
slide-5
SLIDE 5

Nested queries

SELECT DISTINCT C.cname, (SELECT count(*) 
 FROM Product P 
 WHERE P.cid=C.cid) FROM Company C

Subqueries in SELECT Subqueries in FROM

SELECT X.pname 
 FROM (SELECT * FROM Product AS Y WHERE price > 20) as X WHERE X.price < 500

Subqueries in WHERE

SELECT DISTINCT C.cname FROM Company C WHERE EXISTS (SELECT *
 FROM Product P
 WHERE C.cid = P.cid and P.price < 200)

slide-6
SLIDE 6

subqueries in WHERE

  • SELECT ……….. WHERE EXISTS (sub);
  • SELECT ……….. WHERE NOT EXISTS (sub);
  • SELECT ……….. WHERE attribute IN (sub);
  • SELECT ……….. WHERE attribute NOT IN (sub);
  • SELECT ……….. WHERE attribute > ANY (sub);
  • SELECT ……….. WHERE attribute > ALL (sub);