Informula

Informula

Share this post

Informula
Informula
How to Convert SQL into R Data Frame? Part 2

How to Convert SQL into R Data Frame? Part 2

Informula's avatar
Informula
Nov 19, 2023
∙ Paid

Share this post

Informula
Informula
How to Convert SQL into R Data Frame? Part 2
Share

Previously on How to Convert SQL into R Data Frame? Part 1, we talked about how to convert SQL statements into R. In this article, we will continue to discover more scenarios and operations.

Delete table “main.invoice_items_2”

-- SQL
DELETE FROM main.invoice_items_2;
# R
df_invoicesitem_2 <- df_invoicesitem_2[-(1:nrow(df_invoicesitem_2 )),]

Insert Data Into blank table “main.invoice_items_2”

-- SQL
INSERT INTO main.invoice_items_2
SELECT 2241 InvoiceLineId
,413 InvoiceId
, 1 TrackId
, 0 UnitPrice
, 0 Quantity;
INSERT INTO main.invoice_items_2
SELECT 2242 InvoiceLineId
,413 InvoiceId
, 2819 TrackId
, 0 UnitPrice
, 0 Quantity;

Keep reading with a 7-day free trial

Subscribe to Informula to keep reading this post and get 7 days of free access to the full post archives.

Already a paid subscriber? Sign in
© 2025 Informula
Privacy ∙ Terms ∙ Collection notice
Start writingGet the app
Substack is the home for great culture

Share