Data Science Overview
Data Science Overview
answer
Here are the answers to the questions shown in the image, each suitable for a 5-mark
answer:
1/4
4. Data Exploration: Analyze patterns, trends, and relationships.
2/4
# Print extracted headings
print(headings)
# Print data
print(data)
# Disconnect
dbDisconnect(conn)
# Load package
library(RMySQL)
# Connect to database
conn <- dbConnect(MySQL(), user='root', password='password', dbname='your_db',
host='localhost')
3/4
# Create table
dbSendQuery(conn, "CREATE TABLE IF NOT EXISTS students (id INT, name VARCHAR(50))")
# Insert data
dbSendQuery(conn, "INSERT INTO students VALUES (1, 'John Doe'), (2, 'Jane Doe')")
# Disconnect
dbDisconnect(conn)
4/4