You are on page 1of 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