SlideShare ist ein Scribd-Unternehmen logo
1 von 6
---+--------------------+ 
| codigo | nombre | cargo | f_ingreso | salario | comision | cod_d 
ep | departamento_codep | 
+--------+----------------+------------+------------+---------+----------+------ 
---+--------------------+ 
| 7369 | Carlos Perdomo | SUPERVISOR | 0000-00-00 | 800 | 50 | 
20 | 10 | 
| 7499 | Fernando Velez | VENDEDOR | 0000-00-00 | 1600 | 300 | 
30 | 20 | 
| 7521 | Rosario Gomez | VENDEDOR | 0000-00-00 | 2975 | 200 | 
20 | 30 | 
+--------+----------------+------------+------------+---------+----------+------ 
---+--------------------+ 
3 rows in set (0.00 sec) 
mysql> show databases; 
+--------------------+ 
| Database | 
+--------------------+ 
| information_schema | 
| empresa | 
| mysql | 
+--------------------+ 
3 rows in set (0.00 sec) 
mysql> drop database empresa; 
Query OK, 2 rows affected (0.10 sec) 
mysql> 
mysql> 
mysql> 
mysql> 
mysql> 
mysql> create database empresa; 
Query OK, 1 row affected (0.01 sec) 
mysql> use empresa; 
Database changed 
mysql> 
mysql> 
mysql> 
mysql> create table departamento 
-> (codep integer(30) PRIMARY KEY, 
-> nombre_der varchar(30), 
-> ubicacion varchar(30)); 
Query OK, 0 rows affected (0.05 sec) 
mysql> 
mysql> insert into departamento 
-> values(10,'contabilidad','cali'); 
Query OK, 1 row affected (0.02 sec) 
mysql> 
mysql> insert into departamento 
-> values(20,'investigacion','bogota'); 
Query OK, 1 row affected (0.02 sec) 
mysql> 
mysql> insert into departamento 
-> values(30,'ventas','manizales'); 
Query OK, 1 row affected (0.02 sec) 
mysql> select * from departamento; 
+-------+---------------+-----------+
| codep | nombre_der | ubicacion | 
+-------+---------------+-----------+ 
| 10 | contabilidad | cali | 
| 20 | investigacion | bogota | 
| 30 | ventas | manizales | 
+-------+---------------+-----------+ 
3 rows in set (0.00 sec) 
mysql> 
mysql> 
mysql> create table empleado 
-> (codigo integer, 
-> nombre varchar(30), 
-> cargo varchar(30), 
-> f_ingreso date, 
-> salario integer, 
-> comision integer, 
-> 
-> departamento_codep integer, 
-> PRIMARY KEY (codigo), 
-> FOREIGN KEY(departamento_codep) 
-> REFERENCES departamento(codep) 
-> ON DELETE NO ACTION 
-> ON UPDATE NO ACTION 
-> ); 
Query OK, 0 rows affected (0.06 sec) 
mysql> insert into empleado 
-> values(7369,'Carlos Perdomo','SUPERVISOR',1980-12-17,800,50,20); 
Query OK, 1 row affected, 1 warning (0.03 sec) 
mysql> 
mysql> insert into empleado 
-> values(7499,'Fernando Velez','VENDEDOR',1981-02-20,1600,300,30); 
Query OK, 1 row affected, 1 warning (0.02 sec) 
mysql> 
mysql> insert into empleado 
-> values(7521,'Rosario Gomez','VENDEDOR',1981-12-22,2975,200,30); 
Query OK, 1 row affected, 1 warning (0.01 sec) 
mysql> 
mysql> insert into empleado 
-> values(7566,'Jones Wilson','AUXILIAR',1981-04-21,2975,200,20); 
Query OK, 1 row affected, 1 warning (0.02 sec) 
mysql> 
mysql> insert into empleado 
-> values(7654,'Martin Vanegas','VENDEDOR',1998-03-04,1250,1400,30); 
Query OK, 1 row affected, 1 warning (0.02 sec) 
mysql> 
mysql> 
mysql> insert into empleado 
-> values(7698,'Blake Salas','AUXILIAR',2003-08-04,2850,150,30); 
Query OK, 1 row affected, 1 warning (0.02 sec) 
mysql> 
mysql> insert into empleado 
-> values(7782,'Clark Ken','AUXILIAR',2006-11-30,2450,1200,10); 
Query OK, 1 row affected, 1 warning (0.02 sec) 
mysql> 
mysql> insert into empleado
-> values(7788,'Alma Scott','ANALISTA',2004-07-14,3000,0,20); 
Query OK, 1 row affected, 1 warning (0.02 sec) 
mysql> 
mysql> 
mysql> insert into empleado 
-> values(7839,'Clara Lopez','PRESIDENTE',1998-11-11,5000,0,10); 
Query OK, 1 row affected, 1 warning (0.02 sec) 
mysql> 
mysql> insert into empleado 
-> values(7844,'Zoila Estrada','VENDEDOR',2007-10-03,1500,1300,30); 
Query OK, 1 row affected, 1 warning (0.02 sec) 
mysql> 
mysql> insert into empleado 
-> values(7876,'Diego Perez','SUPERVISOR',1999-11-03,1100,100,20); 
Query OK, 1 row affected, 1 warning (0.02 sec) 
mysql> 
mysql> 
mysql> insert into empleado 
-> values(7900,'Ximena Rugeles','SUPERVISOR',2000-12-20,950,2500,30); 
Query OK, 1 row affected, 1 warning (0.01 sec) 
mysql> 
mysql> insert into empleado 
-> values(7902,'Viviana Morales','ANALISTA',2001-11-11,3000,1800,20); 
Query OK, 1 row affected, 1 warning (0.02 sec) 
mysql> 
mysql> insert into empleado 
-> values(7934,'Tito Lopez','SUPERVISOR',2006-06-05,1300,0,10); 
Query OK, 1 row affected, 1 warning (0.02 sec) 
mysql> select * from empleado; 
+--------+-----------------+------------+------------+---------+----------+----- 
---------------+ 
| codigo | nombre | cargo | f_ingreso | salario | comision | depa 
rtamento_codep | 
+--------+-----------------+------------+------------+---------+----------+----- 
---------------+ 
| 7369 | Carlos Perdomo | SUPERVISOR | 0000-00-00 | 800 | 50 | 
20 | 
| 7499 | Fernando Velez | VENDEDOR | 0000-00-00 | 1600 | 300 | 
30 | 
| 7521 | Rosario Gomez | VENDEDOR | 0000-00-00 | 2975 | 200 | 
30 | 
| 7566 | Jones Wilson | AUXILIAR | 0000-00-00 | 2975 | 200 | 
20 | 
| 7654 | Martin Vanegas | VENDEDOR | 0000-00-00 | 1250 | 1400 | 
30 | 
| 7698 | Blake Salas | AUXILIAR | 0000-00-00 | 2850 | 150 | 
30 | 
| 7782 | Clark Ken | AUXILIAR | 0000-00-00 | 2450 | 1200 | 
10 | 
| 7788 | Alma Scott | ANALISTA | 0000-00-00 | 3000 | 0 | 
20 | 
| 7839 | Clara Lopez | PRESIDENTE | 0000-00-00 | 5000 | 0 | 
10 | 
| 7844 | Zoila Estrada | VENDEDOR | 0000-00-00 | 1500 | 1300 | 
30 | 
| 7876 | Diego Perez | SUPERVISOR | 0000-00-00 | 1100 | 100 | 
20 |
| 7900 | Ximena Rugeles | SUPERVISOR | 0000-00-00 | 950 | 2500 | 
30 | 
| 7902 | Viviana Morales | ANALISTA | 0000-00-00 | 3000 | 1800 | 
20 | 
| 7934 | Tito Lopez | SUPERVISOR | 0000-00-00 | 1300 | 0 | 
10 | 
+--------+-----------------+------------+------------+---------+----------+----- 
---------------+ 
14 rows in set (0.01 sec) 
mysql> select count(*) as 'NUMERO EMPLEADOS' from empleado; 
+------------------+ 
| NUMERO EMPLEADOS | 
+------------------+ 
| 14 | 
+------------------+ 
1 row in set (0.03 sec) 
mysql> select count(DISTINCT CARGO) as 'NUMEROS DE CARGOS' from empleado; 
+-------------------+ 
| NUMEROS DE CARGOS | 
+-------------------+ 
| 5 | 
+-------------------+ 
1 row in set (0.00 sec) 
mysql> select nombre_der as departamento, count(*) as 'NUMERO DE EMPLEADOS' from 
empleado, departamento where codep=deptno group by deptno; 
ERROR 1054 (42S22): Unknown column 'deptno' in 'where clause' 
mysql> 
mysql> 
mysql> 
mysql> 
mysql> select nombre_der as departamento, count(*) as "NUMERO DE EMPLEADOS" from 
empleado, departamento where codep=departamento_codep group by departamento_cod 
ep; 
+---------------+---------------------+ 
| departamento | NUMERO DE EMPLEADOS | 
+---------------+---------------------+ 
| contabilidad | 3 | 
| investigacion | 5 | 
| ventas | 6 | 
+---------------+---------------------+ 
3 rows in set (0.03 sec) 
mysql> select cargo, count(*) as "empleados por cargo" from empleado group by ca 
rgo; 
+------------+---------------------+ 
| cargo | empleados por cargo | 
+------------+---------------------+ 
| ANALISTA | 2 | 
| AUXILIAR | 3 | 
| PRESIDENTE | 1 | 
| SUPERVISOR | 4 | 
| VENDEDOR | 4 | 
+------------+---------------------+ 
5 rows in set (0.00 sec) 
mysql> select nombre_der as departamento, sum(salario) as "suma salario" from em 
pleado,departamento where codep=departamento_codep group by departamento_codep; 
+---------------+--------------+ 
| departamento | suma salario | 
+---------------+--------------+ 
| contabilidad | 8750 |
| investigacion | 10875 | 
| ventas | 11125 | 
+---------------+--------------+ 
3 rows in set (0.02 sec) 
mysql> select departamento_codep from empleado group by departamento_codep havin 
g sum(salario) >9000; 
+--------------------+ 
| departamento_codep | 
+--------------------+ 
| 20 | 
| 30 | 
+--------------------+ 
2 rows in set (0.00 sec) 
mysql> select departamento_codep as CODIGO ,nombre_der as NOMBRE from empleado,d 
epartamento where codep=departamento_codep group by departamento_codep having su 
m(salario) >9000; 
+--------+---------------+ 
| CODIGO | NOMBRE | 
+--------+---------------+ 
| 20 | investigacion | 
| 30 | ventas | 
+--------+---------------+ 
2 rows in set (0.00 sec) 
mysql> select max(salario) as "salario mas alto" from empleado; 
+------------------+ 
| salario mas alto | 
+------------------+ 
| 5000 | 
+------------------+ 
1 row in set (0.00 sec) 
mysql> select nombre, salario from empleado where salario = (select max(salario) 
from empleado); 
+-------------+---------+ 
| nombre | salario | 
+-------------+---------+ 
| Clara Lopez | 5000 | 
+-------------+---------+ 
1 row in set (0.03 sec) 
mysql>
| investigacion | 10875 | 
| ventas | 11125 | 
+---------------+--------------+ 
3 rows in set (0.02 sec) 
mysql> select departamento_codep from empleado group by departamento_codep havin 
g sum(salario) >9000; 
+--------------------+ 
| departamento_codep | 
+--------------------+ 
| 20 | 
| 30 | 
+--------------------+ 
2 rows in set (0.00 sec) 
mysql> select departamento_codep as CODIGO ,nombre_der as NOMBRE from empleado,d 
epartamento where codep=departamento_codep group by departamento_codep having su 
m(salario) >9000; 
+--------+---------------+ 
| CODIGO | NOMBRE | 
+--------+---------------+ 
| 20 | investigacion | 
| 30 | ventas | 
+--------+---------------+ 
2 rows in set (0.00 sec) 
mysql> select max(salario) as "salario mas alto" from empleado; 
+------------------+ 
| salario mas alto | 
+------------------+ 
| 5000 | 
+------------------+ 
1 row in set (0.00 sec) 
mysql> select nombre, salario from empleado where salario = (select max(salario) 
from empleado); 
+-------------+---------+ 
| nombre | salario | 
+-------------+---------+ 
| Clara Lopez | 5000 | 
+-------------+---------+ 
1 row in set (0.03 sec) 
mysql>

Weitere ähnliche Inhalte

Andere mochten auch

Andere mochten auch (10)

Reading comprehension
Reading comprehensionReading comprehension
Reading comprehension
 
A nation of invention
A nation of invention A nation of invention
A nation of invention
 
Speak aim high page16 work in pair
Speak aim high page16 work in pairSpeak aim high page16 work in pair
Speak aim high page16 work in pair
 
Orange computers group19
Orange computers group19Orange computers group19
Orange computers group19
 
Unit 12 using rubbish
Unit 12 using rubbishUnit 12 using rubbish
Unit 12 using rubbish
 
Exercise 1 countable and uncountable noun
Exercise 1 countable and uncountable nounExercise 1 countable and uncountable noun
Exercise 1 countable and uncountable noun
 
Slide 3 of each unit
Slide 3 of each unitSlide 3 of each unit
Slide 3 of each unit
 
Tenses table
Tenses tableTenses table
Tenses table
 
6ประโยชน์และคุณค่าขอป่างสาคู
6ประโยชน์และคุณค่าขอป่างสาคู6ประโยชน์และคุณค่าขอป่างสาคู
6ประโยชน์และคุณค่าขอป่างสาคู
 
Comparative & superlative
Comparative & superlativeComparative & superlative
Comparative & superlative
 

Ähnlich wie Empresa completo

Cat database
Cat databaseCat database
Cat database
tubbeles
 
Mysqlfunctions
MysqlfunctionsMysqlfunctions
Mysqlfunctions
N13M
 
Applied Partitioning And Scaling Your Database System Presentation
Applied Partitioning And Scaling Your Database System PresentationApplied Partitioning And Scaling Your Database System Presentation
Applied Partitioning And Scaling Your Database System Presentation
Richard Crowley
 
MySQL Idiosyncrasies That Bite SF
MySQL Idiosyncrasies That Bite SFMySQL Idiosyncrasies That Bite SF
MySQL Idiosyncrasies That Bite SF
Ronald Bradford
 
My SQL Idiosyncrasies That Bite OTN
My SQL Idiosyncrasies That Bite OTNMy SQL Idiosyncrasies That Bite OTN
My SQL Idiosyncrasies That Bite OTN
Ronald Bradford
 
අරුණ හේරත්_MYSQL සිංහල_TL_I_033__techlogiclk.com.pdf
අරුණ හේරත්_MYSQL සිංහල_TL_I_033__techlogiclk.com.pdfඅරුණ හේරත්_MYSQL සිංහල_TL_I_033__techlogiclk.com.pdf
අරුණ හේරත්_MYSQL සිංහල_TL_I_033__techlogiclk.com.pdf
AnilManage
 
Short Intro to PHP and MySQL
Short Intro to PHP and MySQLShort Intro to PHP and MySQL
Short Intro to PHP and MySQL
Jussi Pohjolainen
 

Ähnlich wie Empresa completo (20)

Mysql and html
Mysql and html Mysql and html
Mysql and html
 
Analytics functions in mysql, oracle and hive
Analytics functions in mysql, oracle and hiveAnalytics functions in mysql, oracle and hive
Analytics functions in mysql, oracle and hive
 
Cat database
Cat databaseCat database
Cat database
 
Optimizing Queries Using Window Functions
Optimizing Queries Using Window FunctionsOptimizing Queries Using Window Functions
Optimizing Queries Using Window Functions
 
Mysqlfunctions
MysqlfunctionsMysqlfunctions
Mysqlfunctions
 
MySQL SQL Tutorial
MySQL SQL TutorialMySQL SQL Tutorial
MySQL SQL Tutorial
 
Tugas praktikum smbd
Tugas praktikum smbdTugas praktikum smbd
Tugas praktikum smbd
 
Applied Partitioning And Scaling Your Database System Presentation
Applied Partitioning And Scaling Your Database System PresentationApplied Partitioning And Scaling Your Database System Presentation
Applied Partitioning And Scaling Your Database System Presentation
 
MySQL Idiosyncrasies That Bite SF
MySQL Idiosyncrasies That Bite SFMySQL Idiosyncrasies That Bite SF
MySQL Idiosyncrasies That Bite SF
 
Explain
ExplainExplain
Explain
 
My SQL Idiosyncrasies That Bite OTN
My SQL Idiosyncrasies That Bite OTNMy SQL Idiosyncrasies That Bite OTN
My SQL Idiosyncrasies That Bite OTN
 
MySQL Kitchen : spice up your everyday SQL queries
MySQL Kitchen : spice up your everyday SQL queriesMySQL Kitchen : spice up your everyday SQL queries
MySQL Kitchen : spice up your everyday SQL queries
 
අරුණ හේරත්_MYSQL සිංහල_TL_I_033__techlogiclk.com.pdf
අරුණ හේරත්_MYSQL සිංහල_TL_I_033__techlogiclk.com.pdfඅරුණ හේරත්_MYSQL සිංහල_TL_I_033__techlogiclk.com.pdf
අරුණ හේරත්_MYSQL සිංහල_TL_I_033__techlogiclk.com.pdf
 
Dublin 4x3-final-slideshare
Dublin 4x3-final-slideshareDublin 4x3-final-slideshare
Dublin 4x3-final-slideshare
 
Short Intro to PHP and MySQL
Short Intro to PHP and MySQLShort Intro to PHP and MySQL
Short Intro to PHP and MySQL
 
Window functions in MariaDB 10.2
Window functions in MariaDB 10.2Window functions in MariaDB 10.2
Window functions in MariaDB 10.2
 
MySQL Idiosyncrasies That Bite
MySQL Idiosyncrasies That BiteMySQL Idiosyncrasies That Bite
MySQL Idiosyncrasies That Bite
 
Oracle dbms_xplan.display_cursor format
Oracle dbms_xplan.display_cursor formatOracle dbms_xplan.display_cursor format
Oracle dbms_xplan.display_cursor format
 
Latin America Tour 2019 - 10 great sql features
Latin America Tour 2019  - 10 great sql featuresLatin America Tour 2019  - 10 great sql features
Latin America Tour 2019 - 10 great sql features
 
Using Optimizer Hints to Improve MySQL Query Performance
Using Optimizer Hints to Improve MySQL Query PerformanceUsing Optimizer Hints to Improve MySQL Query Performance
Using Optimizer Hints to Improve MySQL Query Performance
 

KĂźrzlich hochgeladen

Abortion pills in Jeddah | +966572737505 | Get Cytotec
Abortion pills in Jeddah | +966572737505 | Get CytotecAbortion pills in Jeddah | +966572737505 | Get Cytotec
Abortion pills in Jeddah | +966572737505 | Get Cytotec
Abortion pills in Riyadh +966572737505 get cytotec
 
如何办理英国诺森比亚大学毕业证(NU毕业证书)成绩单原件一模一样
如何办理英国诺森比亚大学毕业证(NU毕业证书)成绩单原件一模一样如何办理英国诺森比亚大学毕业证(NU毕业证书)成绩单原件一模一样
如何办理英国诺森比亚大学毕业证(NU毕业证书)成绩单原件一模一样
wsppdmt
 
Top profile Call Girls In Chandrapur [ 7014168258 ] Call Me For Genuine Model...
Top profile Call Girls In Chandrapur [ 7014168258 ] Call Me For Genuine Model...Top profile Call Girls In Chandrapur [ 7014168258 ] Call Me For Genuine Model...
Top profile Call Girls In Chandrapur [ 7014168258 ] Call Me For Genuine Model...
gajnagarg
 
Sealdah % High Class Call Girls Kolkata - 450+ Call Girl Cash Payment 8005736...
Sealdah % High Class Call Girls Kolkata - 450+ Call Girl Cash Payment 8005736...Sealdah % High Class Call Girls Kolkata - 450+ Call Girl Cash Payment 8005736...
Sealdah % High Class Call Girls Kolkata - 450+ Call Girl Cash Payment 8005736...
HyderabadDolls
 
Reconciling Conflicting Data Curation Actions: Transparency Through Argument...
Reconciling Conflicting Data Curation Actions:  Transparency Through Argument...Reconciling Conflicting Data Curation Actions:  Transparency Through Argument...
Reconciling Conflicting Data Curation Actions: Transparency Through Argument...
Bertram Ludäscher
 
Jual Obat Aborsi Surabaya ( Asli No.1 ) 085657271886 Obat Penggugur Kandungan...
Jual Obat Aborsi Surabaya ( Asli No.1 ) 085657271886 Obat Penggugur Kandungan...Jual Obat Aborsi Surabaya ( Asli No.1 ) 085657271886 Obat Penggugur Kandungan...
Jual Obat Aborsi Surabaya ( Asli No.1 ) 085657271886 Obat Penggugur Kandungan...
ZurliaSoop
 
Top profile Call Girls In Latur [ 7014168258 ] Call Me For Genuine Models We ...
Top profile Call Girls In Latur [ 7014168258 ] Call Me For Genuine Models We ...Top profile Call Girls In Latur [ 7014168258 ] Call Me For Genuine Models We ...
Top profile Call Girls In Latur [ 7014168258 ] Call Me For Genuine Models We ...
gajnagarg
 
Sonagachi * best call girls in Kolkata | ₹,9500 Pay Cash 8005736733 Free Home...
Sonagachi * best call girls in Kolkata | ₹,9500 Pay Cash 8005736733 Free Home...Sonagachi * best call girls in Kolkata | ₹,9500 Pay Cash 8005736733 Free Home...
Sonagachi * best call girls in Kolkata | ₹,9500 Pay Cash 8005736733 Free Home...
HyderabadDolls
 
Fun all Day Call Girls in Jaipur 9332606886 High Profile Call Girls You Ca...
Fun all Day Call Girls in Jaipur   9332606886  High Profile Call Girls You Ca...Fun all Day Call Girls in Jaipur   9332606886  High Profile Call Girls You Ca...
Fun all Day Call Girls in Jaipur 9332606886 High Profile Call Girls You Ca...
kumargunjan9515
 
Top profile Call Girls In Hapur [ 7014168258 ] Call Me For Genuine Models We ...
Top profile Call Girls In Hapur [ 7014168258 ] Call Me For Genuine Models We ...Top profile Call Girls In Hapur [ 7014168258 ] Call Me For Genuine Models We ...
Top profile Call Girls In Hapur [ 7014168258 ] Call Me For Genuine Models We ...
nirzagarg
 
+97470301568>>weed for sale in qatar ,weed for sale in dubai,weed for sale in...
+97470301568>>weed for sale in qatar ,weed for sale in dubai,weed for sale in...+97470301568>>weed for sale in qatar ,weed for sale in dubai,weed for sale in...
+97470301568>>weed for sale in qatar ,weed for sale in dubai,weed for sale in...
Health
 

KĂźrzlich hochgeladen (20)

Abortion pills in Jeddah | +966572737505 | Get Cytotec
Abortion pills in Jeddah | +966572737505 | Get CytotecAbortion pills in Jeddah | +966572737505 | Get Cytotec
Abortion pills in Jeddah | +966572737505 | Get Cytotec
 
Kings of Saudi Arabia, information about them
Kings of Saudi Arabia, information about themKings of Saudi Arabia, information about them
Kings of Saudi Arabia, information about them
 
如何办理英国诺森比亚大学毕业证(NU毕业证书)成绩单原件一模一样
如何办理英国诺森比亚大学毕业证(NU毕业证书)成绩单原件一模一样如何办理英国诺森比亚大学毕业证(NU毕业证书)成绩单原件一模一样
如何办理英国诺森比亚大学毕业证(NU毕业证书)成绩单原件一模一样
 
Gulbai Tekra * Cheap Call Girls In Ahmedabad Phone No 8005736733 Elite Escort...
Gulbai Tekra * Cheap Call Girls In Ahmedabad Phone No 8005736733 Elite Escort...Gulbai Tekra * Cheap Call Girls In Ahmedabad Phone No 8005736733 Elite Escort...
Gulbai Tekra * Cheap Call Girls In Ahmedabad Phone No 8005736733 Elite Escort...
 
Top profile Call Girls In Chandrapur [ 7014168258 ] Call Me For Genuine Model...
Top profile Call Girls In Chandrapur [ 7014168258 ] Call Me For Genuine Model...Top profile Call Girls In Chandrapur [ 7014168258 ] Call Me For Genuine Model...
Top profile Call Girls In Chandrapur [ 7014168258 ] Call Me For Genuine Model...
 
20240412-SmartCityIndex-2024-Full-Report.pdf
20240412-SmartCityIndex-2024-Full-Report.pdf20240412-SmartCityIndex-2024-Full-Report.pdf
20240412-SmartCityIndex-2024-Full-Report.pdf
 
Gomti Nagar & best call girls in Lucknow | 9548273370 Independent Escorts & D...
Gomti Nagar & best call girls in Lucknow | 9548273370 Independent Escorts & D...Gomti Nagar & best call girls in Lucknow | 9548273370 Independent Escorts & D...
Gomti Nagar & best call girls in Lucknow | 9548273370 Independent Escorts & D...
 
Sealdah % High Class Call Girls Kolkata - 450+ Call Girl Cash Payment 8005736...
Sealdah % High Class Call Girls Kolkata - 450+ Call Girl Cash Payment 8005736...Sealdah % High Class Call Girls Kolkata - 450+ Call Girl Cash Payment 8005736...
Sealdah % High Class Call Girls Kolkata - 450+ Call Girl Cash Payment 8005736...
 
Reconciling Conflicting Data Curation Actions: Transparency Through Argument...
Reconciling Conflicting Data Curation Actions:  Transparency Through Argument...Reconciling Conflicting Data Curation Actions:  Transparency Through Argument...
Reconciling Conflicting Data Curation Actions: Transparency Through Argument...
 
Jual Obat Aborsi Surabaya ( Asli No.1 ) 085657271886 Obat Penggugur Kandungan...
Jual Obat Aborsi Surabaya ( Asli No.1 ) 085657271886 Obat Penggugur Kandungan...Jual Obat Aborsi Surabaya ( Asli No.1 ) 085657271886 Obat Penggugur Kandungan...
Jual Obat Aborsi Surabaya ( Asli No.1 ) 085657271886 Obat Penggugur Kandungan...
 
Top profile Call Girls In Latur [ 7014168258 ] Call Me For Genuine Models We ...
Top profile Call Girls In Latur [ 7014168258 ] Call Me For Genuine Models We ...Top profile Call Girls In Latur [ 7014168258 ] Call Me For Genuine Models We ...
Top profile Call Girls In Latur [ 7014168258 ] Call Me For Genuine Models We ...
 
Sonagachi * best call girls in Kolkata | ₹,9500 Pay Cash 8005736733 Free Home...
Sonagachi * best call girls in Kolkata | ₹,9500 Pay Cash 8005736733 Free Home...Sonagachi * best call girls in Kolkata | ₹,9500 Pay Cash 8005736733 Free Home...
Sonagachi * best call girls in Kolkata | ₹,9500 Pay Cash 8005736733 Free Home...
 
Digital Transformation Playbook by Graham Ware
Digital Transformation Playbook by Graham WareDigital Transformation Playbook by Graham Ware
Digital Transformation Playbook by Graham Ware
 
Nirala Nagar / Cheap Call Girls In Lucknow Phone No 9548273370 Elite Escort S...
Nirala Nagar / Cheap Call Girls In Lucknow Phone No 9548273370 Elite Escort S...Nirala Nagar / Cheap Call Girls In Lucknow Phone No 9548273370 Elite Escort S...
Nirala Nagar / Cheap Call Girls In Lucknow Phone No 9548273370 Elite Escort S...
 
Statistics notes ,it includes mean to index numbers
Statistics notes ,it includes mean to index numbersStatistics notes ,it includes mean to index numbers
Statistics notes ,it includes mean to index numbers
 
Fun all Day Call Girls in Jaipur 9332606886 High Profile Call Girls You Ca...
Fun all Day Call Girls in Jaipur   9332606886  High Profile Call Girls You Ca...Fun all Day Call Girls in Jaipur   9332606886  High Profile Call Girls You Ca...
Fun all Day Call Girls in Jaipur 9332606886 High Profile Call Girls You Ca...
 
Top profile Call Girls In Hapur [ 7014168258 ] Call Me For Genuine Models We ...
Top profile Call Girls In Hapur [ 7014168258 ] Call Me For Genuine Models We ...Top profile Call Girls In Hapur [ 7014168258 ] Call Me For Genuine Models We ...
Top profile Call Girls In Hapur [ 7014168258 ] Call Me For Genuine Models We ...
 
+97470301568>>weed for sale in qatar ,weed for sale in dubai,weed for sale in...
+97470301568>>weed for sale in qatar ,weed for sale in dubai,weed for sale in...+97470301568>>weed for sale in qatar ,weed for sale in dubai,weed for sale in...
+97470301568>>weed for sale in qatar ,weed for sale in dubai,weed for sale in...
 
Dubai Call Girls Peeing O525547819 Call Girls Dubai
Dubai Call Girls Peeing O525547819 Call Girls DubaiDubai Call Girls Peeing O525547819 Call Girls Dubai
Dubai Call Girls Peeing O525547819 Call Girls Dubai
 
Charbagh + Female Escorts Service in Lucknow | Starting ₹,5K To @25k with A/C...
Charbagh + Female Escorts Service in Lucknow | Starting ₹,5K To @25k with A/C...Charbagh + Female Escorts Service in Lucknow | Starting ₹,5K To @25k with A/C...
Charbagh + Female Escorts Service in Lucknow | Starting ₹,5K To @25k with A/C...
 

Empresa completo

  • 1. ---+--------------------+ | codigo | nombre | cargo | f_ingreso | salario | comision | cod_d ep | departamento_codep | +--------+----------------+------------+------------+---------+----------+------ ---+--------------------+ | 7369 | Carlos Perdomo | SUPERVISOR | 0000-00-00 | 800 | 50 | 20 | 10 | | 7499 | Fernando Velez | VENDEDOR | 0000-00-00 | 1600 | 300 | 30 | 20 | | 7521 | Rosario Gomez | VENDEDOR | 0000-00-00 | 2975 | 200 | 20 | 30 | +--------+----------------+------------+------------+---------+----------+------ ---+--------------------+ 3 rows in set (0.00 sec) mysql> show databases; +--------------------+ | Database | +--------------------+ | information_schema | | empresa | | mysql | +--------------------+ 3 rows in set (0.00 sec) mysql> drop database empresa; Query OK, 2 rows affected (0.10 sec) mysql> mysql> mysql> mysql> mysql> mysql> create database empresa; Query OK, 1 row affected (0.01 sec) mysql> use empresa; Database changed mysql> mysql> mysql> mysql> create table departamento -> (codep integer(30) PRIMARY KEY, -> nombre_der varchar(30), -> ubicacion varchar(30)); Query OK, 0 rows affected (0.05 sec) mysql> mysql> insert into departamento -> values(10,'contabilidad','cali'); Query OK, 1 row affected (0.02 sec) mysql> mysql> insert into departamento -> values(20,'investigacion','bogota'); Query OK, 1 row affected (0.02 sec) mysql> mysql> insert into departamento -> values(30,'ventas','manizales'); Query OK, 1 row affected (0.02 sec) mysql> select * from departamento; +-------+---------------+-----------+
  • 2. | codep | nombre_der | ubicacion | +-------+---------------+-----------+ | 10 | contabilidad | cali | | 20 | investigacion | bogota | | 30 | ventas | manizales | +-------+---------------+-----------+ 3 rows in set (0.00 sec) mysql> mysql> mysql> create table empleado -> (codigo integer, -> nombre varchar(30), -> cargo varchar(30), -> f_ingreso date, -> salario integer, -> comision integer, -> -> departamento_codep integer, -> PRIMARY KEY (codigo), -> FOREIGN KEY(departamento_codep) -> REFERENCES departamento(codep) -> ON DELETE NO ACTION -> ON UPDATE NO ACTION -> ); Query OK, 0 rows affected (0.06 sec) mysql> insert into empleado -> values(7369,'Carlos Perdomo','SUPERVISOR',1980-12-17,800,50,20); Query OK, 1 row affected, 1 warning (0.03 sec) mysql> mysql> insert into empleado -> values(7499,'Fernando Velez','VENDEDOR',1981-02-20,1600,300,30); Query OK, 1 row affected, 1 warning (0.02 sec) mysql> mysql> insert into empleado -> values(7521,'Rosario Gomez','VENDEDOR',1981-12-22,2975,200,30); Query OK, 1 row affected, 1 warning (0.01 sec) mysql> mysql> insert into empleado -> values(7566,'Jones Wilson','AUXILIAR',1981-04-21,2975,200,20); Query OK, 1 row affected, 1 warning (0.02 sec) mysql> mysql> insert into empleado -> values(7654,'Martin Vanegas','VENDEDOR',1998-03-04,1250,1400,30); Query OK, 1 row affected, 1 warning (0.02 sec) mysql> mysql> mysql> insert into empleado -> values(7698,'Blake Salas','AUXILIAR',2003-08-04,2850,150,30); Query OK, 1 row affected, 1 warning (0.02 sec) mysql> mysql> insert into empleado -> values(7782,'Clark Ken','AUXILIAR',2006-11-30,2450,1200,10); Query OK, 1 row affected, 1 warning (0.02 sec) mysql> mysql> insert into empleado
  • 3. -> values(7788,'Alma Scott','ANALISTA',2004-07-14,3000,0,20); Query OK, 1 row affected, 1 warning (0.02 sec) mysql> mysql> mysql> insert into empleado -> values(7839,'Clara Lopez','PRESIDENTE',1998-11-11,5000,0,10); Query OK, 1 row affected, 1 warning (0.02 sec) mysql> mysql> insert into empleado -> values(7844,'Zoila Estrada','VENDEDOR',2007-10-03,1500,1300,30); Query OK, 1 row affected, 1 warning (0.02 sec) mysql> mysql> insert into empleado -> values(7876,'Diego Perez','SUPERVISOR',1999-11-03,1100,100,20); Query OK, 1 row affected, 1 warning (0.02 sec) mysql> mysql> mysql> insert into empleado -> values(7900,'Ximena Rugeles','SUPERVISOR',2000-12-20,950,2500,30); Query OK, 1 row affected, 1 warning (0.01 sec) mysql> mysql> insert into empleado -> values(7902,'Viviana Morales','ANALISTA',2001-11-11,3000,1800,20); Query OK, 1 row affected, 1 warning (0.02 sec) mysql> mysql> insert into empleado -> values(7934,'Tito Lopez','SUPERVISOR',2006-06-05,1300,0,10); Query OK, 1 row affected, 1 warning (0.02 sec) mysql> select * from empleado; +--------+-----------------+------------+------------+---------+----------+----- ---------------+ | codigo | nombre | cargo | f_ingreso | salario | comision | depa rtamento_codep | +--------+-----------------+------------+------------+---------+----------+----- ---------------+ | 7369 | Carlos Perdomo | SUPERVISOR | 0000-00-00 | 800 | 50 | 20 | | 7499 | Fernando Velez | VENDEDOR | 0000-00-00 | 1600 | 300 | 30 | | 7521 | Rosario Gomez | VENDEDOR | 0000-00-00 | 2975 | 200 | 30 | | 7566 | Jones Wilson | AUXILIAR | 0000-00-00 | 2975 | 200 | 20 | | 7654 | Martin Vanegas | VENDEDOR | 0000-00-00 | 1250 | 1400 | 30 | | 7698 | Blake Salas | AUXILIAR | 0000-00-00 | 2850 | 150 | 30 | | 7782 | Clark Ken | AUXILIAR | 0000-00-00 | 2450 | 1200 | 10 | | 7788 | Alma Scott | ANALISTA | 0000-00-00 | 3000 | 0 | 20 | | 7839 | Clara Lopez | PRESIDENTE | 0000-00-00 | 5000 | 0 | 10 | | 7844 | Zoila Estrada | VENDEDOR | 0000-00-00 | 1500 | 1300 | 30 | | 7876 | Diego Perez | SUPERVISOR | 0000-00-00 | 1100 | 100 | 20 |
  • 4. | 7900 | Ximena Rugeles | SUPERVISOR | 0000-00-00 | 950 | 2500 | 30 | | 7902 | Viviana Morales | ANALISTA | 0000-00-00 | 3000 | 1800 | 20 | | 7934 | Tito Lopez | SUPERVISOR | 0000-00-00 | 1300 | 0 | 10 | +--------+-----------------+------------+------------+---------+----------+----- ---------------+ 14 rows in set (0.01 sec) mysql> select count(*) as 'NUMERO EMPLEADOS' from empleado; +------------------+ | NUMERO EMPLEADOS | +------------------+ | 14 | +------------------+ 1 row in set (0.03 sec) mysql> select count(DISTINCT CARGO) as 'NUMEROS DE CARGOS' from empleado; +-------------------+ | NUMEROS DE CARGOS | +-------------------+ | 5 | +-------------------+ 1 row in set (0.00 sec) mysql> select nombre_der as departamento, count(*) as 'NUMERO DE EMPLEADOS' from empleado, departamento where codep=deptno group by deptno; ERROR 1054 (42S22): Unknown column 'deptno' in 'where clause' mysql> mysql> mysql> mysql> mysql> select nombre_der as departamento, count(*) as "NUMERO DE EMPLEADOS" from empleado, departamento where codep=departamento_codep group by departamento_cod ep; +---------------+---------------------+ | departamento | NUMERO DE EMPLEADOS | +---------------+---------------------+ | contabilidad | 3 | | investigacion | 5 | | ventas | 6 | +---------------+---------------------+ 3 rows in set (0.03 sec) mysql> select cargo, count(*) as "empleados por cargo" from empleado group by ca rgo; +------------+---------------------+ | cargo | empleados por cargo | +------------+---------------------+ | ANALISTA | 2 | | AUXILIAR | 3 | | PRESIDENTE | 1 | | SUPERVISOR | 4 | | VENDEDOR | 4 | +------------+---------------------+ 5 rows in set (0.00 sec) mysql> select nombre_der as departamento, sum(salario) as "suma salario" from em pleado,departamento where codep=departamento_codep group by departamento_codep; +---------------+--------------+ | departamento | suma salario | +---------------+--------------+ | contabilidad | 8750 |
  • 5. | investigacion | 10875 | | ventas | 11125 | +---------------+--------------+ 3 rows in set (0.02 sec) mysql> select departamento_codep from empleado group by departamento_codep havin g sum(salario) >9000; +--------------------+ | departamento_codep | +--------------------+ | 20 | | 30 | +--------------------+ 2 rows in set (0.00 sec) mysql> select departamento_codep as CODIGO ,nombre_der as NOMBRE from empleado,d epartamento where codep=departamento_codep group by departamento_codep having su m(salario) >9000; +--------+---------------+ | CODIGO | NOMBRE | +--------+---------------+ | 20 | investigacion | | 30 | ventas | +--------+---------------+ 2 rows in set (0.00 sec) mysql> select max(salario) as "salario mas alto" from empleado; +------------------+ | salario mas alto | +------------------+ | 5000 | +------------------+ 1 row in set (0.00 sec) mysql> select nombre, salario from empleado where salario = (select max(salario) from empleado); +-------------+---------+ | nombre | salario | +-------------+---------+ | Clara Lopez | 5000 | +-------------+---------+ 1 row in set (0.03 sec) mysql>
  • 6. | investigacion | 10875 | | ventas | 11125 | +---------------+--------------+ 3 rows in set (0.02 sec) mysql> select departamento_codep from empleado group by departamento_codep havin g sum(salario) >9000; +--------------------+ | departamento_codep | +--------------------+ | 20 | | 30 | +--------------------+ 2 rows in set (0.00 sec) mysql> select departamento_codep as CODIGO ,nombre_der as NOMBRE from empleado,d epartamento where codep=departamento_codep group by departamento_codep having su m(salario) >9000; +--------+---------------+ | CODIGO | NOMBRE | +--------+---------------+ | 20 | investigacion | | 30 | ventas | +--------+---------------+ 2 rows in set (0.00 sec) mysql> select max(salario) as "salario mas alto" from empleado; +------------------+ | salario mas alto | +------------------+ | 5000 | +------------------+ 1 row in set (0.00 sec) mysql> select nombre, salario from empleado where salario = (select max(salario) from empleado); +-------------+---------+ | nombre | salario | +-------------+---------+ | Clara Lopez | 5000 | +-------------+---------+ 1 row in set (0.03 sec) mysql>