CH2-Relational Data Model
CH2-Relational Data Model
CH2-Relational Data Model
Q: 2 Marks Question:
Q: 4 Marks Question:
ii) Insert row (5, ‘ABC’, ‘RRRRR’, 79) into student table.
Q: 6 Marks Question:
1. Consider the table Student (name, marks, dept, age, place, phone, birthdate) Write SQL query
for following :
(i) To list students having place as ‘Pune’ or ‘Jalgaon’.
(v) To list student name who have marks less than 40.
2. Write SQL queries for following. Consider table stud (roll no, name, subl, sub2, sub3).
(ii) Display names of students whose name start with 'A' by arranging them in ascending order of
subl marks.
Ans : select * from stud where name like ‘A%’ order by sub1;
(iii) Display student name whose name ends with h' and subject 2 marks are between 60 to 75.
Ans : select name from stud where name like ‘h%’ and Between 60 and 75.
Display details of employees whose age is greater than 50 and whose name contain 'e'.
Ans : select * from employees where age>50 and Emp_name like ‘%e%’;
5. Write a command to crate table student (rollno, Stud_name, branch, class, DOB, City,
Contact_no) and
Ans : SQL>Create table student( Rollno number(5), Stud_name char(10, branch varchar(10), class
varchar(10), DOB date, city varchar(15), Contact_no number(12) );
6. Consider following schema: EMP (empno, deptno, ename, salary, designation, join_date, DOB,
dept_location).
Write down SQL queries for following:
(ii) Display employee name & employee number whose designation is Manager.
Ans : SQL> select ename from EMP where salary=(select min(salary) from EMP);