Showing posts with label guidbm. Show all posts
Showing posts with label guidbm. Show all posts
Thursday, September 15, 2011
Sunday, September 11, 2011
(3rd IT)Experiment No 7,8,9,10
Experiment No. 7
Q-1> Retrieve emp name and job who have the same job as that of allen?
Q-2> List all emp name and their job of those depts. That are located at Chicago?
Q-3> List all emp name and sal whose sal is greater then that of all managers?
Q-4>display all emp names and sal where sal is less then that of any manager of any dept?
Q-5> List all emp name, dept names and location whose deptno is common in both dept table and emp table?
Q-6> List all jobs in dept 10 and 20 or in both?
Q-7> List all jobs which are common in dept 10 and 20 ?
Q-8> List all jobs which are present in dept 10 but not in dep 20?
Experiment No. 8
Q-1> Display emp name as job and working form hiredate?
In the following format:
SMITH is CLERK and working from17-DEC-80
Q-2> To get all the employees whose salary is greater than the average salary of the company.
Q-3> To select all the employees who do the same job as that of Scott.
Q-4> To see all details of depts. Who have employees working in it.
Q-5> To find names and salary details of all employees whose salary is equal to the salary given to an employee working in dept no. 30
Q-6> To select the employees whose salary is greater than the salary of all employees working in dept no. 30
Q-7> To list all details of dept which has at least one employ assigned to it.
Experiment No. 9
Q-1> Create unique index on job on the emp table.
Q-2> Remove the index created for the emp table.
Q-3> Create view on emp displaying deptno , dept name , sal , job.
Q-4> Drop the above view.
Q-5> Create view on emp displaying ename , job ,sal in dept 10.
Q-6> Drop the above view.
Q-7> Create view on emp to display sum of salary grouped according to deptno?
Q-8> Drop the above view?
Q-9> Create view on appropriate tables to display ename , job , sal , dept name?
Q-10> Drop the above view?
Experiment No. 10
Q-1> To find out average minimum and maximum salary of each dept.
Q-2> To find out average maximum and minimum salary of departments where average salary is greater than 2000.
Q-3> To list the minimum salary to various categories of employees.
Q-4> To find the minimum salaries of various categories of employees in various depts.
Q-5> To find the minimum salaries of various categories of employees, department wise such that minimum salary is greater than 1500.
Q-6> To find the minimum salary of managers in various depts.
Q-7> To find the minimum salary of managers in various depts. Having salary greater than 2500.
Q-8> To list all employees in the ascending order by name.
Q-9> To select all employees sorted dept wise in ascending order and within dept salary wise in descending order.
Q-10> To select all employees sorted dept wise in ascending order and within dept salary wise in descending order for dept no. 10 and 20.
Q-11> To select all employees along with their annual salary sorted on the basis of annual salary.
Q-1> Retrieve emp name and job who have the same job as that of allen?
Q-2> List all emp name and their job of those depts. That are located at Chicago?
Q-3> List all emp name and sal whose sal is greater then that of all managers?
Q-4>display all emp names and sal where sal is less then that of any manager of any dept?
Q-5> List all emp name, dept names and location whose deptno is common in both dept table and emp table?
Q-6> List all jobs in dept 10 and 20 or in both?
Q-7> List all jobs which are common in dept 10 and 20 ?
Q-8> List all jobs which are present in dept 10 but not in dep 20?
Experiment No. 8
Q-1> Display emp name as job and working form hiredate?
In the following format:
SMITH is CLERK and working from17-DEC-80
Q-2> To get all the employees whose salary is greater than the average salary of the company.
Q-3> To select all the employees who do the same job as that of Scott.
Q-4> To see all details of depts. Who have employees working in it.
Q-5> To find names and salary details of all employees whose salary is equal to the salary given to an employee working in dept no. 30
Q-6> To select the employees whose salary is greater than the salary of all employees working in dept no. 30
Q-7> To list all details of dept which has at least one employ assigned to it.
Experiment No. 9
Q-1> Create unique index on job on the emp table.
Q-2> Remove the index created for the emp table.
Q-3> Create view on emp displaying deptno , dept name , sal , job.
Q-4> Drop the above view.
Q-5> Create view on emp displaying ename , job ,sal in dept 10.
Q-6> Drop the above view.
Q-7> Create view on emp to display sum of salary grouped according to deptno?
Q-8> Drop the above view?
Q-9> Create view on appropriate tables to display ename , job , sal , dept name?
Q-10> Drop the above view?
Experiment No. 10
Q-1> To find out average minimum and maximum salary of each dept.
Q-2> To find out average maximum and minimum salary of departments where average salary is greater than 2000.
Q-3> To list the minimum salary to various categories of employees.
Q-4> To find the minimum salaries of various categories of employees in various depts.
Q-5> To find the minimum salaries of various categories of employees, department wise such that minimum salary is greater than 1500.
Q-6> To find the minimum salary of managers in various depts.
Q-7> To find the minimum salary of managers in various depts. Having salary greater than 2500.
Q-8> To list all employees in the ascending order by name.
Q-9> To select all employees sorted dept wise in ascending order and within dept salary wise in descending order.
Q-10> To select all employees sorted dept wise in ascending order and within dept salary wise in descending order for dept no. 10 and 20.
Q-11> To select all employees along with their annual salary sorted on the basis of annual salary.
Thursday, September 8, 2011
Tuesday, August 23, 2011
Assignment No.1
Q.1. Construct an E-R diagram for a car-insurance company whose customers own
one or more cars each. Each car has associated with it zero to any number of
recorded accidents.
Q.2. Construct an E-R diagram for a hospital with a set of patients and a set of medical doctors. Associate with each patient a log of the various tests and examinations conducted.
Q.3. A university registrar’s office maintains data about the following entities: (a)courses, including number, title, credits, syllabus, and prerequisites; (b) course offerings, including course number, year, semester, section number, instructor(s), timings, and classroom; (c) students, including student-id, name, and program; and (d) instructors, including identification number, name, department, and title. Further, the enrollment of students in courses and grades awarded to students in each course they are enrolled for must be appropriately modeled. Construct an E-R diagram for the registrar’s office. Document all assumptions that you make about the mapping constraints.
Q.4. Consider a database used to record the marks that students get in different exams of different course offerings.
a. Construct an E-R diagram that models exams as entities, and uses a ternary
relationship, for the above database.
b. Construct an alternative E-R diagram that uses only a binary relationship between students and course-offerings. Make sure that only one relationship exists between a particular student and course-offering pair, yet you can represent the marks that a student gets in different exams of a course offering.
Q.5. Design an E-R diagram for keeping track of the exploits of your favourite sports team. You should store the matches played, the scores in each match, the players in each match and individual player statistics for each match. Summary statistics should be modeled as derived attributes
one or more cars each. Each car has associated with it zero to any number of
recorded accidents.
Q.2. Construct an E-R diagram for a hospital with a set of patients and a set of medical doctors. Associate with each patient a log of the various tests and examinations conducted.
Q.3. A university registrar’s office maintains data about the following entities: (a)courses, including number, title, credits, syllabus, and prerequisites; (b) course offerings, including course number, year, semester, section number, instructor(s), timings, and classroom; (c) students, including student-id, name, and program; and (d) instructors, including identification number, name, department, and title. Further, the enrollment of students in courses and grades awarded to students in each course they are enrolled for must be appropriately modeled. Construct an E-R diagram for the registrar’s office. Document all assumptions that you make about the mapping constraints.
Q.4. Consider a database used to record the marks that students get in different exams of different course offerings.
a. Construct an E-R diagram that models exams as entities, and uses a ternary
relationship, for the above database.
b. Construct an alternative E-R diagram that uses only a binary relationship between students and course-offerings. Make sure that only one relationship exists between a particular student and course-offering pair, yet you can represent the marks that a student gets in different exams of a course offering.
Q.5. Design an E-R diagram for keeping track of the exploits of your favourite sports team. You should store the matches played, the scores in each match, the players in each match and individual player statistics for each match. Summary statistics should be modeled as derived attributes
Sunday, July 31, 2011
Experiment No. 1
Experiment No. 1
Q-1> Write a query in sql to create a table employee and department.
Employee(empno,ename,deptno,job,hiredate)
Dept(deptno,dname,loc)
Include the following constraints on column of emp table.
a) to make the empno as primary key of the table and
b) to ensure that the ename column does not contain NULL values and
c) the job column to have only UPPERCASE entries and
d) to put the current date as default date in hire date column in case data is not supplied for the column.
Include the following constraints on column of dept table.
a) to make deptno as primary key.
b) to ensure dname,loc coloumns does not contain NULL values
Also enforce REFERENTIAL INTEGRITY, declare deptno field of dept table as primary key and deptno field of emp table as foreign key.
Q-2> Modify the above table to add three more columns salary,mgr,comm to the emp table. add salary column with constraint greater than zero and modify the width of sal column.
Q-3> Insert following values in employee table.
EMPNO ENAME JOB MGR HIREDATE SAL COMM DEPTNO
7369 SMITH CLERK 7902 17-DEC-80 800 20
7499 ALLEN SALESMAN 7698 20-FEB-81 1600 300 30
7521 WARD SALESMAN 7698 22-FEB-81 1250 500 30
7566 JONES MANAGER 839 02-APR-81 2975 20
7654 MARTIN SALESMAN 7698 28-SEP-81 1250 1400 30
7698 BLAKE MANAGER 7839 01-MAY-81 2850 30
7782 CLARK MANAGER 7839 09-JUN-81 2450 10
7788 SCOTT ANALYST 7566 19-APR-87 3000 20
7839 KING PRESIDENT 17-NOV-81 5000 10
7844 TURNER SALESMAN 7698 08-SEP-81 1500 0 30
7876 ADAMS CLERK 7788 23-MAY-87 1100 20
7900 JAMES CLERK 7698 03-DEC-81 950 30
7902 FORD ANALYST 7566 03-DEC-81 3000 20
7934 MILLER CLERK 7782 23-JAN-82 1300 10
Q-4> Edit the commission of JONES to 1000.
Q-5> Retrieve all rows of employee table.
Q-6> Delete row from employee table where deptno is 10.
Q-7> Delete all rows from employee table then Drop the emp table.
Q-1> Write a query in sql to create a table employee and department.
Employee(empno,ename,deptno,job,hiredate)
Dept(deptno,dname,loc)
Include the following constraints on column of emp table.
a) to make the empno as primary key of the table and
b) to ensure that the ename column does not contain NULL values and
c) the job column to have only UPPERCASE entries and
d) to put the current date as default date in hire date column in case data is not supplied for the column.
Include the following constraints on column of dept table.
a) to make deptno as primary key.
b) to ensure dname,loc coloumns does not contain NULL values
Also enforce REFERENTIAL INTEGRITY, declare deptno field of dept table as primary key and deptno field of emp table as foreign key.
Q-2> Modify the above table to add three more columns salary,mgr,comm to the emp table. add salary column with constraint greater than zero and modify the width of sal column.
Q-3> Insert following values in employee table.
EMPNO ENAME JOB MGR HIREDATE SAL COMM DEPTNO
7369 SMITH CLERK 7902 17-DEC-80 800 20
7499 ALLEN SALESMAN 7698 20-FEB-81 1600 300 30
7521 WARD SALESMAN 7698 22-FEB-81 1250 500 30
7566 JONES MANAGER 839 02-APR-81 2975 20
7654 MARTIN SALESMAN 7698 28-SEP-81 1250 1400 30
7698 BLAKE MANAGER 7839 01-MAY-81 2850 30
7782 CLARK MANAGER 7839 09-JUN-81 2450 10
7788 SCOTT ANALYST 7566 19-APR-87 3000 20
7839 KING PRESIDENT 17-NOV-81 5000 10
7844 TURNER SALESMAN 7698 08-SEP-81 1500 0 30
7876 ADAMS CLERK 7788 23-MAY-87 1100 20
7900 JAMES CLERK 7698 03-DEC-81 950 30
7902 FORD ANALYST 7566 03-DEC-81 3000 20
7934 MILLER CLERK 7782 23-JAN-82 1300 10
Q-4> Edit the commission of JONES to 1000.
Q-5> Retrieve all rows of employee table.
Q-6> Delete row from employee table where deptno is 10.
Q-7> Delete all rows from employee table then Drop the emp table.
Subscribe to:
Posts (Atom)
Lecture PPTs of MIS , Module 4 to Module 6
Module 4 Social Computing (SC): Web 3.0 , SC in business-shopping, Marketing, Operational and Analytic CRM, E-business and E-commerce B2B B...
-
Practical exam Q No. 1 Q-1> Write a query in sql to create a table employee and department. Employee(empno,ename,deptno,job,hiredate...
-
Cloud Computing Lab Lab No. 5 Explore Storage as a service using own Cloud for remote file access using web interfaces. ownClou...
-
Answers Experiment No. 1 1. SQL> create table deptit(deptno number(2) primary key,dname varchar(14) not null,loc varchar(13) not null); T...