0% found this document useful (0 votes)
133 views

Chapter 1

This document is an introduction to SQL and databases. It discusses the structure of databases and how they are used to extract information. Relational databases define relationships between tables of data. Databases offer more secure storage than spreadsheets. SQL is the most widely used programming language for databases. Tables in databases contain records and fields, where records are rows of data and fields are columns that hold individual pieces of information. Unique identifiers are used to identify individual records. The document also discusses different data types that can be stored in databases such as strings, integers, and floats.
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
133 views

Chapter 1

This document is an introduction to SQL and databases. It discusses the structure of databases and how they are used to extract information. Relational databases define relationships between tables of data. Databases offer more secure storage than spreadsheets. SQL is the most widely used programming language for databases. Tables in databases contain records and fields, where records are rows of data and fields are columns that hold individual pieces of information. Unique identifiers are used to identify individual records. The document also discusses different data types that can be stored in databases such as strings, integers, and floats.
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 26

Databases

INTRODUCTION TO SQL

Izzy Weber
Curriculum Manager, DataCamp
Course goals
1. Understand databases and their structure → Chapter 1
2. Extract information from databases using SQL → Chapter 2

INTRODUCTION TO SQL
Introducing databases

INTRODUCTION TO SQL
Introducing databases

INTRODUCTION TO SQL
Relational databases
Define relationships between tables of data inside the database

INTRODUCTION TO SQL
Database advantages
More storage than spreadsheet
applications

Storage is more secure

INTRODUCTION TO SQL
Database advantages

INTRODUCTION TO SQL
SQL
Short for Structured Query Language SELECT *
The most widely used programming FROM patrons
language for databases LIMIT 30

INTRODUCTION TO SQL
Let's practice!
INTRODUCTION TO SQL
Tables
INTRODUCTION TO SQL

Izzy Weber
Curriculum Manager, DataCamp
A seat at the table
Table rows and columns are referred to as records and fields
Fields are set at database creation; there is no limit to the number of records

INTRODUCTION TO SQL
Good table manners

Table names should...

be lowercase

have no spaces—use underscores instead

refer to a collective group or be plural

INTRODUCTION TO SQL
Laying the table: records
A record is a row that holds data on an individual observation

INTRODUCTION TO SQL
Laying the table: fields
A field is a column that holds one piece of information about all records

INTRODUCTION TO SQL
More table manners

Field names should...

be lowercase

have no spaces

be singular

be different from other field names

be different from the table name

INTRODUCTION TO SQL
Assigned seats
Unique identifiers are used to identify records in a table
They are unique and often numbers

INTRODUCTION TO SQL
The more the merrier

INTRODUCTION TO SQL
Let's practice!
INTRODUCTION TO SQL
Data
INTRODUCTION TO SQL

Izzy Weber
Curriculum Manager, DataCamp
SQL data types

Different types of data are stored differently and take up different space

Some operations only apply to certain data types

INTRODUCTION TO SQL
Strings

A string is a sequence of characters such as letters or punctuation

VARCHAR is a flexible and popular string data type in SQL

INTRODUCTION TO SQL
Integers

Integers store whole numbers

INT is a flexible and popular integer data type in SQL

INTRODUCTION TO SQL
Floats

Floats store numbers that include a fractional part

NUMERIC is a flexible and popular float data type in SQL

INTRODUCTION TO SQL
Schemas

INTRODUCTION TO SQL
Database storage

INTRODUCTION TO SQL
Let's practice!
INTRODUCTION TO SQL

You might also like