Selecting specific columns and rows

Hi, having trouble creating queries for data from the MariaDB. I need to select the weight and length for all frogs from 4 sources (CLEMSSC, MANHAKS, OKEECFL, and ROLLAMO). I must have 4 separate queries to produce 4 dataframes. Any help would be great!

This is what I have so far:

if(!require(RMariaDB)) {
install.packages("RMariaDB")
library(RMariaDB)
}
db <- dbConnect(
RMariaDB::MariaDB(),
username='student',
password='West42Care',
host='student.kainaw.com',
dbname='students'
)
data <- dbGetQuery(db, "select * from frogs limit 3")
NEWdata <- dbGetQuery(db, "select weight, length from newfrogs limit 4")

frogs4 <- dbGetQuery(db, 
"select source,weight,length 
from frogs where Source IN 
('CLEMSSC', 'MANHAKS', 'OKEECFL',  'ROLLAMO')")
1 Like

This topic was automatically closed 42 days after the last reply. New replies are no longer allowed.

If you have a query related to it or one of the replies, start a new topic and refer back with a link.