Sie sind auf Seite 1von 2

1.

Write queries to use following numeric functions


(MOD, POWER, SQRT, ABS, ROUND, FLOOR, CEILING)

Based on Joins:

Employee (id, first_name, last_name, start_date, end_date, salary, city)


I First_na Last_na Start_da End_da Salary City
d me me te te
1 Jason Martin 1996-07- 2006- 1234.5 Toronto
25 07-25 6
2 Alison Mathews 1976-03- 1986- 6661.7 Vancouv
21 02-21 8 er
3 James Smith 1978-12- 1990- 6544.7 Vancouv
12 03-15 8 er
4 Celia Rice 1982-10- 1999- 2344.7 Vancouv
24 04-21 8 er

Job select * from duty;


+------+-----------+
+------+------------+ | id | task |
| id | title | +------+-----------+
+------+------------+ | 1 | Test |
| 1 | Tester | | 2 | Calculate |
| 2 | Accountant | | 3 | Program |
| 3 | Developer | | 4 | Test |
| 4 | Coder | | 5 | Manage |
| 5 | Director | | 6 | Talk |
| 6 | Mediator | | 7 | Speak |
| 7 | Proffessor | | 8 | Shout |
| 8 | Programmer | | 9 | Walk |
| 9 | Developer +------+-----------+

Equi join:

49. Display employee first name, job and title and there should be no redundancy.
50. Display employee first name, job and title, task and there should be no redundancy.

Left join:
51. Retrieve first name, last name and title of the job having all the rows of employee table.
52. Retrieve first name, last name and title of the job of coders even if the employee
corresponding to job title doesn’t exist, null should be displayed.
53. Retrieve first name, last name and task of coders even if the employee corresponding to
job title doesn’t exist, null should be displayed.

Right join:
54. Retrieve first name, last name and title of the job having all the rows of job table.

BASED ON VIEWS

55. Write a query to create a view.


56. Write a query to create a view with specified column names.
57. Write a query to create a view with joined tables.
58. Write a query by adding order by to the joined table view.
59. Write a query to create a view by using group by clause.
60. Write a query to drop a particular view.
61. Write a query to alter a particular view e.g. to add a particular column.

BASED ON INDEXES

62. Write a query to create an index


63. Write a query to create an index by using alter table statement
64. Write a query to delete an index

Das könnte Ihnen auch gefallen