Page 405 - Trackpad 402_Class-X_Final
P. 405

HALFYEARLY number(6,2)
                  TEACHER

                  Tcode varchar(5)  [primary key]
                  Tname varchar(20)

                  Subject varchar(10)
                  Class number(3)

                    After creating the above tables insert 10 records in each table. Give the command to insert a record in the
                  student table.

                  Write the SQL query for the above table:
                  a.  Display the structure of the table STUDENT, MARKS and TEACHER.

                  b.  Display all records from all three tables.
                  c.  Display only those students who live in ‘Delhi’.

                  d.  Display the details of the students whose Dob is in the year 2007.
                  e.  Display the total of Test1 and Test2 from MARKS table.

                  f.   Display the Admno, name and city in the descending order of the name from the STUDENT table.

                  g.  Display all details of Rollno from 10 to 30 from the MARKS table.
                  h.  Display only those teachers’ details from the TEACHER table where the class taught is either 9 or 10.

                  i.   Display only those teachers’ details from TEACHER table where subject taught is ‘Computer’.
                  j.   Display all teachers details in the ascending order of the class.

               2.  Follow the given instruction to complete the project:
                     The following table shows the members of a community centre.


                     Number          Last_Name        First_Name           DOB          Member_Type      Payment
                       001        Singh             Ashish               03/04/77      Senior                Y
                       002        Mirza             Gautam               16/06/92      Junior                N
                       003        Chouhan           Kunal                02/11/85      Senior                N

                       004        Chetan            Rahul                06/07/74      Senior                Y
                       005        Bhagat            Manish               12/10/89      Junior                Y

                  Create a query for community centre which wants to find the members according to the following criteria:

                     Member_Type is not ‘Senior’ and Payment is ‘N’.
                     Member_Type is not ‘Senior’ and Payment is ‘Y’.

                     Member_Type is not ‘Junior’ and Payment is ‘Y’.
                     Member_Type is not ‘Junior’ and Payment is ‘N’.






                                                                                                      Projects  405
   400   401   402   403   404   405   406   407   408   409   410