A

@Ashwamegh

RUN (DML) DATA MANUPULATION COMMANDS

MySQL
3 years ago
-- create a table CREATE TABLE students ( id INTEGER PRIMARY KEY, name VARCHAR(30) NOT NULL, gender CHAR(10) NOT NULL ); -- insert some values INSERT INTO students VALUES (1, 'Ryan', 'M'); INSERT INTO students VALUES (2, 'Joanna', 'F'); -- fetch some values

DDL DATA DEFINATION LANGUAGE

MySQL
3 years ago
-- create a table CREATE TABLE students ( id INTEGER PRIMARY KEY, name VARCHAR(30) NOT NULL, gender CHAR(1) NOT NULL ); -- insert some values INSERT INTO students VALUES (1, 'Ryan', 'M'); INSERT INTO students VALUES (2, 'Joanna', 'F'); -- fetch some values

LINEAR REGRESSION IN R LANGUAGE

R
3 years ago
# The Predictor vector. x <- c(5.1,5.5,5.8,6.1,6.4,6.7,6.4,6.1,5.10,5.7) #The Response Vector. y <- c(63,66,69,72,75,78,75,72,69,66) #Apply the lm() Function. relation <- lm(y-x) summary(relation)

STATISTICAL ANALYSIS USING MEAN, MEDIAN, MODE IN R LANGUAGE

R
3 years ago
x <- cars$speed print(x) mean(x) median(x)

PLOTTING SCATTER PLOTS IN R LANGUAGE

R
3 years ago
attach(mtcars) plot(wt, mpg, main="ScatterPlot Example", xlab="car weight",ylab="Miles per Gallon", pch=19)

Plotting Line Graphs

R
3 years ago
x <- c(1:3) y <- x # create some data par(pch=19, col="red") #plotting symbol and colour. par(mfrow=c(2,4)) #all plots on one page. ops =c("p","l","o","b","c","s","S","h")

Plotting Bar Charts in R language

R
3 years ago
counts <- table(mtcars$gear) print(counts) barplot(counts, main="Car Distribution", xlab="Number of Gears") #PLOTTING BOX PLOTS IN R LANGUAGE. boxplot(mpg~cyl,data=mtcars, main="Car Milege Data", xlab="Number of Cylinders", ylab="Miles per Gallon") #Plotting Histograms in R Language.

Pie Charts in R language.

R
3 years ago
#Pie chart. slices <- c(10,12,4,16,8) lbls <- c("Manogo","Orange","Banana","Grape","Pine") pie (slices, lables = lbls, main ="pie Chart of Fruits") #3-D pie Chart. library(plotrix)

Web Data Fetching in R Language.

R
3 years ago
install.packages("RCurl") library(RCurl) sample <- read.table("https://mail.google.com/mail/u/0/?tab=rm&ogbl#inbox/FMfcgzGpGwhzzKLMSLnXQjjtNTGlzSWS") print(sample)

Opening Files in R language.

R
3 years ago
data1 <- read.csv("Toyota.csv") print(data1) print(is.data.frame(data1)) print(nco1(data1)) print(nrow(data1))

DATA RESHAPING IN R LANGUAGE.

R
3 years ago
#Create Vector Objects in R Language. city <- c("Bangalore","Delhi","Mumbai","Hyderabad") zipcode <- c(330010,410001,539012,329012) #Combine above Vectors into one data frame. oldaddresses <- cbind(city,zipcode) #Print a Header.

Packages in R Language

R
3 years ago
# Get Library Locations that contains R Packages. .Librarypaths() # Get the List of all the Packages Insatlled. Library() # Get all the packages currently loaded in R Environment.

Data Frames in R Language

R
3 years ago
employee_data <- data.frame( employee_id = c(1:4), employee_name = c("raj","rohit","amit","sail"), salary = c(62000,51000,54000,40000), stringsAsFactors = FALSE ) print(employee_data) #Adding column.

Factors in R Language

R
3 years ago
#Factors in R Language. data <- c("East","West","North","North","East","West") #Apply the Factor Function. factor_data <- factor(data) print(factor_data) #generatiin factor levels #3 is an integer giving the number of levels.

Matrices in R Language

R
3 years ago
P <- matrix(c(3:14), nrow = 4, byrow = TRUE) print(P) #Access the element at the 3rd column and the 1st row. print(P[1,3]) #Access the element at the 2nd column and the 4th row. print(P[4,2]) Q <- matrix(c(14:25), nrow = 4, byrow = TRUE)

LISTS IN R LANGUAGE

R
3 years ago
#Create a list containing strings, numbers, vectors, and a logical value. list_data <- list("red", "green", c(21,32,11), TRUE, 51.23, 119.1) print(list_data) #Access the first element of the list. print(list_data[1]) #Access the third element of the list. print(list_data[3])

Vectors in R language

R
3 years ago
#Atomic vector of type character. print("abc"); #atomic vector of type datatype. print("12.5"); #atomic vector of type integer. print("63L") #atomic vector of type logical.

Strings in R language

R
3 years ago
#VALID STRING c <- "single quote ' in between double quotes" print(c) d <- 'double quotes " in between single quotes' print(d) #invalid strings. e <- 'mixed quotes" print(e)

INITIAL WORKINGS ON SQL

SQL
3 years ago
-- create a table CREATE TABLE students ( id INTEGER PRIMARY KEY, name TEXT NOT NULL, gender TEXT NOT NULL ); -- insert some values INSERT INTO students VALUES (1, 'Ryan', 'M'); INSERT INTO students VALUES (2, 'Joanna', 'F'); -- fetch some values

INITIAL WORKINGS ON R LANGUAGE FROM TUTORIALS POINT YOUTUBE

R
3 years ago
varx<-TRUE vary<-FALSE print(!vary) print(varx&vary) print(varx|vary) isTRUE(vary) vara<-5 if(vara>4) { print(varx)