1 of 142

2 of 142

Write an SQL query to display:

The program id and program name of all the programs that belongs to the "Entertainment" category.

Your output should have column as given below.

3 of 142

Write an SQL query to display:

Build a query to display PatientName, PatientEmail, AdmissionDate, TotalBilling for each patient, include only patients with total billing amount (like above). TotalBilling is the total amount in descending order.

Your output should have 4 columns as given below:

PATIENTNAME PATIENTEMAIL ADMISSIONDATE TOTALBILLING

You can view the database schema by clicking the View Schema tab at the bottom of the query window on the right-hand side of the screen.

4 of 142

5 of 142

6 of 142

Write an SQL query to display:�The instructor's First Name and Last Name for instructors whose employment is full-time and whose last name starts with 'C'. Use Alias "First Name" and "Last Name".

Your output should have 2 columns as given below:�FirstNameLastName​​

You can view the database schema by clicking the View Schema tab at the bottom of the query window on the right-hand side of the screen.

7 of 142

8 of 142

VIEWERNAME

COUNTOFPROGRAMME

Write an SQL query to display:

The viewername and the count of programmes (use alias countofprogramme) the viewer watches.

Your output should have 2 columns as given below:

9 of 142

10 of 142

Name

Total_Quantity

Write an SQL query to display:

The total quantity sold for each product along with its name. Your output should have 2 columns as given below:

Collapse question

Name

Total_Quantity

11 of 142

Write an SQL query to display.

The programmeid and the number of viewers for each programme.

Your output should have 2 column as given below:

programmeid total_viewers

You can view the database schema by clicking the View Schema tab at the bottom of the query window on the right-hand side of the screen.

12 of 142

13 of 142

like_id

post_id

Question 1

How to Attempt?

Write an SQL query to display:�The like ID and post ID for the posts liked before "2024-02-20"

Your output should have column as given below.

You can view the database schema by clicking the View Schema tab at the bottom of the query window on the right hand side of the screen.

SELECT like_id, post_id FROM likes WHERE STR_TO_DATE(data, '%Y-%m-%d')

14 of 142

15 of 142

16 of 142

17 of 142

18 of 142

19 of 142

20 of 142

21 of 142

22 of 142

23 of 142

24 of 142

25 of 142

26 of 142

27 of 142

import ja

import

Magical Library

// R

class U

{

pu

In a magical library, each bookshelf is represented by a two-dimensional array A, where each row of the 2D array A[i] represents the series value of a book.

A row is considered magical if the sum of the odd values of the series of a book is even. Cor Your rows. task is to find and return an integer value representing the number of magical

Input Specification:

input1: An integer value representing the number of rows in the 2D array.

input2: An integer value representing the number of columns in the 2D array.

}

13

input3: A 2D integer array where each row represents a series of books.

Output Specification:

Return an integer value representing the number of magical rows.input2:3

input3: (11,2,3), (4.5.6), (7.8.91)

Output: 2

Explanation:

Here, the given 2D array is (11.2.3). (4.5.6) (7.8.9)

to the first row [1, 2, 3], the odd numbers are (1.3) and their sum is 4 which is even. In the second row (4,5, l, the odd numbers are (5) and as there is only one odd element so the aum is which is odd

In the third row [7, 8, 9), the odd numbers are (7, 9) and their sum is 16 which is

even Therefore, there are only 2 magical rows so. 2 is returned as the output.

Example 2:

input1:3

input2:2

input3: (12, 4), (0,0), (11,111)

Output: 1

Explanation:

Here, the given 2D given array ([2, 4), (0.0), (11, 11)).

-Only the last row (11, 11) has odd elements and their sum is 22 which is even. Therefore, there is only 1 magical row so, 1 is returned as the output.

28 of 142

How to Attempt?

You are given an integer array A of size N, where each element represents the light intensity at a certain point. A low-density light segment is defined as a continuous sequence of elements where the light intensity is less than or equal to a given threshold T. Your task is to find and return an integer value representing the count of how many low-density light segments exist in the array.

Input Specification:

ail.ee

input1: An integer value N representing the ramber of points.

input2: An integer array A representing light intensities at each point.

input3: An integer value T representing the threshold value Gm

4118@

Output Specification:

Return an integer value representing the count of how many low-density light segments exist in the array.

staval

Example 1:

Anvask

input1:8

input2: (3,1,4,2,1,7,5,3)

input3:3

Maker

Output: 3�main

Explanation:

Here, there are 8 number of points with light intensities as (3,1,4,2,1,7,5,3) and T as 3.

The low-density light segments where the intensity is less than or equal to 3 are:

  1. Segment: (3,1}
  2. Segment (2,1)
  3. Segment. (3)

Since there are 3 low-density light segments present, 3 is returned as the output.

ail.co

29 of 142

Example 2:

@gm

input1 : 7

input2: (6,5,4,3,2,1,0)

input3:3

118@

Output: 1

staval

Explanation:

Here, there are 7 number of points with light intensities as (6,5,4,3,2,1,0) and T as 3. The low-density light segments where the intensity is less than (6.843.2.1.0) and

  1. Segment: (3,2,1,0)

madis

Since there is only 1 low-density light segment present, 1 is returned as the output.

Metti Online Assessment © 2021-2031

Need Help? Contact us (Please add c

ali

Give python3 code for this function�#Read only region start

class UserMainCode(object):

@classmethod

def countLowDensitySegments(cls, input1, input2, input3):

input1: int

input2: int[]

input3:

int

Expected return type: int

Read only region end

write code here

pass

30 of 142

How to Attempt?

You are given a string S representing a sequence of alphabet characters. You have to identify all the occurrences of a "Consonant Wrap," where a vowel character is surrounded by two consonant characters on both sides. Your task is to count and return a string value representing how many Consonant Wrap exist in the string.

ع العد

Note: Only lowercase English letters will be used in the encrypted message.

go Input Specification:

input1: A string S containing lowercase characters.

2002

Output Specification:

199.20

Return a string value representing how many consonant wrap exist in the string.

priya

Example 1:

input1: hilgiop

adinip

Output: 1

nand

Explanation:

Here, the string S is "hilgiop". We can find the consonant wraps in the following�Give the code in java

31 of 142

32 of 142

33 of 142

34 of 142

35 of 142

36 of 142

37 of 142

38 of 142

39 of 142

40 of 142

41 of 142

42 of 142

43 of 142

44 of 142

45 of 142

46 of 142

47 of 142

48 of 142

49 of 142

50 of 142

51 of 142

52 of 142

53 of 142

54 of 142

55 of 142

56 of 142

57 of 142

58 of 142

59 of 142

60 of 142

61 of 142

62 of 142

63 of 142

64 of 142

65 of 142

66 of 142

67 of 142

68 of 142

69 of 142

70 of 142

71 of 142

72 of 142

73 of 142

74 of 142

75 of 142

76 of 142

77 of 142

78 of 142

79 of 142

80 of 142

81 of 142

82 of 142

83 of 142

84 of 142

85 of 142

86 of 142

87 of 142

88 of 142

89 of 142

90 of 142

91 of 142

92 of 142

93 of 142

94 of 142

95 of 142

96 of 142

97 of 142

98 of 142

99 of 142

100 of 142

101 of 142

102 of 142

How to Attempt?�Write an SQL query to display:�The first name, last name, and contact information of all passengers who have a boarding pass for a flight ID 5 and having Gluten-free meal preference.

Your output should have three columns as given below:�FirstNameLastNameContact​​

You can view the database schema by clicking the View Schema tab at the bottom of the query window on the right-hand side of the screen.

103 of 142

104 of 142

105 of 142

106 of 142

107 of 142

108 of 142

109 of 142

110 of 142

111 of 142

112 of 142

113 of 142

114 of 142

115 of 142

116 of 142

117 of 142

118 of 142

119 of 142

120 of 142

121 of 142

122 of 142

123 of 142

124 of 142

125 of 142

126 of 142

127 of 142

128 of 142

129 of 142

130 of 142

131 of 142

132 of 142

133 of 142

134 of 142

135 of 142

136 of 142

137 of 142

138 of 142

139 of 142

140 of 142

141 of 142

142 of 142