Download as TXT, PDF, TXT or read online on Scribd
You are on page 1/ 2
1)Consider following schema Employee (E_id, E_name, Salary, Department) Write SQL
commands for the following statement.
i.Find Summation of salary for all employees. ii.Display Minimum and Maximum Salary. iii.Display all records in descending order of Employee name. iv.Display employee name working in department “Quality” 2) Create table for following schema. i.Student (Enroll_no, Roll_no, Name, Percentage) ii.Worker(W_id, W_name, Joining_Date, Department) iii.Book (Book_id, Book_name, Author, Price, ISBN) 3)Consider a given Schema. Write SQL Command for following statement. Product (P_id, Name, Quantity, Price) Supplier(S_id, S_name, P_id, Contact_no) Manufacturer(M_id, M_name, Owner, City) i.Increase Price of all products by 20% having product id P-123. ii.Change contact_no for S-123 supplier with new number as “9876543210”. iii.Add following record for new manufacturer. Id = 123, name = xyz , Owner = jack , city = Delhi iv.Display records of products supplied by supplier S-125. v.Eliminate Supplier with Supplier id S-126. vi.Display all manufacturers whose name starts with ‘A’. 4)Write SQL Statement for following: i.Create table Vehicle with attribute (V_id, Chassis_No, Type, Number_Of_Wheels) use Chassis_No as primary key. ii.Add one attribute to Vehicle Table as (Number_Of_Axle) . 5)Consider schema Candidate (C_id, Seat_no, Name, Score, City) i.Write SQL Command for following ii.Display Candidate who scored between 60 and 70 Marks. iii.Display Candidate whose city is either Pune or Mumbai. iv.Produce record of candidate who belongs to Nashik and scored more than 60 marks. v. Change the city of candidate C_10 from Pune to Mumbai. 6)Consider following schemas: Student {rollno, name dt_of_birth, telephone} marks {rollno, sub1_marks, sub 2_marks, per} Write SQL queries for following: i.Display student’s rollno, name and marks of both subjects for all students. ii.Delete all those students records who secured less than 35%. iii.Display all students whose name starts with ‘A’ iv.Update telephone number of student with rollno 101 as 9800010111. 7)Write SQL statements for following: i.Create table student with rollno, name, d-o-b, percentage, assign rollno as primary key. ii.Add new column email in student table. iii.Delete table ‘student’ with its structure and data. 8)Consider following schema: employee {empid, empname, designation, salary, deptno.} dept {deptno, deptname, location} Write SQL queries for following: i.Find maximum salary for deptno 10. ii.Increase salary of all employees by 5% iii.Get the names of all ‘‘Manager’’. iv.Display deptnames located at ‘Pune’ and ‘Nagpur’. 9)Write SQL statements for the following: i.Create the table named as student with field as roll no, name, address, DOB and percent. ii.Add a column ‘city’ to student table. iii.Change the name of ‘student’ table to ‘Student_Info’. iv.Remove/delete the data or records from student into table. 10)Consider the following data base schema student (roll_no, name, city, marks, result). Write queries for the following: i.Display all students having result as first class. ii.Update roll_no of each student by adding 18 to it. iii.Delete percent column from table. iv.Display students whose city is ‘Mumbai’