0% found this document useful (0 votes)
31 views

Tasks To Complete 1) : Table Countries

1) The document outlines tasks to complete related to creating and querying tables in a SQL database. This includes inserting data, retrieving specific records that meet criteria, aggregating results, and finding minimum/maximum values. 2) Instructions are provided to write SQL statements to query the "Grades" table to list students who scored over 90 in math, students who scored over 85 in all subjects, total marks for all students, average marks by subject, and minimum/maximum math scores. 3) Tasks are listed to query the "Resident" table, including listing all residents, details for a specific resident, age of a resident, residents over 50, between 20-35, and the youngest resident.

Uploaded by

Rifat Rahman
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
31 views

Tasks To Complete 1) : Table Countries

1) The document outlines tasks to complete related to creating and querying tables in a SQL database. This includes inserting data, retrieving specific records that meet criteria, aggregating results, and finding minimum/maximum values. 2) Instructions are provided to write SQL statements to query the "Grades" table to list students who scored over 90 in math, students who scored over 85 in all subjects, total marks for all students, average marks by subject, and minimum/maximum math scores. 3) Tasks are listed to query the "Resident" table, including listing all residents, details for a specific resident, age of a resident, residents over 50, between 20-35, and the youngest resident.

Uploaded by

Rifat Rahman
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 3

Tasks to complete

1)
Table countries
Here in the following is the structure of the table countries.

+--------------+---------------+------+-----+---------+-------+
| Field | Type | Null | Key | Default | Extra |
+--------------+---------------+------+-----+---------+-------+
| COUNTRY_ID | varchar(2) | YES | | NULL | |
| COUNTRY_NAME | varchar(40) | YES | | NULL | |
| REGION_ID | decimal(10,0) | YES | | NULL | |
+--------------+---------------+------+-----+---------+-------+
1. Write a SQL statement to insert a record with your own value
into the table countries against each columns.

2. Write a SQL statement to insert NULL values against


region_id column for a row of countries table.
3. Write a SQL statement to insert 3 rows by a single insert
statement.
4. Write a SQL statement to insert rows into the table countries
in which the value of country_id column will be unique and auto
incremented.
2)

Table Grades

ID Name Math Physics Literature


1 John 68 37 54
2 Jim 96 89 92
3 Bill 65 12 57
4 Jeri 69 25 82

Questions
1. A list of all students who scored over 90 on his or her math
paper?
2. A list of all students who scored more than 85 in all
subjects?
3. Find out total marks of all the students.
4. What are the average marks of the class for each subject?
5. What are the minimum marks in Math?
6. What are the maximum marks in Math?
7. Who got the highest marks in Math?
3)

Table Resident
Create a tables and include the residents

Questions
1) A list of all the residents.

2) All the details for resident Donald.

3) What is the age of the resident named Tweety?

4) A list of residents above 50 years old

5) A list of residents whom aged between 20 and 35.

6) Who is the youngest resident?

You might also like