Cursusomgeving Data-Docent
Home
Effectieve Business Intelligence
Data Gedreven Werken
Databases
SQL
SQL Query
Query *
SELECT table_schema, table_name, column_name, ordinal_position, is_nullable, data_type FROM INFORMATION_SCHEMA.columns WHERE table_schema = 'Northwind' ORDER BY 1,2, 4
Query is required
Execute queries for retrieving from the database.
Select tables
Select views
Select joins etc
You can also execute statements
Result
in the table below:
Rows: 190
Colums: 6
table_schema
table_name
column_name
ordinal_position
is_nullable
data_type
Northwind
Alphabetical list of products
ProductID
1
NO
int
Northwind
Alphabetical list of products
ProductName
2
NO
nvarchar
Northwind
Alphabetical list of products
SupplierID
3
YES
int
Northwind
Alphabetical list of products
CategoryID
4
YES
int
Northwind
Alphabetical list of products
QuantityPerUnit
5
YES
nvarchar
Northwind
Alphabetical list of products
UnitPrice
6
YES
money
Northwind
Alphabetical list of products
UnitsInStock
7
YES
smallint
Northwind
Alphabetical list of products
UnitsOnOrder
8
YES
smallint
Northwind
Alphabetical list of products
ReorderLevel
9
YES
smallint
Northwind
Alphabetical list of products
Discontinued
10
NO
bit
Northwind
Alphabetical list of products
CategoryName
11
NO
nvarchar
Northwind
Categories
CategoryID
1
NO
int
Northwind
Categories
CategoryName
2
NO
nvarchar
Northwind
Categories
Description
3
YES
ntext
Northwind
Categories
Picture
4
YES
image
Northwind
Category Sales for 1997
CategoryName
1
NO
nvarchar
Northwind
Category Sales for 1997
CategorySales
2
YES
money
Northwind
Current Product List
ProductID
1
NO
int
Northwind
Current Product List
ProductName
2
NO
nvarchar
Northwind
Customer and Suppliers by City
City
1
YES
nvarchar
Northwind
Customer and Suppliers by City
CompanyName
2
NO
nvarchar
Northwind
Customer and Suppliers by City
ContactName
3
YES
nvarchar
Northwind
Customer and Suppliers by City
Relationship
4
NO
varchar
Northwind
CustomerCustomerDemo
CustomerID
1
NO
nchar
Northwind
CustomerCustomerDemo
CustomerTypeID
2
NO
nchar
Northwind
CustomerDemographics
CustomerTypeID
1
NO
nchar
Northwind
CustomerDemographics
CustomerDesc
2
YES
ntext
Northwind
Customers
CustomerID
1
NO
nchar
Northwind
Customers
CompanyName
2
NO
nvarchar
Northwind
Customers
ContactName
3
YES
nvarchar
Northwind
Customers
ContactTitle
4
YES
nvarchar
Northwind
Customers
Address
5
YES
nvarchar
Northwind
Customers
City
6
YES
nvarchar
Northwind
Customers
Region
7
YES
nvarchar
Northwind
Customers
PostalCode
8
YES
nvarchar
Northwind
Customers
Country
9
YES
nvarchar
Northwind
Customers
Phone
10
YES
nvarchar
Northwind
Customers
Fax
11
YES
nvarchar
Northwind
Employees
EmployeeID
1
NO
int
Northwind
Employees
LastName
2
NO
nvarchar
Northwind
Employees
FirstName
3
NO
nvarchar
Northwind
Employees
Title
4
YES
nvarchar
Northwind
Employees
TitleOfCourtesy
5
YES
nvarchar
Northwind
Employees
BirthDate
6
YES
datetime
Northwind
Employees
HireDate
7
YES
datetime
Northwind
Employees
Address
8
YES
nvarchar
Northwind
Employees
City
9
YES
nvarchar
Northwind
Employees
Region
10
YES
nvarchar
Northwind
Employees
PostalCode
11
YES
nvarchar
Northwind
Employees
Country
12
YES
nvarchar
Northwind
Employees
HomePhone
13
YES
nvarchar
Northwind
Employees
Extension
14
YES
nvarchar
Northwind
Employees
Photo
15
YES
image
Northwind
Employees
Notes
16
YES
ntext
Northwind
Employees
ReportsTo
17
YES
int
Northwind
Employees
PhotoPath
18
YES
nvarchar
Northwind
EmployeeTerritories
EmployeeID
1
NO
int
Northwind
EmployeeTerritories
TerritoryID
2
NO
nvarchar
Northwind
Invoices
ShipName
1
YES
nvarchar
Northwind
Invoices
ShipAddress
2
YES
nvarchar
Northwind
Invoices
ShipCity
3
YES
nvarchar
Northwind
Invoices
ShipRegion
4
YES
nvarchar
Northwind
Invoices
ShipPostalCode
5
YES
nvarchar
Northwind
Invoices
ShipCountry
6
YES
nvarchar
Northwind
Invoices
CustomerID
7
YES
nchar
Northwind
Invoices
CustomerName
8
NO
nvarchar
Northwind
Invoices
Address
9
YES
nvarchar
Northwind
Invoices
City
10
YES
nvarchar
Northwind
Invoices
Region
11
YES
nvarchar
Northwind
Invoices
PostalCode
12
YES
nvarchar
Northwind
Invoices
Country
13
YES
nvarchar
Northwind
Invoices
Salesperson
14
NO
nvarchar
Northwind
Invoices
OrderID
15
NO
int
Northwind
Invoices
OrderDate
16
YES
datetime
Northwind
Invoices
RequiredDate
17
YES
datetime
Northwind
Invoices
ShippedDate
18
YES
datetime
Northwind
Invoices
ShipperName
19
NO
nvarchar
Northwind
Invoices
ProductID
20
NO
int
Northwind
Invoices
ProductName
21
NO
nvarchar
Northwind
Invoices
UnitPrice
22
NO
money
Northwind
Invoices
Quantity
23
NO
smallint
Northwind
Invoices
Discount
24
NO
real
Northwind
Invoices
ExtendedPrice
25
YES
money
Northwind
Invoices
Freight
26
YES
money
Northwind
Order Details
OrderID
1
NO
int
Northwind
Order Details
ProductID
2
NO
int
Northwind
Order Details
UnitPrice
3
NO
money
Northwind
Order Details
Quantity
4
NO
smallint
Northwind
Order Details
Discount
5
NO
real
Northwind
Order Details Extended
OrderID
1
NO
int
Northwind
Order Details Extended
ProductID
2
NO
int
Northwind
Order Details Extended
ProductName
3
NO
nvarchar
Northwind
Order Details Extended
UnitPrice
4
NO
money
Northwind
Order Details Extended
Quantity
5
NO
smallint
Northwind
Order Details Extended
Discount
6
NO
real
Northwind
Order Details Extended
ExtendedPrice
7
YES
money
Northwind
Order Subtotals
OrderID
1
NO
int
Northwind
Order Subtotals
Subtotal
2
YES
money
Northwind
Orders
OrderID
1
NO
int
Northwind
Orders
CustomerID
2
YES
nchar
Northwind
Orders
EmployeeID
3
YES
int
Northwind
Orders
OrderDate
4
YES
datetime
Northwind
Orders
RequiredDate
5
YES
datetime
Northwind
Orders
ShippedDate
6
YES
datetime
Northwind
Orders
ShipVia
7
YES
int
Northwind
Orders
Freight
8
YES
money
Northwind
Orders
ShipName
9
YES
nvarchar
Northwind
Orders
ShipAddress
10
YES
nvarchar
Northwind
Orders
ShipCity
11
YES
nvarchar
Northwind
Orders
ShipRegion
12
YES
nvarchar
Northwind
Orders
ShipPostalCode
13
YES
nvarchar
Northwind
Orders
ShipCountry
14
YES
nvarchar
Northwind
Orders Qry
OrderID
1
NO
int
Northwind
Orders Qry
CustomerID
2
YES
nchar
Northwind
Orders Qry
EmployeeID
3
YES
int
Northwind
Orders Qry
OrderDate
4
YES
datetime
Northwind
Orders Qry
RequiredDate
5
YES
datetime
Northwind
Orders Qry
ShippedDate
6
YES
datetime
Northwind
Orders Qry
ShipVia
7
YES
int
Northwind
Orders Qry
Freight
8
YES
money
Northwind
Orders Qry
ShipName
9
YES
nvarchar
Northwind
Orders Qry
ShipAddress
10
YES
nvarchar
Northwind
Orders Qry
ShipCity
11
YES
nvarchar
Northwind
Orders Qry
ShipRegion
12
YES
nvarchar
Northwind
Orders Qry
ShipPostalCode
13
YES
nvarchar
Northwind
Orders Qry
ShipCountry
14
YES
nvarchar
Northwind
Orders Qry
CompanyName
15
NO
nvarchar
Northwind
Orders Qry
Address
16
YES
nvarchar
Northwind
Orders Qry
City
17
YES
nvarchar
Northwind
Orders Qry
Region
18
YES
nvarchar
Northwind
Orders Qry
PostalCode
19
YES
nvarchar
Northwind
Orders Qry
Country
20
YES
nvarchar
Northwind
Product Sales for 1997
CategoryName
1
NO
nvarchar
Northwind
Product Sales for 1997
ProductName
2
NO
nvarchar
Northwind
Product Sales for 1997
ProductSales
3
YES
money
Northwind
Products
ProductID
1
NO
int
Northwind
Products
ProductName
2
NO
nvarchar
Northwind
Products
SupplierID
3
YES
int
Northwind
Products
CategoryID
4
YES
int
Northwind
Products
QuantityPerUnit
5
YES
nvarchar
Northwind
Products
UnitPrice
6
YES
money
Northwind
Products
UnitsInStock
7
YES
smallint
Northwind
Products
UnitsOnOrder
8
YES
smallint
Northwind
Products
ReorderLevel
9
YES
smallint
Northwind
Products
Discontinued
10
NO
bit
Northwind
Products Above Average Price
ProductName
1
NO
nvarchar
Northwind
Products Above Average Price
UnitPrice
2
YES
money
Northwind
Products by Category
CategoryName
1
NO
nvarchar
Northwind
Products by Category
ProductName
2
NO
nvarchar
Northwind
Products by Category
QuantityPerUnit
3
YES
nvarchar
Northwind
Products by Category
UnitsInStock
4
YES
smallint
Northwind
Products by Category
Discontinued
5
NO
bit
Northwind
Quarterly Orders
CustomerID
1
YES
nchar
Northwind
Quarterly Orders
CompanyName
2
YES
nvarchar
Northwind
Quarterly Orders
City
3
YES
nvarchar
Northwind
Quarterly Orders
Country
4
YES
nvarchar
Northwind
Region
RegionID
1
NO
int
Northwind
Region
RegionDescription
2
NO
nchar
Northwind
Sales by Category
CategoryID
1
NO
int
Northwind
Sales by Category
CategoryName
2
NO
nvarchar
Northwind
Sales by Category
ProductName
3
NO
nvarchar
Northwind
Sales by Category
ProductSales
4
YES
money
Northwind
Sales Totals by Amount
SaleAmount
1
YES
money
Northwind
Sales Totals by Amount
OrderID
2
NO
int
Northwind
Sales Totals by Amount
CompanyName
3
NO
nvarchar
Northwind
Sales Totals by Amount
ShippedDate
4
YES
datetime
Northwind
Shippers
ShipperID
1
NO
int
Northwind
Shippers
CompanyName
2
NO
nvarchar
Northwind
Shippers
Phone
3
YES
nvarchar
Northwind
Summary of Sales by Quarter
ShippedDate
1
YES
datetime
Northwind
Summary of Sales by Quarter
OrderID
2
NO
int
Northwind
Summary of Sales by Quarter
Subtotal
3
YES
money
Northwind
Summary of Sales by Year
ShippedDate
1
YES
datetime
Northwind
Summary of Sales by Year
OrderID
2
NO
int
Northwind
Summary of Sales by Year
Subtotal
3
YES
money
Northwind
Suppliers
SupplierID
1
NO
int
Northwind
Suppliers
CompanyName
2
NO
nvarchar
Northwind
Suppliers
ContactName
3
YES
nvarchar
Northwind
Suppliers
ContactTitle
4
YES
nvarchar
Northwind
Suppliers
Address
5
YES
nvarchar
Northwind
Suppliers
City
6
YES
nvarchar
Northwind
Suppliers
Region
7
YES
nvarchar
Northwind
Suppliers
PostalCode
8
YES
nvarchar
Northwind
Suppliers
Country
9
YES
nvarchar
Northwind
Suppliers
Phone
10
YES
nvarchar
Northwind
Suppliers
Fax
11
YES
nvarchar
Northwind
Suppliers
HomePage
12
YES
ntext
Northwind
Territories
TerritoryID
1
NO
nvarchar
Northwind
Territories
TerritoryDescription
2
NO
nchar
Northwind
Territories
RegionID
3
NO
int