Docsity

Understanding RDBMS & Table Relationships in SQL Server - Prof. LOng, Study notes of Computer Science

Partial preview of the text

Download Understanding RDBMS & Table Relationships in SQL Server - Prof. LOng and more Study notes Computer Science in PDF only on Docsity!

Introduction to Databases

Data Definition and Data Types

How do RDBMS work? Managing DBs using IDEs

1. Data Management

2. Database Engine

3. Table Relationships

4. Programmability

5. Data Types

6. Database Modeling

7. Basic SQL Queries and Table Customization

8. Deleting Data and Structures

Table of Contents 2

  • (^) Conventional Data Storage
    • (^) Notes
    • (^) Receipts Storage vs. Management 4

SALES RECEIPT

Date: 07/16/ Order#: [00315] Customer: David Rivers Product: Oil Pump S/N: OP147- Unit Price: 69. Qty: 1 Total: 69.

  • (^) We can group related pieces of data into separate

columns

Storage vs. Management (2) 5

  • (^) A database is an organized collection of interrelated

(structured) information (data) which is stored electronically

in computer system.

  • (^) A database is usually managed and controlled by a DBMS.
  • (^) A DBMS (Data Base Management System) provides tools

to manage the database

  • (^) It parses requests from the user and takes the appropriate information or action
  • (^) The user doesn't have direct access to the stored data Database concept

DBMS

DATABASE ENGINES

  • (^) SQL Server uses the Client-Server Model Database Engine Flow 11 Clients Query Access Data Data Engine Database
  • (^) Download SQL Server Express Edition from Microsoft
  • (^) Download SQL Server Management Studio separately

T-SQL

13 http://aka.ms/sqlserver http://aka.ms/ssms

  • (^) Logical Storage
    • (^) Instance
    • (^) Database
    • (^) Schema
    • (^) Table
  • (^) Physical Storage
    • (^) Data Files and Log files
    • (^) Data Pages SQL Server Architecture 14 Instance Database Schema Table Table Table Schema Database Database Data Logs ☰ ☰ ☰ ☰ ☰ ☰ ☰ ☰
  • (^) To communicate with the DB-engine we use SQL
    • (^) Declarative language
  • (^) Logically divided in four sections
    • (^) Data Definition – describe the structure of our data
    • (^) Data Manipulation – store and retrieve data
    • (^) Data Control – define who can access the data
    • (^) Transaction Control – bundle operations and allow rollback Structured Query Language 16

TABLE RELATIONSHIPS

  • (^) We split the data and introduce relationships between the tables to avoid repeating information
  • (^) The connection is established via a Foreign Key in one table pointing to the Primary Key in another Related Tables 19 UserID First Last Registered 203 David Rivers 05/02/ 204 Sarah Thorne 07/17/ 205 Michael Walters 11/23/ UserID Email 203 [email protected] 204 [email protected] 203 [email protected] 205 [email protected] Primary Key Foreign Key
  • (^) Helps the client navigate the schema
  • (^) Explaining relations between tables: Relational Diagrams 20