SQL
SQL
Impose all possible constraints on various fields. Enter sample data in the table
so created.
(MAXIMU
M)
(MINIMU
M)
(AVERAGE)
b) List customer details who live in city beginning with city name ‘A’.
QUES 3. Write SQL statements for creating a table
Customer.
Customer (cust _id, lastname, firstname, street, city, balance, credit Imt, sales
repno).
d) List customer details who live in city beginning with city name "A".
g) List customer details who have credit limit in the range 1 lakh to 5 lakhs.
j) List customer details who have credit limit beyond 10 lakhs in alphabetical
order of first name.
k) Add a new column customer-ranking.
QUES 4. Consider the sample tables:
Emp (empno,ename,job,sal,hiredate,deptno,comm)
c) Display employee name and department number for those hired between
January 1 1983 and January 1, 1982.
d) Display employee name, job and department number for all clerks and
analysts.
e) Display employee name, job, department number and hire date for those
whose name begins with capital letter 'M'.
f) Display employee name, job, department number and hire date for those
whose name begins with capital letter ‘J’ followed by two characters and
ending with 'ES’.
g) Display employee name, job and salary for managers and sales people
earning 2000 or more.
h) Display salary, job and employee names for department no. 10 in
descending salary order.
i) Display the employee names of those whose names contain the letter S.
j) Display employee names and salaries for those having salaries less than their
commission.
k) Display employees hired in 1981.
l) Display the names and jobs of all employees in department no. 10 and 20.
m) Display employees who are not clerks or salesmen