Continente

596 views
539 views

Published on

Published in: Travel, Technology
0 Comments
0 Likes
Statistics
Notes
  • Be the first to comment

  • Be the first to like this

No Downloads
Views
Total views
596
On SlideShare
0
From Embeds
0
Number of Embeds
3
Actions
Shares
0
Downloads
8
Comments
0
Likes
0
Embeds 0
No embeds

No notes for slide

Continente

  1. 1. DICCIONARIO DE DATOS PARA CONTINENTE<br />CREATE TABLE CONTINENTE(<br />IDCONTINENTE NUMBER(1) NOT NULL,<br />NOMBRE CHAR (20) NOT NULL,<br />TERRITORIO NUMBER(15) NOT NULL,<br />POBLACION NUMBER(15) NOT NULL,<br />CONSTRAINT PK_CONTINENTE PRIMARY KEY (IDCONTINENTE)<br />);<br /> <br />CREATE TABLE PAIS(<br />IDPAIS NUMBER (3) NOT NULL,<br />IDCONTINENTE NUMBER (1) NOT NULL,<br />NOMBRE CHAR (25) NOT NULL,<br />TERRITORIO NUMBER (15) NOT NULL,<br />POBLACION NUMBER (15) NOT NULL,<br />CONSTRAINT PK_PAIS PRIMARY KEY (IDPAIS),<br />CONSTRAINT FK_CONTINENTE FOREIGN KEY (IDCONTINENTE)<br /> REFERENCES CONTINENTE<br />);<br />CREATE TABLE ESTADO(<br />IDESTADO NUMBER (3) NOT NULL,<br />IDPAIS NUMBER (3) NOT NULL,<br />NOMBRE CHAR (25) NOT NULL,<br />CAPITAL CHAR (25) NOT NULL,<br />TERRITORIO NUMBER (15) NOT NULL,<br />POBLACION NUMBER (15) NOT NULL,<br />CONSTRAINT PK_ESTADO PRIMARY KEY (IDESTADO),<br />CONSTRAINT FK_PAIS FOREIGN KEY (IDPAIS)<br /> REFERENCES PAIS<br />);<br />*CONTINENTE<br />INSERT INTO CONTINENTE VALUES(1,'ASIA',44000000,400000000);<br />INSERT INTO CONTINENTE VALUES(2,'EUROPA',11100000,735000000);<br />INSERT INTO CONTINENTE VALUES(3,'AMERICA',42044000,783000000);<br />INSERT INTO CONTINENTE VALUES(4,'OCEANIA',9008458,33554546);<br />INSERT INTO CONTINENTE VALUES(5,'AFRICA',30270922,910844133);<br />*PAIS<br />INSERT INTO PAIS VALUES(001,1,'AFGANISTAN',56000000,123000000);<br />INSERT INTO PAIS VALUES(002,1,'ARABIA SAUDITA',45000000,342000000);<br />INSERT INTO PAIS VALUES(003,1,'ARMENIA',34000000,210000000);<br />INSERT INTO PAIS VALUES(004,2,'ALBANIA',45000000,143000000);<br />INSERT INTO PAIS VALUES(005,2,'ALEMANIA',23454000,213450000);<br />INSERT INTO PAIS VALUES(006,2,'AUSTRIA',25000000,235609000);<br />INSERT INTO PAIS VALUES(007,3,'BELICE',19005600,321000000);<br />INSERT INTO PAIS VALUES(008,3,'COSTA RICA',98000000,167239000);<br />INSERT INTO PAIS VALUES(009,3,'GUATEMALA',45000000,234789050);<br />INSERT INTO PAIS VALUES(010,4,'AUSTRALIA',25000000,214256000);<br />INSERT INTO PAIS VALUES(011,4,'NUEVA ZELANDA',78000000,267000000);<br />INSERT INTO PAIS VALUES(012,4,'SAMOA',58000000,156987200);<br />INSERT INTO PAIS VALUES(013,5,'ANGOLA',90000000,178200000);<br />INSERT INTO PAIS VALUES(014,5,'ARGELIA',72300000,173489000);<br />INSERT INTO PAIS VALUES(015,5,'BENIN',61000000,267000050);<br />*ESTADO<br />INSERT INTO ESTADO VALUES(100,001,'BAJA CALIFORNIA','MEXICALI',34000000,891000000);<br />INSERT INTO ESTADO VALUES(200,002,'SONORA','HERMOSILLO',56000000,231982000);<br />INSERT INTO ESTADO VALUES(300,003,'CHIHUAHUA','CHIHUAHUA',23100000,198270000);<br />INSERT INTO ESTADO VALUES(400,004,'NUEVO LEON','MONTERREY',56000000,234981300);<br />INSERT INTO ESTADO VALUES(500,005,'SINALOA','CULIACAN',32000000,210000000);<br />INSERT INTO ESTADO VALUES(600,006,'NAYARIT','TEPIC',60000000,212600000);<br />INSERT INTO ESTADO VALUES(700,007,'GUADALAJARA','JALISCO',69000000,245678000);<br />INSERT INTO ESTADO VALUES(800,008,'MORELIA','MICHOACAN',89000000,109000000);<br />INSERT INTO ESTADO VALUES(900,009,'VERACRUZ','XALAPA',85000000,205678000);<br />INSERT INTO ESTADO VALUES(110,011,'YUCATAN','MERIDA',28000100,251200000);<br />INSERT INTO ESTADO VALUES(120,012,'TABASCO','VILLA HERMOSA',39400000,231500000);<br />INSERT INTO ESTADO VALUES(130,013,'OAXACA','OAXACA',67000000,207167000);<br />INSERT INTO ESTADO VALUES(140,014,'COAHUILA','SALTILLO',79020000,198273030);<br />INSERT INTO ESTADO VALUES(150,015,'TAMAULIPAS','CIUDAD VISCTORIA',47200390,245020000);<br />*CONSULTAS<br />/*MUESTRA EL PAIS MAS POBLADO<br />SELECT MAX(POBLACION) FROM PAIS;<br />/*MODIFICO EL TERRITORIO DE LOS PAISES<br />UPDATE PAIS SET TERRITORIO = TERRITORIO *1.2;<br />/*MODIFICA LA POBLACION DE LOS PAISES<br />UPDATE PAIS SET POBLACION = POBLACION *1.2;<br />/*MUESTRA LA RELACION POBLACION/TERRITORIO DE LOS ESTADOS<br />SELECT POBLACION, TERRITORIO, NOMBRE FROM ESTADO;<br />/*MUESTRA LA RELACION POBLACION/TERRITORIO DE LOS PAISES<br />SELECT POBLACION, TERRITORIO, NOMBRE FROM PAISES;<br />/*MUESTRA LA RELACION POBLACION/TERRITORIO DE LOS CONTINENTES<br />SELECT POBLACION, TERRITORIO, NOMBRE FROM CONTINENTES;<br />-4514855643880-4514852586355-375285-242570<br />-3752853557270-375285-118745<br />-3752855139055-3752853281680-375285-233680<br />-3752852929255-375285-233045<br />-384810109855<br />-432435273685<br />-3848104691380-3848102242820-384810-156845<br />CONTINENTE*IDCONTINENTE (PK)*TERRITORIO*POBLACION*NOMBRE PAIS*IDPAIS (PK)*IDCONTINENTE (FK)*NOMBRE*TERRITORIO*POBLACIONESTADO*IDESTADO (PK)*IDPAIS (FK)*NOMBRE*CAPITAL*TERRITORIO*POBLACIONCUENTAASIGNA<br />

×