cse 344 section 3 srini
play

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


  1. CSE 344 Section 3 [Srini] 1. Connecting to Azure and running queries 2. Nested Queries

  2. Connect to Azure • Hostname: wsxq8lmids.database.windows.net • Username: <your UW id> • Password: <yourpass> • Databases: master and IMDB

  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'

  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/

  5. Nested queries Subqueries in SELECT SELECT DISTINCT C.cname, (SELECT count(*) 
 FROM Product P 
 WHERE P.cid=C.cid) FROM Company C 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)

  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);

Download Presentation
Download Policy: The content available on the website is offered to you 'AS IS' for your personal information and use only. It cannot be commercialized, licensed, or distributed on other websites without prior consent from the author. To download a presentation, simply click this link. If you encounter any difficulties during the download process, it's possible that the publisher has removed the file from their server.

Recommend


More recommend