SQL Workshop - Washington University in St. Louis

[Pages:51]SQL Workshop

Introduction Queries

Doug Shook

SQL Server

As its name implies: its a data base server! ? Technically it is a database management system (DBMS) ? Competitors: Oracle, MySQL, DB2

End users (that's you!) interact as clients ? Queries formed on the client and passed to the server

2

SQL Server

`

Client

Database server Network

`

Client

`

Client

3

Relational database model

Data is stored in tables ? One or more columns (fields) ? Many, many, rows (records)

Modeled after real world entities ? Attributes ? Instances

Primary keys are used to identify each record ? Must be unique!

4

Relational database model

Primary key

Columns

Rows

5

Relational database model

Relationships are defined between two tables by foreign keys ? One-to-one ? One-to-many ? Many-to-many

Primary key -> foreign key

6

Relational database model

Primary key

Foreign key 7

Columns

Columns have associated properties ? Data type ? Null? ? Default value ? Identity column

8

................
................

In order to avoid copyright disputes, this page is only a partial summary.

Google Online Preview   Download