Question: Sql derby Java Database String query= select count(*) from (select distinct FlightId, DayId from Bookings)); Count = connection.prepareStatement(query); What Is the correct prepare Statement syntax

Sql derby Java Database

String query= "select count(*) from (select distinct FlightId, DayId from Bookings))";

Count = connection.prepareStatement(query);

What Is the correct prepare Statement syntax to count the unique combinations of FlightId and DayID colums.

For instance counting how many times (0,0) appears

(0,1)

(0,2)

(1,0)

etc

Table name Bookings

Sql derby Java Database String query= "select count(*) from (select distinct FlightId,

10 11 12 BOOKINGID CUSTOMERID FLIGHTID DAYID 1 2 1 3 7 0 0 1 9 0 0 1 10 2 2 4 13 14

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!