Create the following tables in sql:
1. Subjects
Sno. Subject_name
201 Accountancy
202 Business studies
203 Economics
204 Mathematics
205 English
2. Student
Rno. first_name last_name Address Gender Marks/100 Sno.
1 Reena Negi Saket F 90 202
2 Megha Kataria Gurgaon F 60 202
3 Sachin Tanwar Dwarka M 50 201
4 Tushar Yadav Rangpuri M 40 202
5 Ankit Kaushik Gurgaon M 45 205
6 Nikita Yadav Rajokari F 50 204
7 Heena Rajput Gurgaon F 75 202
8 Garv Rao Dwarka M 70 203
9 Himanshi Yadav Saket F 70 203
10 Rashi Godara Saket F 80 202
1. Solution
2.
Insert records in the above tables.
1. Solution
2.
List all information about all employees from student table.
Solution
List all information about subjects from subject table.
Solution
List all student names along with their gender from student table.
Solution
List the last names of the student studying subject 203.
Solution
List the female student studying subject 202.
Solution
List the names of student who are not female.
Solution
List the student names and marks, whose marks is between 40 and 80.
Solution
List the names whose start with ‘R’.
Solution
List the student name having ‘A’ as the second character.
Solution
List out the names students who are having marks more than 50 in subject business studies.
Solution
List the roll number, first name, marks in ascending order of the first name.
Solution
List the details of all student residing in gurgaon.
Solution
List the details of all student not residing in gurgaon.
Solution
List the details of all student residing in gurgaon and got marks more tham 50.
Solution
List the number of student studying.
Solution
List the maximum marks of a female student.
Solution
List the average marks in subject accountancy .
Solution
Write a query to inner join two tables to display the first name & subject name .
Solution