Sample SQL Practice - Address (Person) AddressID...

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

View Full Document Right Arrow Icon
Address (Person) AddressID AddressLine1 AddressLine2 City StateProvinceID PostalCode rowguid ModifiedDate EmployeeAddress (HumanResources) EmployeeID AddressID rowguid ModifiedDate Employee (HumanResources) EmployeeID NationalIDNumber ContactID LoginID ManagerID Title BirthDate MaritalStatus Gender HireDate SalariedFlag VacationHours SickLeaveHours CurrentFlag rowguid ModifiedDate Contact (Person) ContactID NameStyle Title FirstName MiddleName LastName Suffix EmailAddress EmailPromotion Phone PasswordHash PasswordSalt AdditionalContactInfo rowguid ModifiedDate EmployeePayHistory (HumanResources) EmployeeID RateChangeDate Rate PayFrequency ModifiedDate FIGURE 1 Tables from AdventureWorks database for reference in some sample queries.
Background image of page 1

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

View Full DocumentRight Arrow Icon
START: _________________________________________________________________________________ 1. Start SQL Server Express and connect. 2. Expand Databases and then expand AdventureWorks Database. 3. Expand Tables under AdventureWorks database. 4. To create a query, click the New Query button on toolbar. Verify that AdventureWorks is selected as the database to use. See Figure 2. 5. To enter a query, type query text in new query pane. Results will appear in pane below query text. 6. When query is entered, click ! Execute button to run the query. 7. NOTE: **** in queries is my comment do not enter comments when you type query! FIGURE 2 DML EXAMPLE QUERIES: INSERT, UPDATE, DELETE _______________________________________________ View Person. Address look at columns, constraints… Determine State code for Florida select StateProvinceID, Name ****Query returns StateProvinceID of 15 for Florida from Person.StateProvince **** 15 used in next query to insert row into table. where Name like 'Fl%'
Background image of page 2
Image of page 3
This is the end of the preview. Sign up to access the rest of the document.

This note was uploaded on 09/21/2011 for the course CGS 2545 taught by Professor Markllewellyn during the Summer '10 term at University of Central Florida.

Page1 / 5

Sample SQL Practice - Address (Person) AddressID...

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

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