Prepared by Jennifer Kreie, New Mexico State UniversityHosted by the University of Arkansas Microsoft Enterprise Consortium SQL Fundamentals SELECT … FROM.

Slides:



Advertisements
Similar presentations
Database Fundamentals
Advertisements

Prepared by Jennifer Kreie, New Mexico State UniversityHosted by the University of Arkansas Microsoft Enterprise Consortium Database Fundamentals Physical.
Prepared by Jennifer Kreie, New Mexico State UniversityHosted by the University of Arkansas Microsoft Enterprise Consortium SQL Fundamentals Self-joins,
Microsoft Enterprise Consortium Prepared by Jennifer Kreie, New Mexico State UniversityHosted by the University of Arkansas Database Fundamentals Defining.
Prepared by Jennifer Kreie, New Mexico State UniversityHosted by the University of Arkansas Microsoft Enterprise Consortium SQL Fundamentals Create Student-Team.
Prepared by Jennifer Kreie, New Mexico State UniversityHosted by the University of Arkansas Microsoft Enterprise Consortium SQL Fundamentals Aggregate.
Prepared by Jennifer Kreie, New Mexico State UniversityHosted by the University of Arkansas Microsoft Enterprise Consortium Database Fundamentals The Data.
Prepared by Jennifer Kreie, New Mexico State UniversityHosted by the University of Arkansas Microsoft Enterprise Consortium Database Fundamentals Data.
Prepared by Jennifer Kreie, New Mexico State UniversityHosted by the University of Arkansas Microsoft Enterprise Consortium SQL Fundamentals Evaluating.
Prepared by Jennifer Kreie, New Mexico State UniversityHosted by the University of Arkansas Microsoft Enterprise Consortium Advanced SQL Greenhouse Database.
Prepared by Jennifer Kreie, New Mexico State UniversityHosted by the University of Arkansas Microsoft Enterprise Consortium Advanced SQL Type II (Correlated)
Course 2: Inequalities Objectives:
Prepared by Jennifer Kreie, New Mexico State UniversityHosted by the University of Arkansas Microsoft Enterprise Consortium SQL Fundamentals Introduction.
PHP and SQL Server: Queries IST2101. Project Report 4 SQL Queries Due Sunday, 4/5 at 11:59pm Instructions on how to access team webspace and SQL database.
Prepared by Jennifer Kreie, New Mexico State UniversityHosted by the University of Arkansas Microsoft Enterprise Consortium SQL Fundamentals Using two.
Prepared by Jennifer Kreie, New Mexico State UniversityHosted by the University of Arkansas Microsoft Enterprise Consortium SQL Fundamentals SQL Server.
What is SQL and Who uses it? Presented by: John Deardurff Global McOWL Internal Sales Training October 24, 2014.
Prepared by Jennifer Kreie, New Mexico State UniversityHosted by the University of Arkansas Microsoft Enterprise Consortium Database Fundamentals Test.
1 Copyright © 2004, Oracle. All rights reserved. Introduction.
Prepared by Jennifer Kreie, New Mexico State UniversityHosted by the University of Arkansas Microsoft Enterprise Consortium SQL Fundamentals SELECT … FROM.
Prepared by Jennifer Kreie, New Mexico State UniversityHosted by the University of Arkansas Microsoft Enterprise Consortium Advanced SQL Nested aggregate.
Prepared by Jennifer Kreie, New Mexico State UniversityHosted by the University of Arkansas Microsoft Enterprise Consortium SQL Fundamentals Aggregating.
Prepared by Jennifer Kreie, New Mexico State UniversityHosted by the University of Arkansas Microsoft Enterprise Consortium Database Fundamentals Physical.
Prepared by Jennifer Kreie, New Mexico State UniversityHosted by the University of Arkansas Microsoft Enterprise Consortium SQL Fundamentals Sorting output.
STRUCTURED QUERY LANGUAGE SQL-II IST 210 Organization of Data IST210 1.
Prepared by Jennifer Kreie, New Mexico State UniversityHosted by the University of Arkansas Microsoft Enterprise Consortium SQL Fundamentals Logical operators.
Prepared by Jennifer Kreie, New Mexico State UniversityHosted by the University of Arkansas Microsoft Enterprise Consortium Advanced SQL In-Line Subquery.
SQL for Data Retrieval. Save your SQL Scripts When working with SQL Management Studio, you should keep saving your scripts as a.sql file to somewhere.
Prepared by Jennifer Kreie, New Mexico State UniversityHosted by the University of Arkansas Microsoft Enterprise Consortium Advanced SQL Equi-Join One-sided.
Prepared by Jennifer Kreie, New Mexico State UniversityHosted by the University of Arkansas Microsoft Enterprise Consortium SQL Fundamentals Set Operators:
Learningcomputer.com SQL Server 2008 –Views, Functions and Stored Procedures.
+ Complex SQL Week 9. + Today’s Objectives TOP GROUP BY JOIN Inner vs. Outer Right vs. Left.
Prepared by Jennifer Kreie, New Mexico State UniversityHosted by the University of Arkansas Microsoft Enterprise Consortium SQL Fundamentals WHERE clause.
In this session, you will learn to: Query data by using joins Query data by using subqueries Objectives.
1 Connecting to a Database Server. 2 We all have accounts, with a single database each, on a Microsoft SQL Server on the USF network: allman.forest.usf.edu.
Prepared by Jennifer Kreie, New Mexico State UniversityHosted by the University of Arkansas Microsoft Enterprise Consortium Advanced SQL The relational.
SSMS SQL Server Management System. SQL Server Microsoft SQL Server is a Relational Database Management System (RDBMS) Relational Database Management System.
5 Copyright © 2008, Oracle. All rights reserved. Testing and Validating a Repository.
Prepared by Jennifer Kreie, New Mexico State UniversityHosted by the University of Arkansas Microsoft Enterprise Consortium Database Fundamentals Data.
Structured Query Language SQL-II IST 210 Organization of Data IST2101.
Slide 1 of 32ASH-Training Querying and Managing Data Using SQL Server 2014 By: Segla In this session, you will learn to: Query data by using joins Query.
Create Views Using T-SQL Database Administration Fundamentals LESSON 2.3a.
IFS180 Intro. to Data Management Chapter 10 - Unions.
Using Subqueries to Solve Queries
Connect to SQL Server and run select statements
Sorting and Filtering Data
Displaying Data from Multiple Tables
20761A 10: Using Subqueries Module 10   Using Subqueries.
Using the Set Operators
20761A 11: Using Set Operators Module 11   Using Set Operators.
Free Braindumps - Pass Exam - Dumps4download
Using Subqueries to Solve Queries
Using the Set Operators
Microsoft Enterprise Consortium Type I Subquery
Database Fundamentals
Access: SQL Participation Project
Using Subqueries to Solve Queries
Using CASE Value expression
Reporting Aggregated Data Using the Group Functions
Using Subqueries to Solve Queries
IST 318 Database Administration
Reporting Aggregated Data Using the Group Functions
Using Subqueries to Solve Queries
Using the Set Operators
Reporting Aggregated Data Using the Group Functions
Subqueries Schedule: Timing Topic 25 minutes Lecture
Course 2: Inequalities Objectives:
Topic - DML - Select statement
分组函数 Schedule: Timing Topic 35 minutes Lecture 40 minutes Practice
Aggregating Data Using Group Functions
Presentation transcript:

Prepared by Jennifer Kreie, New Mexico State UniversityHosted by the University of Arkansas Microsoft Enterprise Consortium SQL Fundamentals SELECT … FROM … WHERE 1 Microsoft Enterprise Consortium Microsoft Enterprise Consortium: Microsoft Faculty Connection/Faculty Resource Center

Prepared by Jennifer Kreie, New Mexico State UniversityHosted by the University of Arkansas Microsoft Enterprise Consortium What you’ll need … Log in to MEC for this lesson and into MSSMS (Microsoft SQL Server Management Studio). ◦Be sure to select your account ID under Database in the Object Explorer pane, similar to the example shown here. 2

Prepared by Jennifer Kreie, New Mexico State UniversityHosted by the University of Arkansas Microsoft Enterprise Consortium SELECT … FROM … WHERE Adding the WHERE clause to the SELECT statement allows you to filter output based on a criterion. Syntax: SELECT,, … FROM WHERE = ; The syntax shown here checks whether data in a column equals the criterion. Of course, other evaluations can be used. 3

Prepared by Jennifer Kreie, New Mexico State UniversityHosted by the University of Arkansas Microsoft Enterprise Consortium Query the Student-Team database Open a Query pane (New Query). Find out which students are on the Systems Designers (SYSDES) team. /* Show students on the SYSDES team. */ select std_teamID, stdfname, stdlname from students where std_teamID = 'SYSDES'; 4

Prepared by Jennifer Kreie, New Mexico State UniversityHosted by the University of Arkansas Microsoft Enterprise Consortium Find students on another team. Which students are on the Digital Solutions team? /* Show students on the DIGSOL team. */ select std_teamID, stdfname, stdlname from students where std_teamID = 'DIGSOL'; /* Show all student data. Show that no one is on the DIGSOL team.*/ select * from students; 5

Prepared by Jennifer Kreie, New Mexico State UniversityHosted by the University of Arkansas Microsoft Enterprise Consortium Filter students by major Which students are majoring NOT in IS? ◦Use “not equal” for the evaluation. /* Show students not majoring in information systems. */ select std_teamid, stdfname, stdlname from students where std_teamID <> 'ISYS'; 6

Prepared by Jennifer Kreie, New Mexico State UniversityHosted by the University of Arkansas Microsoft Enterprise Consortium Query the AW database Count how many AW employees are Design Engineers. /* Count how many Design Engineers there are at AW. */ select count(*) from AdventureWorks2008.HumanResources.Employee where jobtitle = 'Design Engineer'; Which departments are in the Quality Assurance group? Select DepartmentID, Name, GroupName From AdventureWorks2008.HumanResources.Department where GroupName = 'Quality Assurance'; 7

Prepared by Jennifer Kreie, New Mexico State UniversityHosted by the University of Arkansas Microsoft Enterprise Consortium What was covered … SELECT … FROM … WHERE Using the WHERE clause to filter output. Sometimes no output is the correct output. Combine the count(*) function with a filter in the WHERE clause. 8

Prepared by Jennifer Kreie, New Mexico State UniversityHosted by the University of Arkansas Microsoft Enterprise Consortium Resources Microsoft Faculty Connection—Faculty Resource Center Microsoft Transact-SQL Reference AdventureWorks Sample Database 9