wayground logo

Free Printable Worksheets

Font size

S
M
L
XL
Worksheets

Exam Modul 2 Preparation

Total questions: 26

Worksheet time: 1hrs 24mins

Name
Class
Date
1.

Gunakan CTE untuk menghitung total belanja tiap pelanggan pada tahun 2023 dan hanya tampilkan pelanggan yang total belanjanya lebih dari 500. Pilih query mana yang benar:

a)

a) WITH CustomerTotal AS (

SELECT customer_id, SUM(total_amount) AS total_spent

FROM Orders

WHERE order_date >= '2023-01-01' AND order_date <= '2023-12-31'

GROUP BY customer_id

)

SELECT customer_id, total_spent

FROM CustomerTotal

WHERE total_spent > 500;

b)

b) WITH CustomerTotal AS (

SELECT customer_id, SUM(total_amount) AS total_spent

FROM Orders

WHERE order_date >= '2023-01-01' AND order_date <= '2023-12-31'

)

SELECT customer_id, total_spent

FROM CustomerTotal

WHERE total_spent > 500;

c)

c) WITH CustomerTotal AS (

SELECT customer_id, total_amount AS total_spent

FROM Orders

WHERE order_date >= '2023-01-01' AND order_date <= '2023-12-31'

GROUP BY customer_id

)

SELECT customer_id, total_spent

FROM CustomerTotal

WHERE total_spent > 500;

d)

d) WITH CustomerTotal AS (

SELECT customer_id, COUNT(total_amount) AS total_spent

FROM Orders

WHERE order_date >= '2023-01-01' AND order_date <= '2023-12-31'

GROUP BY customer_id

)

SELECT customer_id, total_spent

FROM CustomerTotal

WHERE total_spent > 500;

2.

Query manakah yang akan mengembalikan daftar semua pelanggan dan jumlah total produk yang mereka pesan, termasuk pelanggan yang tidak memiliki pesanan?

a)

SELECT Customers.CustomerName, SUM(Orders.Quantity) AS TotalQuantity

FROM Customers

INNER JOIN Orders ON Customers.CustomerID = Orders.CustomerID

GROUP BY Customers.CustomerName;

b)

SELECT Customers.CustomerName, SUM(Orders.Quantity) AS TotalQuantity

FROM Customers

LEFT JOIN Orders ON Customers.CustomerID = Orders.CustomerID

GROUP BY Customers.CustomerName;

c)

SELECT Customers.CustomerName, COUNT(Orders.OrderID) AS TotalOrders

FROM Customers

RIGHT JOIN Orders ON Customers.CustomerID = Orders.CustomerID

GROUP BY Customers.CustomerName;

d)

SELECT Customers.CustomerName, SUM(Orders.Quantity) AS TotalQuantity

FROM Customers

FULL OUTER JOIN Orders ON Customers.CustomerID = Orders.CustomerID

GROUP BY Customers.CustomerName;

3.

Manakah dari pernyataan berikut yang benar mengenai cara menghitung total pendapatan dari setiap produk?

a)

a) df.groupby('Produk')['Harga'].sum()

b)

b) df.groupby('Produk')['Harga'].sum() * df['Jumlah']

c)

c) df.groupby('Produk').apply(lambda x: (x['Harga'] * x['Jumlah']).sum())

d)

d) df['Harga'] * df['Jumlah']

4.

Apa hasil dari kode berikut?

a)

A. [12 15 18]

b)

B. [ 6 15 24]

c)

C. [15 18 21]

d)

D. [ 1 2 3]

5.

Apa fungsi dari metode dropna() dalam pandas?

a)

A. Menghapus kolom yang tidak memiliki data.

b)

B. Menghapus baris yang memiliki nilai NaN.

c)

C. Mengganti nilai NaN dengan nilai tertentu.

d)

D. Mengembalikan DataFrame tanpa mengubahnya.

6.

np.random.randint(0, 50, 6).reshape(3, 2) ,mana output yang benar?

a)

a. array([[0.11272585, 0.50231826], [0.95693598, 0.83532571], [0.24816881, 0.92556657]])

b)

b. array([[0.11272585, 0.50231826, 0.95693598], [0.83532571, 0.24816881, 0.92556657]])

c)

c. array([[29, 22], [12, 35], [23, 21]])

d)

d. array([[29, 22, 12], [35, 23, 21]])

7.

Untuk menampilkan nama mobil yang memiliki horsepower paling besar, manakah kode yang benar?

a)

a. df[df['horsepower'] == df['horsepower'].max()].loc['name']

b)

b. df['name'][df['horsepower'] == df['horsepower'].max()]

c)

c. df.iloc[df['horsepower'] == df['horsepower'].max()]['name']

d)

d. df.loc[df['horsepower'].max()]['name']

8.

Manakah pernyataan yang benar mengenai populasi dan sampel?

a)

a. Parameter adalah ringkasan numerik dari populasi

b)

b. Populasi adalah bagian dari sampel

c)

c. Pengambilan sampel tidak boleh acak

d)

d. Pemaanfaatan sampel untuk menarik kesimpulan terhadap populasi dinamakan Statistika

Deskriptif

9.

Batas atas dari boxplot adalah ....

a)

a. Q1 + (1.5*IQR)

b)

b. Q1 - (1.5*IQR)

c)

c. Q3 + (1.5*IQR)

d)

d. Q2 + (1.5*IQR)

10.

Dikeahui sebuag dataset berisikan data penjualan rumah secara online di Indonesia memiliki sebuah

kolom/variabel bernama ‘Harga_Rumah’ yang berisi nilai harga dari tiap rumah yang dijual dan distribusi

datanya tidak normal. Sebaiknya measure of central tendency yang digunakan adalah

a)

a. Mean

b)

b. Median

c)

c. Modus

d)

d. Standar deviasi

11.

isi dengan code yang tepat

a)

marker='--'

b)

linestyle='--'

c)

marker='None'

d)

linestyle='None'

12.

# Fixing a Plotly figure


# Update the type

monthly_sales['data'][0][__1__] = __2__


# Update the title text

monthly_sales[__3__][__4__]['text'] = 'Sales for Jan-Mar 2020'


# Create a figure

fig = go.__5__


# Print it out!

fig.show()

a)

'type'

b)

'bar'

c)

'layout'

d)

'title'

e)

Figure(monthly_sales)

1)
2)
3)
4)
5)
13.

# Create the bar plot

fig = px.bar(data_frame=__1__,

             __2__=__3__,

             y=__4__,

             __5__)


# Show the plot

fig.show()

a)

student_scores

b)

x

c)

'student_name'

d)

'score'

e)

title='Student Scores by Student'

1)
2)
3)
4)
5)
14.

# Create a simple histogram

fig = px.histogram(

            data_frame=__1__,

            # Set up the x-axis

            __2__=__3__,

            # Set the number of bins

            __4__=__5__)


# Show the plot

fig.show()

a)

revenues

b)

x

c)

'Revenue'

d)

nbins

e)

6

1)
2)
3)
4)
5)
15.

Statistics can be used to answer lots of different types of questions, but being able to identify which type of statistics is needed is essential to drawing accurate conclusions. Identify which questions can be answered with inferential statistics

a)

given data on all 100000 people who viewed an ad, what percent of people clicked on it?

b)

after interviewing 100 customers, what percent of all yout customers are satisfied with your product?

c)

given data on every customer service request made, what's the average time it took to respond?

d)

given data on 20 fish caught in a lake, what's the average weight of all fish in the lake?

16.

Organize these options into the right categories

Categorize the following

kilowatts of electricity used

air temeprature

number of items in stock

number of Purwadhika courses taken

Brand of a product

Zip code

Continous Numeric
Discrete Numeric
Categorical
17.

Scatter plots let you explore the relationship between two continuous variables.

Here you can see a scatter plot of average life expectancy (on the y-axis) versus average length of schooling (on the x-axis) for countries around the world. Each point in the plot represents one country. A straight trend line from a linear regression model is shown.


Categorize the following

there is + correlation between life expect & length of schooling

as the average length of schooling increases, average life expectancy typically increases too

there is a negative corr between the life expectancy & length of schooling

no country have an average length of schooling < 6 yrs & an average life expectancy of > 75 yrs

TRUE
FALSE
18.

What is the difference between mean and median?

a)

Mean is the middle value; median is the average.

b)


Mean is the average; median is the middle value.

c)

Both represent the average.

d)

Mean and median are used interchangeably.

19.

What does the term "confidence interval" represent in statistical analysis?


a)
  • The range of values within which a population parameter is estimated to lie

b)
  • The average of sample values

c)
  • The proportion of data falling within a specified range


d)
  • The standard error of the mean

20.

What is the purpose of correlation in data analysis?

a)

Causation between variables

b)

Describing the spread of data

c)

Measuring the strength and direction of a linear relationship

d)

Identifying outliers

21.

What does a histogram visualize?

a)


Relationships between two variables

b)

Distribution of a single variable

c)

Hierarchical data structures

d)

Time-series data

22.

What does the term "outlier" mean in data analysis?

a)

The most common value in a dataset

b)

Unusual or extreme values in a dataset

c)


The difference between mean and median

d)

The last value in a sorted dataset

23.

What is the primary goal of data analysis?

a)

Making predictions

b)

Summarizing and interpreting data

c)


Designing databases

d)


Data visualization

24.

What is the significance of the term "standard deviation"?


a)

Measuring central tendency

b)

Describing the spread or dispersion of data

c)

Identifying the most frequent value

d)

Representing the range of values

25.

kamu diminta untuk menuliskan regex di Python untuk mencocokkan email yang valid dengan format sebagai berikut:

  • Hanya boleh ada satu karakter "@".

  • Domain harus terdiri dari huruf dan angka.

  • Domain berakhiran dengan ".com" atau ".id".

  • Email harus dimulai dengan huruf atau angka, dan dapat mengandung karakter ".", "_", atau "-" setelahnya.

Manakah dari opsi regex berikut yang benar untuk mencocokkan email valid tersebut?

a)

a) r'^[a-zA-Z0-9]+[._-]?[a-zA-Z0-9]+@[a-zA-Z0-9]+\.(com|id)$'

b)

b) r'^[a-zA-Z0-9._-]+@[a-zA-Z]+\.(com|id)$'

c)

c) r'^[a-zA-Z0-9]+@[a-z]+\.(com|org|id)$'

d)

d) r'^[a-z0-9_]+@[a-z0-9]+\.(com|id)$'

26.

Di bawah ini adalah hasil uji normalitas dari variabel 'weight':

from scipy.stats import normaltest

normaltest(df['weight'])

NormaltestResult(statistic=46.08618081354447, pvalue=9.829082726891064e-11)

Pilihlah peryataan yang tepat mengenai uji di atas!

a)

a. Hasil uji normalitas di atas menunjukkan variabel ‘weight’ terdistribusi normal

b)

b. Hasil uji normalitas di atas menunjukkan variabel ‘weight’ terdistribusi tidak normal

c)

c. Method normaltest dari scipy di atas menggunakan metode Shapiro-Wilk

d)

d. Method normaltest dari scipy di atas menggunakan metode Kolmogorov-Smirnov