Questions
I need to answer all 16 questions. Please do as many as you can. Please answer...

I need to answer all 16 questions. Please do as many as you can.

Please answer the following question of database management.
1. Describe the process of creating a table in SQL and the different data types you can use for fields.

2. What is the purpose of the WHERE clause in SQL? Which comparison operators can you use in a WHERE clause?
3. How do you write a compound condition in an SQL query? When is a compound condition true?

4. What is a computed field? How can you use one in an SQL query? How do you assign a name to a computed field?

6. How do you use the IN operator in an SQL query?

7. How do you sort data in SQL? When there is more than one sort key, how do you indicate which one is the major sort key? How do you sort data in descending order?


8. What are the SQL built-in functions? How do you use them in an SQL query?

9. What is a subquery? When is a subquery executed?


10. How do you group data in SQL? When you group data in SQL, are there any restrictions on the items that you can include in the SELECT clause? Explain.


11. How do you join tables in SQL?

12. In a complex join, how is the number of tables you wish to join related to the number of WHERE conditions?

13. How do you qualify the name of a field in an SQL query? When is it necessary to do so?

14. How do you take the union of two tables in SQL? What criteria must the tables meet to make a union possible?

15. Describe the three update commands in SQL.

16. How do you save the results of an SQL query as a table?

In: Computer Science

"Write a function named "firstLast2" that takes as input a vector of integers. The function should...

"Write a function named "firstLast2" that takes as input a vector of integers. The function should return true if the vector starts and ends with the digit 2. Otherwise, it should return false. Test your function with vectors of different length and with the digit 2 at the beginning of the vector, end of the vector, middle of the vector, and missing from the vector."

Additional Requirements:

>Must use a loop allowing the user to continue until he/she quits.

>Read the full name, middle (if there is any) and last name separately.

>Must work even if there is no middle name.

In: Computer Science

prove A(A+B) = A using truth table

prove A(A+B) = A using truth table

In: Computer Science

Write a MARIE program that asks the user for a beginning and an ending address of...

Write a MARIE program that asks the user for a beginning and an ending address of an array in the memory and checks whether the sequence of integers in between these memory locations is a palindrome. Output 1 on the screen if you conclude it is a palindrome. Add comments to your program.

In: Computer Science

2. a. Choose all of the following that apply to DynamoDB: (a) DynamoDB is part of...

2.

a. Choose all of the following that apply to DynamoDB:

(a) DynamoDB is part of RDS

(b) Is stored in 3 different locations

(c) Does not support joins, foreign keys and complex queries

(d) Supports Local and Global secondary indexes

(e) Users can manage DynamoDB in the backend (add CPU, memory, etc)

(f) Utilizes partition key to spread data across partitions for scalability

b. Which of the following standard is used by MongoDB to store documents internally?

(a) BSON

(b) JSON

(c) Extended JSON

(d) SQL

In: Computer Science

I asked this question before, but I'm wondering if there are any other ways to do...

I asked this question before, but I'm wondering if there are any other ways to do this problem. My exam will be similar to this, so I'm looking for more examples to study with. Thank you!

For this Java program, you will write two classes: GradeCalculator and GradeCalculatorDriver.

In the GradeCalculator class, compute the final average and letter grade for a particular student.

The final average is calculated according to the following rules:

1) There are ten exams scored out of 100 points

2) The lowest exam score is not included in the calculation of the final average

3) The highest exam score is not included in the calculation of the final average

4) An average of 91-100 is an A

5) An average of 81-90 is a B

6) An average of 71-80 is a C

7) An average of 61-70 is a D

8) An average of 0-60 is an E

The GradeCalculator class must include the following methods:

1) A method to compute and return the highest score

2) A method to compute and return the lowest score

3) A method to compute the sum of all the scores

4) A method to compute the final average

5) A method to determine the letter grade

In the GradeCalculatorDriver class, include a main method that asks the user for the student’s name and their ten exam grades, reads the grades, calculates the letter grade and prints it. This process should be repeated until the user enters N.

For example, a run of the program might look something like this:

Welcome to Score Calculator

Want to compute a final average? Y

Please enter the student’s name: Sara Smith

Please enter test scores all on one line separated by one or more spaces.

The final score for Sara Smith is 100.

The letter grade for Sara Smith is A.

Want to compute another final average? N

In: Computer Science

Can you please Describe your actions as the Manager, and how you would manage the project...

Can you please Describe your actions as the Manager, and how you would manage the project team's stress levels? but meeting the required dates.

Can you please Describe in detail, how dealing with short deadlines??..... will need to be compensated in the teams focus ?as well as how you will ensure that this is accomplished?

***(G) Greenberg, Jerald and Baron, Robert, Behavior in Organizations, 10th Edition, Prentice Hall, Upper Saddle River, NJ 2008. ISBN 9780136090199.

***(H) Humphrey, Watts S., Managing Technical People, Addison-Wesley, Reading, MA 1997. ISBN 9780201545975

***Please use the book resource if you can ? and APA for another website resource,

*250 words response please!

In: Computer Science

Suppose we have a collection of n different subsets of the set { 1, 2, ...,...

Suppose we have a collection of n different subsets of the set { 1, 2, ..., n } and they are in some arbitrary order, that is, we have subsets S1, S2, ..., Sn, but how many and which elements are in each of these subsets is entirely arbitrary. Suppose also that we have another subset S' of { 1, 2, ..., n }.

(a) Express a brute-force algorithm that determines whether S' equal to one of the subsets in the collection.

(b) Give a big-O worst case estimate as a function of n for the time complexity of your algorithm. To receive full credit, you must explain how you obtained your answer.

In: Computer Science

def read_list(): """ This function should ask the user for a series of integer values (until...

def read_list():

"""

This function should ask the user for a series of integer values (until the user enters 0 to stop) and store all those values in a list. That list should then be returned by this function.

"""

def remove_duplicates(num_list):

"""

This function is passed a list of integers and returns a new list with all duplicate values from the original list remove.

>>> remove_duplicates([1, 2, 3, 2, 3, 4])

[1, 2, 3, 4]

>>> remove_duplicates([1, 1, 1])

[1]

>>> remove_duplicates([])

[]

"""

def main():

num_list = read_list()

print("Original list entered by user: ")

print(num_list)

no_duplicates = remove_duplicates(num_list)

print("List with duplicates removed: ")

print(no_duplicates)

In: Computer Science

C# 1. Create an Employee class with two fields: idNum and hourlyWage. The Employee constructor requires...

C#

1. Create an Employee class with two fields: idNum and hourlyWage. The Employee constructor requires values for both fields. Upon construction, thrown an ArgumentException if the hourlyWage is less than 7.50 or more than 50.00. Write a program that establishes, one at a time, at least three Employees with hourlyWages that are above, below, and within the allowed range. Immediately after each instantiation attempt, handle any thrown Exceptions by displaying an error message. Save the file as EmployeeExceptionDemo.cs.

2. Write an application that creates an array of five Employees. Prompt the user for values for each field for each Employee. If the user enters improper or invalid data, handle any exceptions that are thrown by setting the Employee’s ID number to 999 and the Employee’s pay rate to the $7.50. At the end of the program, display all the entered, and possible corrected, records. Save the file as EmployeeExceptionDemo2.cs.

In: Computer Science

Write this in c++ Leap year and Second in year program Whether a year is a...

Write this in c++

Leap year and Second in year program

  1. Whether a year is a leap year on not a leap year.
  2. The number of seconds in a year. (FYI, it will be a different amount for leap vs non-leap year.) You can calculate the seconds by whatever means you choose, whether with defined constants and calculations or just calculations. It is your choice.
  3. If the user inputs a year number greater than zero, the program returns how many seconds were or will be in that year.
  4. Put in descriptions for your request for input. If you do the bonus portion, also put that in for your request.
  5. Tell the user that an input of -99 ends the program. (+5)
    Put your prompt in a loop, asking the user each time what year to check. (+5)
  6. You should assume a day length of exactly 24 hours. Obviously, multiplying 365*24*3600 isn’t exactly a programming challenge, and it won’t even give the right answer for all years.
  7. You must take account of leap years, which means your years will not all have the same number of days. If you do not already know, here is the calculation for leap years:

1. If a year is divisible by 4 with no remainder, it is a leap year,
2. unless it is a centurial year (ending in 00).
3. Then it is not a leap year,
4. unless it is a year divisible by 400, in which case it is still a leap year.

For example:

1904 is a leap year—evenly divisible by 4.
1900 is not a leap year—it is evenly divisible by 4, and also evenly divisible by 100. However, it is not evenly divisible by 400.
2000 is a leap year— it is evenly divisible by 4, evenly divisible by 100, but also evenly divisible by 400.
Your calculation should ignore all other variations in the length of the calendar year, such as leap seconds or the change from the Julian to the Gregorian system.

In: Computer Science

C++ ! Create a Stash class specifically for storing Rect objects and call it RectStash. Add...

C++ !

Create a Stash class specifically for storing Rect objects and call it RectStash. Add a default constructor and a destructor to correctly initialize your RectStash class. Then write a program that will read several lines as input. Each line will contain 4 floats defining a 2D rectangle in the Rect format described above. Read the rectangles adding them to a RectStash object. Stop reading rectangles when your program loads 4 negative float values. After this point you will start reading a series of 2D points, and for each 2D point you will print the classification of each point in respect to all previously read rectangles. The classification should print "in" or "out" according to its result. Stop your program when you read vector (-99,-99).

Everything should be contained in one file. You may not assume the existance of any header files in your working directory.

Sample Input:

-5 -5 2.5 2.5
5 8 2 2
-1 -1 -1 -1
0 0
-4 -6
6 9
-99 -99

result:

out out
in out
out out

In: Computer Science

How to run the following code in ecclipse IDE? MQTT PUBLISH - SUBSCRIBE MODEL CODE IN...

How to run the following code in ecclipse IDE?

MQTT PUBLISH - SUBSCRIBE MODEL CODE IN JAVA

(slide 29)public class Publisher
{
public static final String BROKER_URL = "tcp://broker.mqttdashboard.com:1883";
private MqttClient client;

public Publisher()
{

String clientId = Utils.getMacAddress() + "-pub";
try
{
client = new MqttClient(BROKER_URL, clientId);
}
catch (MqttException e)
{
e.printStackTrace();
System.exit(1);
}
}
}
//connecting client (slide 30)

MqttConnectOptions options = new MqttConnectOptions();
options.setCleanSession(false);
options.setWill(client.getTopic("home/LWT"), //helps detecting failures of other clients
"I'm gone".getBytes(), 2, true);

client.connect(options);

//the busniness logic (slide 31)
public static final String TOPIC_TEMPERATURE = "home/temperature";

//...
while (true)
{
publishBrightness();
Thread.sleep(500);
publishTemperature();
Thread.sleep(500);
}
//...

private void publishTemperature() throws MqttException {
final MqttTopic temperatureTopic = client.getTopic(TOPIC_TEMPERATURE);

final int temperatureNumber = Utils.createRandomNumberBetween(20, 30);
final String temperature = temperatureNumber + "°C";

temperatureTopic.publish(new MqttMessage(temperature.getBytes()));
}

//publishBrightness() will be implemented the same way publishTemperature() is


//implementing the subscribing client

public class SubscribeCallback implements MqttCallback(slide 32)
{

@Override
public void connectionLost(Throwable cause) {}

@Override
public void messageArrived(MqttTopic topic, MqttMessage message)
{
System.out.println("Message arrived. Topic: " + topic.getName() + " Message: " + message.toString());

if ("home/LWT".equals(topic.getName()))
{
System.err.println("Sensor gone!");
}
}

@Override
public void deliveryComplete(MqttDeliveryToken token) {}

}

\\make it known to the MqttClient before connecting (slide 34)

mqttClient.setCallback(new SubscribeCallback());
mqttClient.connect();
mqttClient.subscribe("home/#");

In: Computer Science

Write a C program which adds up all the numbers between 1 and 50. Use any...

Write a C program which adds up all the numbers between 1 and 50. Use any type of loop

In: Computer Science

Write a JavaScript program to implement the Least-Squares Linear Regression algorithm shown below, for an arbitrary...

Write a JavaScript program to implement the Least-Squares Linear Regression algorithm shown below, for an arbitrary set of ( x, y ) data points entered by the user.

Least-Squares Linear Regression: • Linear regression basically means finding the ( equation for the ) straight line that is the closest “fit” to a set of ( x, y ) data points.

• Least-squares is a means of identifying the “best” fit between the line and the data. For each data point, the distance between the point and the line is calculated and squared, and the total of these squared distances is added up over all the data points. The straight line that yields the minimum value for this sum of squares is defined as the best fit.

• calculate the correlation coefficient, r, which is a metric for how well the line fits the data, and if the correlation is positive or negative. This value always lies between -1.0 and 1.0 inclusive. The closer it is to 1.0, the stronger the positive correlation; The closer to -1.0 the stronger the negative correlation; and if the coefficient is close to zero, then it shows a weak correlation ( if any ) between x and y.

The Algorithm: 1. Read in a series of ( x, y ) data pairs. While doing so, calculate the following sums:

• N = number of data pairs.

• Sx = ∑ x = Summation ( total ) of all X values.

• Sy = ∑ y = Summation ( total ) of all Y values.

• Sxx = ∑ x2 = Summation ( total ) of all X2 values.

• Syy = ∑ y2 = Summation ( total ) of all Y2 values.

• Sxy = ∑ xy = Summation ( total ) of all X∙Y values.

2. Then calculate: • Slope, m = ( N ∙ Sxy – Sx ∙ Sy ) / ( N ∙ Sxx – Sx ∙ Sx ) • Intercept, b = ( Sy – m ∙ Sx ) / N

3. Report the best-fit line as y = m x + b

4. Finally calculate and report the correlation coefficient, r, as:

• ? = ? ∙ ???−?? ∙ ?? /√( ? ∙ ???−?? ∙ ?? ) ∙ ( ? ∙ ???−?? ∙ ?? )

In: Computer Science