CoCalc Logo Icon
StoreFeaturesDocsShareSupportNewsAboutSign UpSign In
DanielBarnes18

Real-time collaboration for Jupyter Notebooks, Linux Terminals, LaTeX, VS Code, R IDE, and more,
all in one place. Commercial Alternative to JupyterHub.

GitHub Repository: DanielBarnes18/IBM-Data-Science-Professional-Certificate
Path: blob/main/06. Databases and SQL for Data Science with Python/01. Getting Started with SQL/PETRESCUE-CREATE.sql
Views: 4598
1
-- Drop the PETRESCUE table in case it exists
2
drop table PETRESCUE;
3
-- Create the PETRESCUE table
4
create table PETRESCUE (
5
ID INTEGER NOT NULL,
6
ANIMAL VARCHAR(20),
7
QUANTITY INTEGER,
8
COST DECIMAL(6,2),
9
RESCUEDATE DATE,
10
PRIMARY KEY (ID)
11
);
12
-- Insert sample data into PETRESCUE table
13
insert into PETRESCUE values
14
(1,'Cat',9,450.09,'2018-05-29'),
15
(2,'Dog',3,666.66,'2018-06-01'),
16
(3,'Dog',1,100.00,'2018-06-04'),
17
(4,'Parrot',2,50.00,'2018-06-04'),
18
(5,'Dog',1,75.75,'2018-06-10'),
19
(6,'Hamster',6,60.60,'2018-06-11'),
20
(7,'Cat',1,44.44,'2018-06-11'),
21
(8,'Goldfish',24,48.48,'2018-06-14'),
22
(9,'Dog',2,222.22,'2018-06-15')
23
24
;
25