Database Overview (SQL & Query)
Database Overview (SQL & Query)
NO. OF FIELDS: 8
NO OF RECORDS :7
PRIMARY FIELD: the field that cannot have repeating values is called a
primary field. Primary field in this case is the STUDENT-ID.
Even though in this table FIRST-NAME does not have repeating values,
but, since there is a possibility of repeating values, we do not take it as
a primary field
FIELD NAME DATATYPE
STUDENT-ID INTEGER
FIRST-NAME ALPHANUMERIC
LAST-NAME ALPHANUMERIC
AGE REAL
CLASS INTEGER
SECTION ALPHANUMERIC
FEE-PAID BOOLEAN
PAYMENT-MADE REAL
Query by example table:
This query by example outputs the STUDENT-ID, FIRST-NAME, LAST-NAME, CLASS AND SECTION of all
students who have an age less than 13. This arranges the students in descending order according to
their first name
This query by example outputs the STUDENT-ID, FIRST-NAME, LAST-NAME, CLASS AND SECTION of all
students who have an age less than 13. This arranges the students in descending order according to
their first name
* ALI, SALAAR AND AYAAN FULFIL THE CRITERIA OF <13 AGE SINCE
This query by example outputs the STUDENT-ID, FIRST-NAME, LAST-NAME, CLASS AND SECTION of all
students who have an age less than 13. This arranges the students in descending order according to
their first name
* ALI, SALAAR AND AYAAN FULFIL THE CRITERIA OF <13 AGE SINCE
This query by example outputs the STUDENT-ID, FIRST-NAME, LAST-NAME, CLASS AND SECTION of all
students who have an age less than 13. This arranges the students in descending order according to
their first name
This query by example outputs the STUDENT-ID, FIRST-NAME, LAST-NAME, CLASS AND SECTION of all
students who have an age less than 13 OR their class is less than 8. This arranges the students in
descending order according to their first name
* ALI, SALAAR AND AYAAN FULFIL THE CRITERIA OF <13 AGE, WHEREAS ABDUL WAHAB FULFILS THE CRITERIA OF GRADE <8.
SINCE THE OR FUNCTION IS APPLIED. IF ANY OF THE CRITERIAS IS MET, THE OUTPUT WILL BE GIVEN
This query by example outputs the STUDENT-ID, FIRST-NAME, LAST-NAME, CLASS AND SECTION of all
students who have an age less than 13 AND their class is less than 8. This arranges the students in
descending order according to their first name
* ALI, SALAAR AND AYAAN FULFIL THE CRITERIA OF <13 AGEAS WELL AS OF GRADE <8. SINCE THE AND FUNCTION IS APPLIED.
ONLY WHEN BOTH THE CRITERIA ARE MET, WE GET AN OUTPUT
This query by example outputs the STUDENT-ID, FIRST-NAME, LAST-NAME, CLASS AND SECTION of all
students who have an age less than 13 AND their class is less than 8 AND THE FEE HAS BEEN PAID. This
arranges the students in descending order according to their first name.
* ALI AND SALAAR FULFIL THE CRITERIA OF <13 AGE AND GRADE <8 AND FEE-PAID =Y. SINCE THE AND FUNCTION IS APPLIED. IF
ALL OF THE CRITERIA IS MET THE OUTPUT WILL BE GIVEN
This query by example outputs the STUDENT-ID, FIRST-NAME, LAST-NAME, CLASS AND SECTION of all
students who have an age less than 13 AND their class is less than 8 OR THE FEE HAS BEEN PAID. This
arranges the students in descending order according to their first name.
* * ALI, SALAAR AND AYAAN FULFIL THE CRITERIA OF <13 AGE AS WELL AS OF GRADE <8 ALI WAHAB AND MUJTABA FULFIL THE
CRITERIA OF FEE PAID. SINCE THE OR FUNCTION IS APPLIED. IF ANY OF THE CRITERIA IS MET, THE OUTPUT WILL BE GIVEN
SELECT SUM(PAYMENT-MADE)
FROM STUDENT
This will output: 145000