0% found this document useful (0 votes)
3 views6 pages

SQLPRATIQUE

The document contains a series of SQL queries and their results related to employee and department data in a database. It shows errors encountered when querying non-existent tables and incorrect syntax, as well as successful retrieval of employee and department information. The final query successfully retrieves the first name and adjusted salary of an employee with a specific ID.

Uploaded by

level64pro55
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as TXT, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
3 views6 pages

SQLPRATIQUE

The document contains a series of SQL queries and their results related to employee and department data in a database. It shows errors encountered when querying non-existent tables and incorrect syntax, as well as successful retrieval of employee and department information. The final query successfully retrieves the first name and adjusted salary of an employee with a specific ID.

Uploaded by

level64pro55
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as TXT, PDF, TXT or read online on Scribd
You are on page 1/ 6

from department

*
ERROR at line 2:
ORA-00942: table or view does not exist

SQL> SELECT DEPARTMENT8_ID AS NumDept,department_name AS NomDept


2 from department;
from department
*
ERROR at line 2:
ORA-00942: table or view does not exist

SQL> SELECT DEPARTMENT_ID AS NumDept,department_name AS Nomdept


2 from departments/
3 /
from departments/
*
ERROR at line 2:
ORA-00933: SQL command not properly ended

SQL> SELECT DEPARTMENT_ID AS NumDept,department_name AS Nomdept


2 from departments;

NUMDEPT NOMDEPT
---------- ------------------------------
10 Administration
20 Marketing
30 Purchasing
40 Human Resources
50 Shipping
60 IT
70 Public Relations
80 Sales
90 Executive
100 Finance
110 Accounting

NUMDEPT NOMDEPT
---------- ------------------------------
120 Treasury
130 Corporate Tax
140 Control And Credit
150 Shareholder Services
160 Benefits
170 Manufacturing
180 Construction
190 Contracting
200 Operations
210 IT Support
220 NOC

NUMDEPT NOMDEPT
---------- ------------------------------
230 IT Helpdesk
240 Government Sales
250 Retail Sales
260 Recruiting
270 Payroll

27 rows selected.

SQL> SELECT DEPARTMENT_ID||','||department_name "infodepartments"


2 from departments;

infodepartments
-----------------------------------------------------------------------
10,Administration
20,Marketing
30,Purchasing
40,Human Resources
50,Shipping
60,IT
70,Public Relations
80,Sales
90,Executive
100,Finance
110,Accounting

infodepartments
-----------------------------------------------------------------------
120,Treasury
130,Corporate Tax
140,Control And Credit
150,Shareholder Services
160,Benefits
170,Manufacturing
180,Construction
190,Contracting
200,Operations
210,IT Support
220,NOC

infodepartments
-----------------------------------------------------------------------
230,IT Helpdesk
240,Government Sales
250,Retail Sales
260,Recruiting
270,Payroll

27 rows selected.

SQL> desc enployeer;


ERROR:
ORA-04043: object enployeer does not exist

SQL> desc enployees;


ERROR:
ORA-04043: object enployees does not exist

SQL> desc employees;


Name Null? Type
----------------------------------------- -------- ----------------------------
EMPLOYEE_ID NOT NULL NUMBER(6)
FIRST_NAME VARCHAR2(20)
LAST_NAME NOT NULL VARCHAR2(25)
EMAIL NOT NULL VARCHAR2(25)
PHONE_NUMBER VARCHAR2(20)
HIRE_DATE NOT NULL DATE
JOB_ID NOT NULL VARCHAR2(10)
SALARY NUMBER(8,2)
COMMISSION_PCT NUMBER(2,2)
MANAGER_ID NUMBER(6)
DEPARTMENT_ID NUMBER(4)

SQL> SELECT EMPLOYEE_ID,FIRST_NAME,LAST_NAME,SALARY


2 FROM EMPLOYEES;

EMPLOYEE_ID FIRST_NAME LAST_NAME SALARY


----------- -------------------- ------------------------- ----------
100 Steven King 24000
101 Neena Kochhar 17000
102 Lex De Haan 17000
103 Alexander Hunold 9000
104 Bruce Ernst 6000
105 David Austin 4800
106 Valli Pataballa 4800
107 Diana Lorentz 4200
108 Nancy Greenberg 12008
109 Daniel Faviet 9000
110 John Chen 8200

EMPLOYEE_ID FIRST_NAME LAST_NAME SALARY


----------- -------------------- ------------------------- ----------
111 Ismael Sciarra 7700
112 Jose Manuel Urman 7800
113 Luis Popp 6900
114 Den Raphaely 11000
115 Alexander Khoo 3100
116 Shelli Baida 2900
117 Sigal Tobias 2800
118 Guy Himuro 2600
119 Karen Colmenares 2500
120 Matthew Weiss 8000
121 Adam Fripp 8200

EMPLOYEE_ID FIRST_NAME LAST_NAME SALARY


----------- -------------------- ------------------------- ----------
122 Payam Kaufling 7900
123 Shanta Vollman 6500
124 Kevin Mourgos 5800
125 Julia Nayer 3200
126 Irene Mikkilineni 2700
127 James Landry 2400
128 Steven Markle 2200
129 Laura Bissot 3300
130 Mozhe Atkinson 2800
131 James Marlow 2500
132 TJ Olson 2100

EMPLOYEE_ID FIRST_NAME LAST_NAME SALARY


----------- -------------------- ------------------------- ----------
133 Jason Mallin 3300
134 Michael Rogers 2900
135 Ki Gee 2400
136 Hazel Philtanker 2200
137 Renske Ladwig 3600
138 Stephen Stiles 3200
139 John Seo 2700
140 Joshua Patel 2500
141 Trenna Rajs 3500
142 Curtis Davies 3100
143 Randall Matos 2600

EMPLOYEE_ID FIRST_NAME LAST_NAME SALARY


----------- -------------------- ------------------------- ----------
144 Peter Vargas 2500
145 John Russell 14000
146 Karen Partners 13500
147 Alberto Errazuriz 12000
148 Gerald Cambrault 11000
149 Eleni Zlotkey 10500
150 Peter Tucker 10000
151 David Bernstein 9500
152 Peter Hall 9000
153 Christopher Olsen 8000
154 Nanette Cambrault 7500

EMPLOYEE_ID FIRST_NAME LAST_NAME SALARY


----------- -------------------- ------------------------- ----------
155 Oliver Tuvault 7000
156 Janette King 10000
157 Patrick Sully 9500
158 Allan McEwen 9000
159 Lindsey Smith 8000
160 Louise Doran 7500
161 Sarath Sewall 7000
162 Clara Vishney 10500
163 Danielle Greene 9500
164 Mattea Marvins 7200
165 David Lee 6800

EMPLOYEE_ID FIRST_NAME LAST_NAME SALARY


----------- -------------------- ------------------------- ----------
166 Sundar Ande 6400
167 Amit Banda 6200
168 Lisa Ozer 11500
169 Harrison Bloom 10000
170 Tayler Fox 9600
171 William Smith 7400
172 Elizabeth Bates 7300
173 Sundita Kumar 6100
174 Ellen Abel 11000
175 Alyssa Hutton 8800
176 Jonathon Taylor 8600

EMPLOYEE_ID FIRST_NAME LAST_NAME SALARY


----------- -------------------- ------------------------- ----------
177 Jack Livingston 8400
178 Kimberely Grant 7000
179 Charles Johnson 6200
180 Winston Taylor 3200
181 Jean Fleaur 3100
182 Martha Sullivan 2500
183 Girard Geoni 2800
184 Nandita Sarchand 4200
185 Alexis Bull 4100
186 Julia Dellinger 3400
187 Anthony Cabrio 3000

EMPLOYEE_ID FIRST_NAME LAST_NAME SALARY


----------- -------------------- ------------------------- ----------
188 Kelly Chung 3800
189 Jennifer Dilly 3600
190 Timothy Gates 2900
191 Randall Perkins 2500
192 Sarah Bell 4000
193 Britney Everett 3900
194 Samuel McCain 3200
195 Vance Jones 2800
196 Alana Walsh 3100
197 Kevin Feeney 3000
198 Donald OConnell 2600

EMPLOYEE_ID FIRST_NAME LAST_NAME SALARY


----------- -------------------- ------------------------- ----------
199 Douglas Grant 2600
200 Jennifer Whalen 4400
201 Michael Hartstein 13000
202 Pat Fay 6000
203 Susan Mavris 6500
204 Hermann Baer 10000
205 Shelley Higgins 12008
206 William Gietz 8300

107 rows selected.

SQL> SELECT FIRST NAME,SALARY+1500


2 FROM EMPLOYEES
3 WHERE EMPLOYEE_ID=200;
SELECT FIRST NAME,SALARY+1500
*
ERROR at line 1:
ORA-00904: "FIRST": invalid identifier

SQL> SELECT FIRST NAME,SALARY+1500


2 FROM EMPLOYEES
3 WHERE EMPLOYEE_ID=200;
SELECT FIRST NAME,SALARY+1500
*
ERROR at line 1:
ORA-00904: "FIRST": invalid identifier

SQL> SELECT FIRST_NAME,SALARY +1500


2 FROM EMPLOYEES
3 WHERE EMPLOYEE_ID=200;
FIRST_NAME SALARY+1500
-------------------- -----------
Jennifer 5900

SQL>

You might also like