Knowee
Questions
Features
Study Tools

Write a query to display details of the travel_payment whose amount is greater than 30. Display the records in ascending order based on the entry_time.Note:1. Display all the columns present in the travel_payment table.2. Specify the condition and retrieve the correct rows in the result(condition need to be specified on amount column).3. You can compare your executed result with the sample output given below.4. Order by is mandatorySample output: [Only few records are shown here]

Question

Write a query to display details of the travel_payment whose amount is greater than 30. Display the records in ascending order based on the entry_time.Note:1. Display all the columns present in the travel_payment table.2. Specify the condition and retrieve the correct rows in the result(condition need to be specified on amount column).3. You can compare your executed result with the sample output given below.4. Order by is mandatorySample output: [Only few records are shown here]

...expand
🧐 Not the exact question you are looking for?Go ask a question

Solution

Here is the SQL query you need to write based on your requirements:

SELECT *
FROM travel_payment
WHERE amount > 30
ORDER BY entry_time ASC;

Let's break it down:

  • SELECT * means you're selecting all columns from the table.
  • FROM travel_payment specifies the table you're selecting the data from.
  • WHERE amount > 30 is the condition that the amount must be greater than 30.
  • ORDER BY entry_time ASC sorts the result in ascending order based on the entry_time column.

This problem has been solved

Similar Questions

Write a query to display travel_card_id, entry_time and exit_time from the travel_payment.Display the records in ascending order based on the entry_time.Note:1. Display only the column named travel_card_id, entry_time and exit_time present in the travel_payment table.2. Order by is mandatorySample output: [Only few records are shown here]

Write a query to display the travel_card_id, entry_station_id and sum of amount received between the entry_time dates 21-Dec-2017 and 23-Dec-2017. Give an alias name as total_payment. Display the records sorted in ascending order based on the travel_card_id.Note:1. Display only the travel_card_id, entry_station_id and sum of amount received between the given entry_time dates from travel_payment table.2. entry_time field is of datatype TIMESTAMP. So the values of entry_time will have both date and time. So here you have truncate the date part alone from the entry_time and then check for the date condition.3. Specify the alias name without any mistake.4. Order by is mandatory5. Compare your executed result with the sample output given below.

Write a query to display the person_name and the contact_number from travel_card table of every person whose destination station is on the route 'North East line' with the payment more than 25. Display the records in ascending order based on person name.Note:1. Display only the person_name and contact_number from the travel_card table whose travel_payment destination route North East line with amount >25.2. Tables involved are travel_card, travel_payment and station3. In travel_payment table, the exit_station_id must match with the station id with name ‘North East line’ and amount greater than 25.4. Order by is mandatory.5. Compare your executed result with the sample output given below.

Write a query to display the details of all the 'bill' with the due_date on '2017-10-01'.Display the records in descending order based on their payable_amount.Note:1. Display all the columns present in the bill table.2. Specify the condition and retrieve the correct rows in the result(condition need to be specified on due_date column).3. You can compare your executed result with the sample output given below.4. Order by is mandatorySample Output:  [Only few records are shown here]

Display only the travel_card_id, entry_station_id and sum of amount received between the given entry_time dates from travel_payment table.2. entry_time field is of datatype TIMESTAMP. So the values of entry_time will have both date and time. So here you have truncate the date part alone from the entry_time and then check for the date condition.3. Specify the alias name without any mistake.4. Order by is mandatory5. Compare your executed result with the sample output given below.

1/3

Upgrade your grade with Knowee

Get personalized homework help. Review tough concepts in more detail, or go deeper into your topic by exploring other relevant questions.