1 / 10

SQL Select Statement

SQL Select Statement. IST359 M005. Yang Wang ywang@syr.edu 342 Hinds http://blackboard.syr.edu. Acknowledgements and caveat. These slides draw liberally, with permission, from the following sources: IST359 materials by Prof. Michael Fudge Jr.

didina
Télécharger la présentation

SQL Select Statement

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. SQL Select Statement IST359 M005 Yang Wang ywang@syr.edu 342 Hinds http://blackboard.syr.edu

  2. Acknowledgements and caveat • These slides draw liberally, with permission, from the following sources: • IST359 materials by Prof. Michael Fudge Jr. • Slides from Murach’s SQL Server 2008 book • Caveat (beware): At best, PowerPoint slides are only a pale limitation of the entirety of a class meeting. In IST359 in particular, the lectures will cover topics beyond what appears in these slides. Don’t rely on them as a substitute for attending class.

  3. Agenda • Understanding Fudgemart • Select from, where, order by • Top and distinct keywords • Table joins • Column and table aliasing

  4. Fudgemart – Conceptual

  5. Fudgemart - Internal

  6. SELECT SELECT {colname [, n] | * } FROM tablename [WHERE condition] [ORDER BY col [ASC | DESC]]

  7. SELECT SELECT employee_id, employee_hourlywage FROM employees WHERE employee_hourlywage > 10 ORDER BY employee_id DESC

  8. Demo #1 • Basic SELECT • Columns • Where ( AND .vs OR) • Order by • Cast / Convert • TOP / Distinct

  9. SELECT HOW WE SAY IT HOW IT IS PROCESSED FROM WHERE SELECT (Projection) ORDER BY TOP / DISTINCT • SELECT (Projection) • TOP/ DISTINCT • FROM • WHERE • ORDER BY

  10. Demo – Table Joins • Select JOINS • Cross (Cartesian product) • Inner / Equijoin • Table and Column Aliasing • Outer joins (Left / Right / Full)

More Related