w3resource

SQL Exercises, Practice, Solution - exercises on AdventureWorks Database

SQL Queries of AdventureWorks Database:

The AdventureWorks Database is a Microsoft product sample that provides an example of an online transaction processing (OLTP) database. Adventure Works Cycles is a fictitious multinational manufacturing company that is supported by the AdventureWorks Database.

Exercises:

List of Schemas and Tables and ER Diagram in the AdventureWorks database:

Schema: humanresources

E R Diagram of humanresources Schema:

Adventureworks humanresources schema

Schema: person

E R Diagram of person Schema:

Adventureworks person schema

Schema: production

E R Diagram of production Schema:

Adventureworks production schema

Schema: purchasing

E R Diagram of purchasing Schema:

Adventureworks purchasing schema

Schema: sales

E R Diagram of sales Schema:

Adventureworks sales schema

Download Postgre verseion of AdventureWorks Database. Clickhere.



Follow us on Facebook and Twitter for latest update.

SQL: Tips of the Day

Date from a SQL Server DateTime datatype

SELECT DATEADD(dd, 0, DATEDIFF(dd, 0, @your_date))

for example

SELECT DATEADD(dd, 0, DATEDIFF(dd, 0, GETDATE()))

gives me

2008-09-22 00:00:00.000

Pros:

  • No varchar<->datetime conversions required
  • No need to think about locale

Database: SQL Server

Ref: https://bit.ly/3I8V4lm