0% found this document useful (0 votes)
99 views2 pages

SQL Questions PDF

The document contains instructions for a mid-term SQL exam, asking students to write 4 SQL queries based on the data in 3 tables. The first question asks students to create a table. The second asks them to query an instructor table to find names and salaries ordered by salary for those with a high rank in a building containing "Jackson". The third asks them to query two tables to find IDs, names, locations, and maximum age for those in Mirpur/Dhanmondi making over $10,000 and aged 30-40 ordered by ID descending. The fourth asks them to query the two tables to find various attributes for those living in Dhaka district.

Uploaded by

Ridwan Kawser
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)
99 views2 pages

SQL Questions PDF

The document contains instructions for a mid-term SQL exam, asking students to write 4 SQL queries based on the data in 3 tables. The first question asks students to create a table. The second asks them to query an instructor table to find names and salaries ordered by salary for those with a high rank in a building containing "Jackson". The third asks them to query two tables to find IDs, names, locations, and maximum age for those in Mirpur/Dhanmondi making over $10,000 and aged 30-40 ordered by ID descending. The fourth asks them to query the two tables to find various attributes for those living in Dhaka district.

Uploaded by

Ridwan Kawser
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/ 2

Mid Term Exam

Time: 20 minutes
Send back your answer script by replying back to the email : [email protected]

1. Write the SQL statement for creating a table named “ country_data” containing the
attributes sequentially as Voter ID no, Name, Date_of_birth, Age, Height, Address,
Contact_number, Annual_earning, whereby the attributes Voter ID and Name are primary
keys of a table named “population_data” and attributes Address and Contact_number are
connected with a table named “contact_data”.

2. Table : Instructor

ID Name Faculty_building Rank Salary

123 A North Welson High 10,000


234 B South Jackson Mid 5,000
345 C North Watson High 12,000

For the above table, make a query statement to find out names and salary of the instructors in a
sequential manner of salary, who are high in ranked and sit in a building named similar as Jackson.

3. Table: Population_data

ID Name Location Contact no Age Monthly_income


12 A Mirpur 123454 34 10,000
13 B Dhanmondi 133255 35 20,000
14 C Mirpur 123452 31 12,000
15 D Dhanmondi 123425 30 15,000

Table: Country_data

ID District Age
12 Dhaka 35
13 Dhaka 36
14 Dhaka 32
15 Dhaka 30

For the above tables, write a query statement to find out the IDs, number of names ,
number of locations, maximum age of those people who are living in Mirpur and Dhanmondi
having a monthly salary more than 10,000 and ages ranges from 30 and 40 in a descending manner
of ID.
Mid Term Exam
Time: 20 minutes
Send back your answer script by replying back to the email : [email protected]

4. Table: Population_data

ID Name Location Contact no Monthly_salary


12 A Mirpur 123454 10,000
13 B Dhanmondi 133255 20,000
14 C Mirpur 123452 10,000
15 D Dhanmondi 123425 15,000

Table: Country_data

ID District Age
12 Dhaka 35
13 Dhaka 36
14 Dhaka 32
15 Dhaka 30

For the above tables, write a query statement if you want to find out the names, ID, annual
salary, total amount of salary, number of districts, average age in each location, of those people
who are living in Dhaka district.

You might also like