Sem: Dec-2024 Maximum Marks: 50 Examination: End Exam Date: Duration: 2.5hrs
Programme code: 18 Programme: MBA for Working Executive	Class: FY	Semester: III Batch- 2023-24
College: K. J. Somaiya Institute of Management	Name of the department/Section/Center:
Course Code:	Name of the Course: Introduction to R and SQL

Section 1: R Programming (30 marks)

Instructions

You must attempt any 3 questions in all.

All questions carry equal marks.

All subparts to a question must be answered.

Make suitable assumptions if required and state them.

All attempted questions must be solved entirely using RStudio.

All relevant analyses, comments and interpretations should also be stated in the Rfile itself.

Keep on saving the file continuously.

Make only 1 word file with code and screenshots of the outputs pertaining to each question, also attach the R code file.

Follow the naming and other folder-related instructions of the invigilators.

Question No.	Max. Marks
1.	Draw insights from each graph given below and answer the following questions: Which age group amongst the Smokers and Non-Smokers has better lung capacity? Interpret the outliers. Compare the revenue generated for the East and North region over the different months. Which year shows the highest and the least growth rate?	(10 M)
2.	Solve the following based on the R output. 1. Construct the regression equation. 2. Explain the R2 and adjusted R2 3. Explain the significant variables in the model. 4. Comment on Model Accuracy. 5. Write an inference based on the output.	(10M)
3.	Explain Operators in R programming and perform operations on the data given below. x <- c(35,55,95) y <- c(22,11,66) z <- c(13,33,83) (x+y) > z (z*x)-y^ (x+y+z) %% z (x+y) == (y+z) x-4 x <- c(TRUE, FALSE,0,6) y <- c(FALSE, TRUE,FALSE,TRUE) !x x&y x&&y x|y x||y	(10M)
4.	Solve the following questions. a. Observe the graph and correlation co-efficient below. Explain in brief what type of correlation is observed in the graph. Write inference for the same. List and define some basic data structures in R. How to import data in R? How to assign a value to a variable in R?	(10 M)

Section 2: SQL (20 marks)

Instructions

You must attempt 2 questions in all.

All questions carry equal marks.

All subparts to a question must be answered.

Make suitable assumptions if required and state them.

All attempted questions must be solved entirely using SQL workbench or command line tool.

All relevant comments and interpretations should also be stated as a comment in the SQL file itself.

Keep saving the file.

Make only 1 word file with code and screenshot of outputs pertaining to each question and attach the SQL file.

Follow the naming and other folder-related instructions of the invigilators.

Question No.	Max. Marks
1.	Consider the following case in music industry: An album is released by one or more singers. Singers promote their new albums with a dinner party in a large hall. It’s represented in the following E-R diagram: Translate the diagram above to relations by writing the database schema.	(10 M)
2.	Suppose you are given the following requirements for a simple database for the National Hockey League (NHL): • the NHL has many teams, • each team has a name, a city, a coach, a captain, and a set of players, • each player belongs to only one team, • each player has a name, a position (such as left wing or goalie), a skill level, and a set of injury records, • a team captain is also a player, • a game is played between two teams (referred to as host_team and guest_team) and has a date (such as May 11th, 1999) and a score (such as 4 to 2). Construct a clean and concise ER diagram for the NHL database using the Chen notation as in your textbook. List your assumptions and clearly indicate the cardinality mappings as well as any role indicators in your ER diagram	(10M)
3	Create a SQL Table “Customers” with the column names Age, Gender, Occupation, Item Purchased, Cost and Date. Populate the table with the values of your choice with 10-15 entries. Perform the following queries on the table. SELECT all table rows with Customer Name and Age in it. SELECT table row where Customer Age is greater than 20. SUM the Total Cost SELECT from Customer Occupation where Item purchased is Laptop Count the total number of rows in the table.	10 M