SQL_tutorial-1

SQL_tutorial-1 - SQL Tutorial SQL MIS 235 Help Lab...

Info iconThis preview shows pages 1–7. Sign up to view the full content.

View Full Document Right Arrow Icon
SQL Tutorial SQL Tutorial MIS 235 Help Lab MIS 235 Help Lab
Background image of page 1

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
Objective Refresh SQL knowledge for MIS 235 course sections using the Northwinds Data Model
Background image of page 2
SELECT Statement Used to retrieve data specified by the user Example: You want to see first names, last names, and home phone numbers of employees in the Northwinds data base. In the SELECT statement you would specify these fields by: SELECT LastName, FirstName, HomePhone
Background image of page 3

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
This statement’s attributes must match the attribute names exactly as shown in the model. (Capitalization not required.) SELECT LastName, FirstName, HomePhone EmployeeID LastName FirstName Title 101 Jones Aaron Manager 102 Smith Ann Director 103 Edwards Jim Associate Note: Each attribute from each table in Northwinds represents a column (heading) in the data that is retrieved as shown below. *Example data only shown above
Background image of page 4
FROM Clause Now that you have chosen attributes, the next requirement is to specify which table the attributes come from by using the “FROM” clause. The table(s) must contain the attributes listed in the SELECT statement. SELECT LastName, FirstName, HomePhone FROM mis235.Employees *When using the Northwinds database, you must add “MIS235.” in front of each table name in the
Background image of page 5

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
The SELECT statement can also use an asterisk (*) to include all fields from tables specified in the FROM clause. EXAMPLE: You want to pull all of the attributes from the Employees table. SELECT * FROM mis235.employees Note : You can use this function with more than one table, but a table join is needed (which will be discussed later).
Background image of page 6
Image of page 7
This is the end of the preview. Sign up to access the rest of the document.

Page1 / 23

SQL_tutorial-1 - SQL Tutorial SQL MIS 235 Help Lab...

This preview shows document pages 1 - 7. Sign up to view the full document.

View Full Document Right Arrow Icon
Ask a homework question - tutors are online