Platform
Resources
Pricing
Sign in
Contact us
Charles Redmond
Workspace
Fork
Public
aaa-Database550Fall23
By
Charles Redmond
Edited
Aug 29, 2023
4 forks
aaa-Database550Fall23
Plotting Template
Class Exercise Part 2
Make-up Quiz
Views and Analytics
The CASE Statement
CASE Part 2
Correlated SubQueries
Quiz 6
Chinook Problems
Subqueries
Sets Part 2
Sets
H VS SO Application
Homerun Application
Plotting Tutorial
Data Viz
Joins
Baseball Database
Creating and Populating a Database
Insert cell
Insert cell
Insert cell
db
CREATE SEQUENCE seq_person_id START 1
Insert cell
db
CREATE TABLE person(
person_id USMALLINT DEFAULT NEXTVAL('seq_person_id'),
fname VARCHAR(20),
lname VARCHAR(20),
eye_color CHAR(2),
birth_date DATE,
street VARCHAR(30),
city VARCHAR(20),
state VARCHAR(20),
country VARCHAR(20),
postal_code VARCHAR(20),
CONSTRAINT pk_person PRIMARY KEY(person_id)
);
Insert cell
db
INSERT INTO person
(fname,lname,eye_color,birth_date)
VALUES
('William','Turner','BR','1972-05-27');
Insert cell
db
INSERT INTO person
(fname,lname,eye_color,birth_date,street,city,state,country,postal_code)
VALUES
('Susan','Smith','BL','1975-11-02','23 Maple St.','Arlington','VA','USA','20220')
Insert cell
db
UPDATE person
SET
street = '1225 Tremont St.',
city = 'Boston',
state = 'MA',
country = 'USA',
postal_code = '02138'
WHERE person_id = 1;
Insert cell
Insert cell
db
CREATE TABLE favorite_food(
person_id USMALLINT,
food VARCHAR(20),
CONSTRAINT pk_fav_food PRIMARY KEY(person_id,food),
CONSTRAINT fk_fav_food_person FOREIGN KEY(person_id) REFERENCES person(person_id)
);
Insert cell
db
INSERT INTO favorite_food
(person_id,food)
VALUES
(1,'pizza'),
(1,'cookies'),
(1,'nachos');
Insert cell
db
DELETE FROM person
WHERE person_id = 2;
Insert cell
db
SELECT * FROM person;
Insert cell
Purpose-built for displays of data
Observable is your go-to platform for exploring data and creating expressive data visualizations. Use reactive JavaScript notebooks for prototyping and a collaborative canvas for visual data exploration and dashboard creation.
Try it for free
Learn more
Fork
View
Export
Edit
Add comment
Select
Duplicate
Copy link
Embed
Delete
JavaScript
Markdown
HTML
db
Edit
Add comment
Copy import
Select
Duplicate
Copy link
Embed
Delete
JavaScript
Markdown
HTML
Add comment
Select
Duplicate
Copy link
Embed
Delete
Cells
db
File attachments
Databases
Add comment
Select
Duplicate
Copy link
Embed
Delete
Cells
db
File attachments
Databases
Add comment
Select
Duplicate
Copy link
Embed
Delete
Cells
db
File attachments
Databases
Add comment
Select
Duplicate
Copy link
Embed
Delete
Cells
db
File attachments
Databases
Add comment
Select
Duplicate
Copy link
Embed
Delete
Cells
db
File attachments
Databases
Edit
Add comment
Select
Duplicate
Copy link
Embed
Delete
JavaScript
Markdown
HTML
Add comment
Select
Duplicate
Copy link
Embed
Delete
Cells
db
File attachments
Databases
Add comment
Select
Duplicate
Copy link
Embed
Delete
Cells
db
File attachments
Databases
Add comment
Select
Duplicate
Copy link
Embed
Delete
Cells
db
File attachments
Databases
Add comment
Select
Duplicate
Copy link
Embed
Delete
Cells
db
File attachments
Databases