Sunday, June 14, 2020

R LANGUAGE

R LANGUAGE

BASIC :

1.  ASSIGN 2 VALUES USING <- OPERATOR AND PRINT SUM OF TWO VALUES IN R LANGUAGE - CLICK
2.  ASSIGN 2 VALUES USING -> OPERATOR AND PRINT SUM USING CAT() IN R LANGUAGE - CLICK
3.  ASSIGN 2 VALUES USING = OPERATOR AND PRINT SUM OF TWO VALUES IN R LANGUAGE - CLICK
4.   ASSIGN 2 VALUES USING -> OPERATOR AND PRINT SUM OF TWO VALUES IN R LANGUAGE - CLICK
5.   ARITHMETIC OPERATOR IN R LANGUAGE (  USING TWO INTEGER VALUES ) - CLICK 
6.   ARITHMETIC OPERATOR IN R LANGUAGE (  USING TWO FLOAT VALUES ) - CLICK
7.   RELATIONAL OPERATORS IN R LANGUAGE - CLICK
8.   LOGICAL OPERATORS IN R LANGUAGE - CLICK
9.   IF ELSE STRUCTURE IN R LANGUAGE - CLICK
10. NESTED IF STRUCTURE IN R LANGUAGE - CLICK
11. INPUT STRING FROM USER AND PRINT IN R LANGUAGE - CLICK
12. FOR LOOP STRUCTURE IN R LANGUAGE - CLICK
13. WHILE LOOP STRUCTURE IN R LANGUAGE - CLICK
14. SWITCH CASE IN R LANGAUAGE - CLICK
15. SWITCH CASE WHEN CASE VALUE GIVEN BY USER IN R LANGUAGE - CLICK




VECTOR:
 1. VECTOR CREATION, MODIFICATION,DELETION,BASIC OPERARTION OF TWO     VECTORS IN R LANGUAGE  -- CLICK
2. SUM AND AVERAGE OF ELEMENTS INVECTOR  IN R LANGUAGE  -  CLICK
3. LARGEST AND SMALLEST ELEMENT IN VECTOR IN R LANGUAGE  -  CLICK
4. LINEAR SEARCH IN R LANGUAGE  - CLICK
5. BINARY SEARCH IN R LANGUAGE  - CLICK 
6. BUBBLE SORT IN R LANGUAGE  -  CLICK
7. INSERTION SORT IN R LANGUAGE  - CLICK
8. SELECTION SORT IN R LANGUAGE  - CLICK 
9. RANDOMIZED QUICK SORT IN R LANGUAGE  - CLICK
10. MERGE SORT IN R LANGUAGE  - CLICK
11. VECTOR USING RANDOM VALUES - CLICK


MATRIX :
1. MATRIX CREATION IN R LANGUAGE , ADDITION OF TWO MATRICES IN R LANGUAGE , SUBTRACTION OF TWO MATRICES IN R LANGUAGE, MULTIPLICATION OF TWO MATRICES IN R LANGUAGE, DIVISION OF TWO MATRICES IN R LANGUAGE - CLICK


APPLY FAMILY IN R LANGUAGE:
1.APPLY() IN R LANGUAGE: CLICK
2.LAPPLY() IN R LANGUAGE: CLICK
3.SAPPLY () IN R LANGUAGE: CLICK


UNIVERSITY ASSIGNMENT - CLICK HERE








R15. SWITCH CASE WHEN CASE VALUE GIVEN BY USER IN R LANGUAGE

R15.  SWITCH CASE WHEN CASE VALUE GIVEN BY USER IN R LANGUAGE

R14. SWITCH CASE IN R LANGAUAGE

R14. SWITCH CASE IN R LANGAUAGE


R13. WHILE LOOP STRUCTURE IN R LANGUAGE

R13.  WHILE LOOP STRUCTURE IN R LANGUAGE

R12. FOR LOOP STRUCTURE IN R LANGUAGE

R12.  FOR LOOP STRUCTURE IN R LANGUAGE


R11. INPUT STRING FROM USER AND PRINT

R11. INPUT STRING FROM USER AND PRINT

R10. NESTED IF STRUCTURE IN R LANGUAGE

R10. NESTED IF STRUCTURE IN R LANGUAGE


R9. IF ELSE STRUCTURE IN R LANGUAGE

R9. IF ELSE STRUCTURE IN R LANGUAGE


R8. LOGICAL OPERATORS IN R LANGUAGE

R8. LOGICAL OPERATORS IN R LANGUAGE


R7. Relational Operators IN R LANGUAGE

Relational Operators




 

R6. ARITHMETIC OPERATOR IN R LANGUAGE ( USING TWO FLOAT VALUES )

R6. ARITHMETIC OPERATOR IN R LANGUAGE (  USING TWO FLOAT VALUES ) 
   1.   a+b
 2. a-b 
3.
a*b
4.
a/b
5.
a%%b
  6.
a%/%b ( INTEGER DIVISION )
7.
a^b


R5. ARITHMETIC OPERATOR IN R LANGUAGE ( USING TWO INTEGER VALUES )

R5. ARITHMETIC OPERATOR IN R LANGUAGE (  USING TWO INTEGER VALUES ) 
   1.   a+b
 2. a-b 
3.
a*b
4.
a/b
5.
a%%b
  6.
a%/%b ( INTEGER DIVISION )
7.
a^b


R4. ASSIGN 2 VALUES USING -> OPERATOR AND PRINT SUM OF TWO VALUES IN R LANGUAGE

R4. ASSIGN 2 VALUES USING -> OPERATOR AND PRINT SUM OF TWO VALUES IN R LANGUAGE


R3. ASSIGN 2 VALUES USING = OPERATOR AND PRINT SUM OF TWO VALUES IN R LANGUAGE

R3. ASSIGN 2 VALUES USING = OPERATOR AND PRINT SUM OF TWO VALUES IN R LANGUAGE


R2. ASSIGN 2 VALUES USING -> OPERATOR AND PRINT SUM USING CAT(). IN R LANGUAGE

R2. ASSIGN 2 VALUES USING -> OPERATOR AND PRINT SUM USING CAT() IN R LANGUAGE .


R1. ASSIGN 2 VALUES USING <- OPERATOR AND PRINT SUM OF TWO VALUES

R1. ASSIGN 2 VALUES USING <- OPERATOR AND PRINT SUM OF TWO VALUES


Saturday, June 6, 2020

COMPANY DATABASE NAVATHE BOOK

  COMPANY DATABASE  NAVATHE BOOK


Questions to be performed on above schema

A. Create tables with relevant foreign key constraints -- CLICK HERE

B. Populate the tables with data - CLICK HERE

C. Perform the following queries on the database :

1. Display all the details of all employees working in the company.  CLICK HERE
2. Display ssn, lname, fname, address of employees who work in department no 7. - CLICK HERE
3. Retrieve the birthdate and address of the employee whose name is 'Franklin T. Wong'.CLICK HERE
4. Retrieve the name and salary of every employee. CLICK HERE
5. Retrieve all distinct salary values. CLICK HERE
6. Retrieve all employee names whose address is in „Bellaire‟.  CLICK HERE
7. Retrieve all employees who were born during the 1950s. CLICK HERE
8. Retrieve all employees in department 5 whose salary is between 50,000 and 60,000(inclusive) CLICK HERE 
9. Retrieve the names of all employees who do not have supervisors. CLICK HERE
10. Retrieve SSN and department name for all employees.  CLICK HERE
11. Retrieve the name and address of all employees who work for the 'Research' department. CLICK HERE
12. For every project located in 'Stafford', list the project number, the controlling department number, and the department manager's last name, address, and birthdate. CLICK HERE
13. For each employee, retrieve the employee's name, and the name of his or her immediate supervisor. CLICK HERE
14. Retrieve all combinations of Employee Name and Department Name. CLICK HERE
15. Make a list of all project numbers for projects that involve an employee whose last name is 'Narayan‟ either as a worker or as a manager of the department that controls the project. CLICKHERE
16. Increase the salary of all employees working on the 'ProductX' project by 15%. Retrieve employee name and increased salary of these employees. CLICK HERE
17. Retrieve a list of employees and the project name each works in, ordered by the employee's department, and within each department ordered alphabetically by employee first name.CLICK HERE 
18. Select the names of employees whose salary does not match with salary of any employee in department 10. - CLICK HERE
19. Retrieve the name of each employee who has a dependent with the same first
name and same sex as the employee. CLICK HERE
20. Retrieve the employee numbers of all employees who work on project located in Bellaire, Houston, or Stafford. CLICK HERE
21. Find the sum of the salaries of all employees, the maximum salary, the minimum salary, and the average salary. Display with proper headings. - CLICK HERE
22. Find the sum of the salaries and number of employees of all employees of the „Marketing‟ department, as well as the maximum salary, the minimum salary, and the average salary in this department. CLICK HERE
23. Select the names of employees whose salary is greater than the average salary of all employees in department 10. CLICK HERE
24. For each department, retrieve the department number, the number of employees in the department, and their average salary. CLICK HERE
25. For each project, retrieve the project number, the project name, and the number of employees who work on that project. CLIK HERE
26. Change the location and controlling department number for all projects having more than 5 employees to „Bellaire‟ and 6 respectively. CLICK HERE
27. For each department having more than 10 employees, retrieve the department no, no of employees drawing more than 40,000 as salary. CLICK HERE
28. Insert a record in Project table which violates referential integrity constraint with respect to Department number. Now remove the violation by making necessary
insertion in the Department table. CLICK HERE(homework)
29. Delete all dependents of employee whose ssn is „123456789‟.CLICK HERE
30. Delete an employee from Employee table with ssn = „12345‟( make sure that this employee has some dependents, is working on some project, is a manager of some department and is supervising some employees). Check and display the cascading effect on Dependent and Works on table. In Department table MGRSSN should be set to default value and in Employee table SUPERSSN should be set to NULL-CLICK HERE(homework)
31. Perform a query using alter command to drop/add field and a constraint in Employee table. CLICK HERE

31. Perform a query using alter command to drop/add field and a constraint in Employee table. (COMPANY DATABASE NAVATHE BOOK)

31. Perform a query using alter command to drop/add field and a constraint in Employee table. (COMPANY DATABASE NAVATHE BOOK)

30. Delete an employee from Employee table with ssn = „12345‟( make sure that this employee has some dependents, is working on some project, is a manager of some department and is supervising some employees). Check and display the cascading effect on Dependent and Works on table. In Department table MGRSSN should be set to default value and in Employee table SUPERSSN should be set to NULL(COMPANY DATABASE NAVATHE BOOK)

30. Delete an employee from Employee table with ssn = „12345‟( make sure that this employee has some dependents, is working on some project, is a manager of some department and is supervising some employees). Check and display the cascading effect on Dependent and Works on table. In Department table MGRSSN should be set to default value and in Employee table SUPERSSN should be set to NULL(COMPANY DATABASE NAVATHE BOOK)

29. Delete all dependents of employee whose ssn is „123456789‟.(COMPANY DATABASE NAVATHE BOOK)

29. Delete all dependents of employee whose ssn is „123456789‟.(COMPANY DATABASE NAVATHE BOOK)

28. Insert a record in Project table which violates referential integrity constraint with respect to Department number. Now remove the violation by making necessary insertion in the Department table.(COMPANY DATABASE NAVATHE BOOK)

28. Insert a record in Project table which violates referential integrity constraint with respect to Department number. Now remove the violation by making necessary insertion in the Department table.(COMPANY DATABASE NAVATHE BOOK)

27. For each department having more than 10 employees, retrieve the department no, no of employees(COMPANY DATABASE NAVATHE BOOK) drawing more than 40,000 as salary.

27. For each department having more than 10 employees, retrieve the department no, no of employees(COMPANY DATABASE NAVATHE BOOK) drawing more than 40,000 as salary.


26. Change the location and controlling department number for all projects having more than 5 employees to „Bellaire‟ and 6 respectively.(COMPANY DATABASE NAVATHE BOOK)

26. Change the location and controlling department number for all projects having more than 5 employees to „Bellaire‟ and 6 respectively.(COMPANY DATABASE NAVATHE BOOK)



25. For each project, retrieve the project number, the project name, and the number of employees who work on that project.(COMPANY DATABASE NAVATHE BOOK)

25. For each project, retrieve the project number, the project name, and the number of employees who work on that project.(COMPANY DATABASE NAVATHE BOOK)


24. For each department, retrieve the department number, the number of employees in the department, and their average salary.(COMPANY DATABASE NAVATHE BOOK)

24. For each department, retrieve the department number, the number of employees in the department, and their average salary.(COMPANY DATABASE NAVATHE BOOK)


23. Select the names of employees whose salary is greater than the average salary of all employees in department 10.(COMPANY DATABASE NAVATHE BOOK)

23. Select the names of employees whose salary is greater than the average salary of all employees in department 10.(COMPANY DATABASE NAVATHE BOOK)


22. Find the sum of the salaries and number of employees of all employees of the „Marketing‟ department, as well as the maximum salary, the minimum salary, and the average salary in this department.(COMPANY DATABASE NAVATHE BOOK)

22. Find the sum of the salaries and number of employees of all employees of the „Marketing‟ department, as well as the maximum salary, the minimum salary, and the average salary in this department.(COMPANY DATABASE NAVATHE BOOK)


21. Find the sum of the salaries of all employees, the maximum salary, the minimum salary, and the average salary. Display with proper headings.(COMPANY DATABASE NAVATHE BOOK)

21. Find the sum of the salaries of all employees, the maximum salary, the minimum salary, and the average salary. Display with proper headings.(COMPANY DATABASE NAVATHE BOOK)


20. Retrieve the employee numbers of all employees who work on project located in Bellaire, Houston, or Stafford.(COMPANY DATABASE NAVATHE BOOK)

20. Retrieve the employee numbers of all employees who work on project located in Bellaire, Houston, or Stafford.(COMPANY DATABASE NAVATHE BOOK)


19. Retrieve the name of each employee who has a dependent with the same first name and same sex as the employee.(COMPANY DATABASE NAVATHE BOOK)

19. Retrieve the name of each employee who has a dependent with the same first name and same sex as the employee.(COMPANY DATABASE NAVATHE BOOK)


18. Select the names of employees whose salary does not match with salary of any employee in department 10.(COMPANY DATABASE NAVATHE BOOK)

18. Select the names of employees whose salary does not match with salary of any employee in department 10.(COMPANY DATABASE NAVATHE BOOK)


17. Retrieve a list of employees and the project name each works in, ordered by the employee's department, and within each department ordered alphabetically by employee first name. (COMPANY DATABASE NAVATHE BOOK)

17. Retrieve a list of employees and the project name each works in, ordered by the employee's department, and within each department ordered alphabetically by employee first name. (COMPANY DATABASE NAVATHE BOOK)


16. Increase the salary of all employees working on the 'ProductX' project by 15%. Retrieve employee name and increased salary of these employees.(COMPANY DATABASE NAVATHE BOOK)

16. Increase the salary of all employees working on the 'ProductX' project by 15%. Retrieve employee name and increased salary of these employees.(COMPANY DATABASE NAVATHE BOOK)


15. Make a list of all project numbers for projects that involve an employee whose last name is 'Narayan‟ either as a worker or as a manager of the department that controls the project.(COMPANY DATABASE NAVATHE BOOK)

15. Make a list of all project numbers for projects that involve an employee whose last name is 'Narayan‟ either as a worker or as a manager of the department that controls the project.(COMPANY DATABASE NAVATHE BOOK)


14. Retrieve all combinations of Employee Name and Department Name. (COMPANY DATABASE NAVATHE BOOK)


14. Retrieve all combinations of Employee Name and Department Name. (COMPANY DATABASE NAVATHE BOOK)

13. For each employee, retrieve the employee's name, and the name of his or her immediate supervisor.(COMPANY DATABASE NAVATHE BOOK)

13. For each employee, retrieve the employee's name, and the name of his or her immediate supervisor.(COMPANY DATABASE NAVATHE BOOK)


12. For every project located in 'Stafford', list the project number, the controlling department number, and the department manager's last name, address, and birthdate.(COMPANY DATABASE NAVATHE BOOK)

12. For every project located in 'Stafford', list the project number, the controlling department number, and the department manager's last name, address, and birthdate.(COMPANY DATABASE NAVATHE BOOK)


11. Retrieve the name and address of all employees who work for the 'Research' department(COMPANY DATABASE NAVATHE BOOK)

11. Retrieve the name and address of all employees who work for the 'Research' department(COMPANY DATABASE NAVATHE BOOK)


10. Retrieve SSN and department name for all employees.(COMPANY DATABASE NAVATHE BOOK)

10. Retrieve SSN and department name for all employees.(COMPANY DATABASE NAVATHE BOOK)

9. Retrieve the names of all employees who do not have supervisors(COMPANY DATABASE NAVATHE BOOK)

9. Retrieve the names of all employees who do not have supervisors(COMPANY DATABASE NAVATHE BOOK)


8. Retrieve all employees in department 5 whose salary is between 50,000 and 60,000(inclusive)(COMPANY DATABASE NAVATHE BOOK)

8. Retrieve all employees in department 5 whose salary is between 50,000 and 60,000(inclusive)(COMPANY DATABASE NAVATHE BOOK)


7. Retrieve all employees who were born during the 1950s.(COMPANY DATABASE NAVATHE BOOK)

7. Retrieve all employees who were born during the 1950s.(COMPANY DATABASE NAVATHE BOOK)


6. Retrieve all employee names whose address is in „Bellaire‟(COMPANY DATABASE NAVATHE BOOK)

6. Retrieve all employee names whose address is in „Bellaire‟(COMPANY DATABASE NAVATHE BOOK)

5. Retrieve all distinct salary values. (COMPANY DATABASE NAVATHE BOOK)

5. Retrieve all distinct salary values. (COMPANY DATABASE NAVATHE BOOK)


4. Retrieve the name and salary of every employee.(COMPANY DATABASE NAVATHE BOOK)

4. Retrieve the name and salary of every employee.(COMPANY DATABASE NAVATHE BOOK)


3. Retrieve the birthdate and address of the employee whose name is 'Franklin T. Wong'(COMPANY DATABASE NAVATHE BOOK)

3. Retrieve the birthdate and address of the employee whose name is 'Franklin T. Wong'(COMPANY DATABASE NAVATHE BOOK)


2. Display ssn, lname, fname, address of employees who work in department no 7. (COMPANY DATABASE NAVATHE BOOK)

2. Display ssn, lname, fname, address of employees who work in department no 7. (COMPANY DATABASE NAVATHE BOOK)


1. Display all the details of all employees working in the company. (COMPANY DATABASE NAVATHE BOOK)

1. Display all the details of all employees working in the company. (COMPANY DATABASE NAVATHE BOOK)


DEPENDENT TABLE DATA INSERTION (COMPANY DATABASE NAVATHE BOOK)

DEPENDENT TABLE DATA INSERTION (COMPANY DATABASE NAVATHE BOOK)


WORKSON TABLE DATA INSERTION (COMPANY DATABASE NAVATHE BOOK )

WORKSON TABLE DATA INSERTION (COMPANY DATABASE NAVATHE BOOK )



DEPT_LOCATION TABLE DATA INSERTION (COMPANY DATABASE NAVATHE BOOK)


DEPT_LOCATION TABLE DATA INSERTION (COMPANY DATABASE NAVATHE BOOK)

PROJECT TABLE DATA INSERTION (COMPANY DATABASE NAVATHE BOOK)

PROJECT TABLE DATA INSERTION (COMPANY DATABASE NAVATHE BOOK)


EMPLOYEE TABLE DATA INSERTION ( COMPANY DATABASE NAVATHE BOOK)

EMPLOYEE TABLE DATA INSERTION ( COMPANY DATABASE NAVATHE BOOK)

1. 1ST PART

2 . 2ND PART


DATA INSERTION COMPANY DATABASE NAVATHE BOOK

DATA INSERTION IN  TABLE :

1.  DEPARTMENT --  CLICK

2.  EMPLOYEE -- CLICK

3.  DEPT_LOCATIONS -- CLICK

4.  PROJECT -- CLICK

5. WORKS_ON -- CLICK

6. DEPENDENT --   CLICK

DEPARTMENT TABLE DATA INSERTION ( COMPANY DATABASE NAVATHE BOOK )

DEPARTMENT TABLE DATA INSERTION ( COMPANY DATABASE NAVATHE BOOK )


DEPENDENT TABLE CREATION:: ( NAVATHE BOOK DATABASE )

DEPENDENT TABLE CREATION:: ( NAVATHE BOOK DATABASE )









WORKS_ON TABLE CREATION:: ( NAVATHE BOOK DATABASE )


 WORKS_ON TABLE CREATION:: ( NAVATHE BOOK DATABASE )






DEPT_LOCATIONS TABLE CREATION:: ( NAVATHE BOOK DATABASE )

DEPT_LOCATIONS TABLE CREATION:: ( NAVATHE BOOK DATABASE )






PROJECT TABLE CREATION:: ( NAVATHE BOOK DATABASE )

PROJECT TABLE CREATION:: ( NAVATHE BOOK DATABASE )







ALTER DEPARTMENT TABLE :: ( NAVATHE BOOK DATABASE )

ALTER DEPARTMENT TABLE :: ( NAVATHE BOOK DATABASE )








EMPLOYEE TABLE CREATION:: ( NAVATHE BOOK DATABASE )













EMPLOYEE TABLE CREATION:: ( NAVATHE BOOK DATABASE )








DEPARTMENT TABLE CREATION :: ( NAVATHE BOOK DATABASE )

DEPARTMENT TABLE CREATION :: ( NAVATHE BOOK DATABASE )







COMPANY DATABASE NAVATHE BOOK


COMPANY DATABASE NAVATHE BOOK




 CREATE TABLE :

1.  DEPARTMENT -- CLICK HERE   ALTER TABLE DEPARTMENT

2.  EMPLOYEE -- CLICK HERE
 
3.  DEPT_LOCATIONS -- CLICK HERE

4.  PROJECT --  CLICK HERE

5. WORKS_ON --  CLICK HERE

6. DEPENDENT --  CLICK HERE
                


Thursday, June 4, 2020

RED BLACK TREE INSERTION STEP BY STEP EXPLANATION


RED BLACK TREE INSERTION STEP BY STEP EXPLANATION



DYSTRAS ALGORITHM OR DIJKSTRAS ALGORITHM STEP BY STEP EXPLANATION

DYSTRAS ALGORITHM OR DIJKSTRAS ALGORITHM STEP BY STEP EXPLANATION


PRIMS ALGORITHM EXPLANATION STEP BY STEP




KRUSKAL ALGORITHM EXPLANATION STEP BY STEP

KRUSKAL ALGORITHM EXPLANATION STEP BY STEP


HEAP SORT ALGORITHM STEP BY STEP EXPLANATION


HEAP SORT ALGORITHM STEP BY STEP EXPLANATION


QUICK SORT algorithm implementation example step by step


QUICK SORT algorithm implementation example step by step


selection sort example step by step


selection sort example step by step explanation