SlideShare a Scribd company logo
1 of 9
CamiloUribe 2308542
Taller3
1. Creaciónde tablasenSQL.
Tabla posiciones:
CREATE TABLE "POSICIONES"
( "POSICIONID" NUMBER(*,0) NOT NULL ENABLE,
"CARGO" CHAR(55) NOT NULL ENABLE,
"DESCRIPCION" CHAR(60) NOT NULL ENABLE,
CONSTRAINT "PK_POSICIONES" PRIMARY KEY ("POSICIONID") ENABLE
)
Tabla autores:
CREATE TABLE "AUTORES"
( "AUTORID" NUMBER(*,0) NOT NULL ENABLE,
"NOMBRE" CHAR(30) NOT NULL ENABLE,
"APELLIDO" CHAR(30) NOT NULL ENABLE,
"AÑONAC" CHAR(15) NOT NULL ENABLE,
"AÑOMUERTE" CHAR(15) NOT NULL ENABLE,
"DESCRIPCION" CHAR(60) NOT NULL ENABLE,
CONSTRAINT "PK_AUTORES" PRIMARY KEY ("AUTORID") ENABLE
)
Tabla clientes:
CREATE TABLE "CLIENTES"
( "CLIENTEID" NUMBER(*,0) NOT NULL ENABLE,
"NOMBRE" CHAR(30) NOT NULL ENABLE,
"APELLIDO" CHAR(30) NOT NULL ENABLE,
"TELEFONO" NUMBER(15) NOT NULL ENABLE,
"DIR1" CHAR(30) NOT NULL ENABLE,
"DIR2" CHAR(30) NOT NULL ENABLE,
"CIUDAD" CHAR(12) NOT NULL ENABLE,
"ESTADO" CHAR(15) NOT NULL ENABLE,
"PAIS" CHAR(20) NOT NULL ENABLE,
"CP" CHAR(30) NOT NULL ENABLE,
CONSTRAINT "PK_CLIENTES" PRIMARY KEY ("CLIENTEID") ENABLE
)
Tabla EstadoOrden:
CREATE TABLE "ESTADOORDEN"
( "ESTADOID" NUMBER(*,0) NOT NULL ENABLE,
"ESTADODESCRIP" CHAR(60) NOT NULL ENABLE,
CONSTRAINT "PK_ESTADOORDEN" PRIMARY KEY ("ESTADOID") ENABLE
)
Tabla FormaPago:
CREATE TABLE "FORMAPAGO"
( "PAGOID" NUMBER(*,0) NOT NULL ENABLE,
"PAGODESCRIP" CHAR(60) NOT NULL ENABLE,
CONSTRAINT "PK_FORMAPAGO" PRIMARY KEY ("PAGOID") ENABLE
)
Tabla LibroEstado:
CREATE TABLE "LIBROESTADO"
( "CONDICIONID" NUMBER(*,0) NOT NULL ENABLE,
"NOMBRECOND" CHAR(20) NOT NULL ENABLE,
"DESCRIPCION" CHAR(60) NOT NULL ENABLE,
CONSTRAINT "PK_LIBROESTADO" PRIMARY KEY ("CONDICIONID") ENABLE
)
Tabla Empleados:
CREATE TABLE "EMPLEADOS"
( "EMPLEADOSID" NUMBER(*,0) NOT NULL ENABLE,
"POSICIONID" NUMBER(*,0),
"NOMBRE" CHAR(30) NOT NULL ENABLE,
"APELLIDO" CHAR(30) NOT NULL ENABLE,
"DIR1" CHAR(30) NOT NULL ENABLE,
"DIR2" CHAR(30) NOT NULL ENABLE,
"CIUDAD" CHAR(12) NOT NULL ENABLE,
"ESTADO" CHAR(12) NOT NULL ENABLE,
"CP" CHAR(30) NOT NULL ENABLE,
"TELEFONO" NUMBER (*,0) NOT NULL ENABLE,
"FECHAING" CHAR(20) NOT NULL ENABLE,
CONSTRAINT "PK_EMPLEADOS" PRIMARY KEY ("EMPLEADOSID") ENABLE,
CONSTRAINT "FK_EMPLEAD_PERTENECE_POSICIO" FOREIGN KEY ("POSICIONID")
REFERENCES "POSICIONES" ("POSICIONID") ENABLE
)
Tabla Libros
CREATE TABLE "LIBROS"
( "LIBROID" NUMBER(*,0) NOT NULL ENABLE,
"CONDICIONID" NUMBER(*,0),
"TITULO" CHAR(30) NOT NULL ENABLE,
"EDITOR" CHAR(30) NOT NULL ENABLE,
"FECHAED" CHAR(30) NOT NULL ENABLE,
"COSTO" NUMBER(*,0) NOT NULL ENABLE,
"VENDIDO" NUMBER(*,0) NOT NULL ENABLE,
CONSTRAINT "PK_LIBROS" PRIMARY KEY ("LIBROID") ENABLE,
CONSTRAINT "FK_LIBR_PERTENECE_LIBROEST" FOREIGN KEY ("CONDICIONID")
REFERENCES "LIBROESTADO" ("CONDICIONID") ENABLE
)
Tabla LibrosAutores:
CREATE TABLE "LIBROSAUTORES"
( "LIBROID" NUMBER NOT NULL ENABLE,
"AUTORID" NUMBER NOT NULL ENABLE,
CONSTRAINT "LIBROSAUTORES_FK" FOREIGN KEY ("LIBROID")
REFERENCES "LIBROS" ("LIBROID") ENABLE,
CONSTRAINT "LIBROSAUTORES_FK2" FOREIGN KEY ("AUTORID")
REFERENCES "AUTORES" ("AUTORID") ENABLE
)
Tabla Ordenes:
CREATE TABLE "ORDENES"
( "ORDENID" NUMBER NOT NULL ENABLE,
"EMPLEADOSID" NUMBER NOT NULL ENABLE,
"PAGOID" NUMBER NOT NULL ENABLE,
"FECHAENVIO" CHAR(30) NOT NULL ENABLE,
"FECHAORDEN" CHAR(30) NOT NULL ENABLE,
"MONTO" CHAR(30) NOT NULL ENABLE,
"CLIENTEID" NUMBER NOT NULL ENABLE,
"ESTADOID" NUMBER NOT NULL ENABLE,
CONSTRAINT "ORDENES_PK" PRIMARY KEY ("ORDENID") ENABLE,
CONSTRAINT "ORDENES_FK" FOREIGN KEY ("EMPLEADOSID")
REFERENCES "EMPLEADOS" ("EMPLEADOSID") ENABLE,
CONSTRAINT "ORDENES_FK2" FOREIGN KEY ("PAGOID")
REFERENCES "FORMAPAGO" ("PAGOID") ENABLE,
CONSTRAINT "ORDENES_FK3" FOREIGN KEY ("CLIENTEID")
REFERENCES "CLIENTES" ("CLIENTEID") ENABLE,
CONSTRAINT "ORDENES_FK4" FOREIGN KEY ("ESTADOID")
REFERENCES "ESTADOORDEN" ("ESTADOID") ENABLE
)
Tabla LibrosOrdenes
CREATE TABLE "LIBROSORDENES"
( "LIBROID" NUMBER(*,0),
"ORDENID" NUMBER(*,0),
CONSTRAINT "FK_LIBRSORD_PERTENECE_LIBR" FOREIGN KEY ("LIBROID")
REFERENCES "LIBROS" ("LIBROID") ENABLE,
CONSTRAINT "FK2_LIBRSORD_PERTENECE_ORDN" FOREIGN KEY ("ORDENID")
REFERENCES "ORDENES" ("ORDENID") ENABLE
)
2. Insertar datos por SQL.
INSERT INTO ESTADOORDEN (ESTADOID, ESTADODESCRIP)
VALUES (5, 'EN ESPERA')
INSERT INTO LIBROESTADO (CONDICIONID, NOMBRECOND, DESCRIPCION) VALUES (01,'BUENA',
'PRESTADA')
INSERT INTO FORMAPAGO (PAGOID, PAGODESCRIP) VALUES (01, 'EFECTIVO')
INSERT INTO POSICIONES (POSICIONID, CARGO, DESCRIPCION)
VALUES (01, 'GERENTE', 'DIRIGE PERSONAL')
INSERT INTO CLIENTES (CLIENTEID, NOMBRE, APELLIDO, TELEFONO, DIR1, DIR2, CIUDAD, ESTADO, PAIS,
CP) VALUES (01, 'ANDRES', 'TORO', 3166213877,'CALLE 26 A 25-23', 'CARRERA 15 26 B15', 'TULUA', 'ACTIVO',
'COLOMBIA',123)
INSERT INTO AUTORES (AUTORID, NOMBRE, APELLIDO, AÑONAC, AÑOMUERTE, DESCRIPCION) VALUES
(01, 'WILLIAM', 'SHAKESPEARE', '10/04/1652', '15/2/1738','BUEN AUTOR Y POETA')
INSERT INTO LIBROS (LIBROID, CONDICIONID, TITULO, EDITOR, FECHAED, COSTO, VENDIDO) VALUES
(01, 01, El Exilio De Sharra,'Darkover', '05/04/2000',35000,2)
INSERT INTO EMPLEADOS (EMPLEADOSID, NOMBRE, APELLIDO, DIR1, DIR2, CIUDAD, ESTADO, CP,
TELEFONO, FECHAING, POSICIONID) VALUES (02, 'JOSE', 'MENESES', 'CALLE 3 #4-5', 'CRA 8 # 5-6', 'TULUA',
'AFILIADO', 1210,3152002000,'01/07/09,01)
INSERT INTO ORDENES (ORDENID, CLIENTEID, EMPLEADOSID, MONTO, FECHAORDEN, FECHAENVIO,
PAGOID, ESTADOID) VALUES (01, 01, 01, 50, '12/08/10', '15/08/10', 01, 01)
INSERT INTO LIBROSAUTORES (LIBROID, AUTORID) VALUES (01,01)
INSERT INTO LIBROSORDENES (ORDENID, LIBROID) VALUES (01, 01)

More Related Content

What's hot

UITableView Pain Points
UITableView Pain PointsUITableView Pain Points
UITableView Pain PointsKen Auer
 
Exemple de création de base
Exemple de création de baseExemple de création de base
Exemple de création de baseSaber LAJILI
 
Script de creación de la base de datos pedidos en MS Access
Script de creación de la base de datos pedidos en MS AccessScript de creación de la base de datos pedidos en MS Access
Script de creación de la base de datos pedidos en MS AccessZantiago Thrash
 
Advanced jQuery
Advanced jQueryAdvanced jQuery
Advanced jQuerysergioafp
 
Oracle helpdesk database shema
Oracle helpdesk database shemaOracle helpdesk database shema
Oracle helpdesk database shemaMurat Gülci
 

What's hot (8)

My sql
My sqlMy sql
My sql
 
UITableView Pain Points
UITableView Pain PointsUITableView Pain Points
UITableView Pain Points
 
SQL & PLSQL
SQL & PLSQLSQL & PLSQL
SQL & PLSQL
 
Exemple de création de base
Exemple de création de baseExemple de création de base
Exemple de création de base
 
PhoneGap: Local Storage
PhoneGap: Local StoragePhoneGap: Local Storage
PhoneGap: Local Storage
 
Script de creación de la base de datos pedidos en MS Access
Script de creación de la base de datos pedidos en MS AccessScript de creación de la base de datos pedidos en MS Access
Script de creación de la base de datos pedidos en MS Access
 
Advanced jQuery
Advanced jQueryAdvanced jQuery
Advanced jQuery
 
Oracle helpdesk database shema
Oracle helpdesk database shemaOracle helpdesk database shema
Oracle helpdesk database shema
 

Viewers also liked

Wf studentphotos
Wf studentphotosWf studentphotos
Wf studentphotosewatzke
 
Creating culture of innovation and creativity North Kirklees CCG
 Creating culture of innovation and creativity North Kirklees CCG Creating culture of innovation and creativity North Kirklees CCG
Creating culture of innovation and creativity North Kirklees CCGMichael Barker
 
Creating Employee Engagement Leeds South and East CCG
Creating Employee Engagement Leeds South and East CCGCreating Employee Engagement Leeds South and East CCG
Creating Employee Engagement Leeds South and East CCGMichael Barker
 
Impressions
ImpressionsImpressions
ImpressionsArtland
 
Le futur de la publicité TV
Le futur de la publicité TVLe futur de la publicité TV
Le futur de la publicité TVStephane Martin
 

Viewers also liked (7)

Wf studentphotos
Wf studentphotosWf studentphotos
Wf studentphotos
 
Gigo
GigoGigo
Gigo
 
Creating culture of innovation and creativity North Kirklees CCG
 Creating culture of innovation and creativity North Kirklees CCG Creating culture of innovation and creativity North Kirklees CCG
Creating culture of innovation and creativity North Kirklees CCG
 
The Refusers
The RefusersThe Refusers
The Refusers
 
Creating Employee Engagement Leeds South and East CCG
Creating Employee Engagement Leeds South and East CCGCreating Employee Engagement Leeds South and East CCG
Creating Employee Engagement Leeds South and East CCG
 
Impressions
ImpressionsImpressions
Impressions
 
Le futur de la publicité TV
Le futur de la publicité TVLe futur de la publicité TV
Le futur de la publicité TV
 

Similar to SQL Tables and Data Insertion for Book Store Database

CreacióN Tablas En Oracle
CreacióN Tablas En OracleCreacióN Tablas En Oracle
CreacióN Tablas En Oracleesacre
 
Try PostgreSQL on linux
Try PostgreSQL on linuxTry PostgreSQL on linux
Try PostgreSQL on linuxAey Unthika
 
Sql
SqlSql
SqlJoao
 
Identificacion De Las Llaves Foraneas
Identificacion De Las Llaves ForaneasIdentificacion De Las Llaves Foraneas
Identificacion De Las Llaves Foraneasrobertjeison
 
Tablas, Codigos De Base De Datos
Tablas, Codigos De Base De DatosTablas, Codigos De Base De Datos
Tablas, Codigos De Base De Datosguesta050b04
 
- Php myadmin sql dump-- version 4.0.10.7-- httpwww.php
 - Php myadmin sql dump-- version 4.0.10.7-- httpwww.php - Php myadmin sql dump-- version 4.0.10.7-- httpwww.php
- Php myadmin sql dump-- version 4.0.10.7-- httpwww.phpssuserfa5723
 
SQL FILE FROM MOODLEUSE [master]GO Object Databa.pdf
SQL FILE FROM MOODLEUSE [master]GO Object Databa.pdfSQL FILE FROM MOODLEUSE [master]GO Object Databa.pdf
SQL FILE FROM MOODLEUSE [master]GO Object Databa.pdfarrowit1
 

Similar to SQL Tables and Data Insertion for Book Store Database (16)

Taller4
Taller4Taller4
Taller4
 
Database
DatabaseDatabase
Database
 
CreacióN Tablas En Oracle
CreacióN Tablas En OracleCreacióN Tablas En Oracle
CreacióN Tablas En Oracle
 
Sql commands
Sql commandsSql commands
Sql commands
 
Try PostgreSQL on linux
Try PostgreSQL on linuxTry PostgreSQL on linux
Try PostgreSQL on linux
 
Sql
SqlSql
Sql
 
Tallerpractica
TallerpracticaTallerpractica
Tallerpractica
 
Tallerpractica
TallerpracticaTallerpractica
Tallerpractica
 
Tallerpractica
TallerpracticaTallerpractica
Tallerpractica
 
Criando tabelas
Criando tabelasCriando tabelas
Criando tabelas
 
Sql ejercicio 1
Sql ejercicio 1Sql ejercicio 1
Sql ejercicio 1
 
Identificacion De Las Llaves Foraneas
Identificacion De Las Llaves ForaneasIdentificacion De Las Llaves Foraneas
Identificacion De Las Llaves Foraneas
 
Tablas, Codigos De Base De Datos
Tablas, Codigos De Base De DatosTablas, Codigos De Base De Datos
Tablas, Codigos De Base De Datos
 
Mysql schema emp dept
Mysql schema emp deptMysql schema emp dept
Mysql schema emp dept
 
- Php myadmin sql dump-- version 4.0.10.7-- httpwww.php
 - Php myadmin sql dump-- version 4.0.10.7-- httpwww.php - Php myadmin sql dump-- version 4.0.10.7-- httpwww.php
- Php myadmin sql dump-- version 4.0.10.7-- httpwww.php
 
SQL FILE FROM MOODLEUSE [master]GO Object Databa.pdf
SQL FILE FROM MOODLEUSE [master]GO Object Databa.pdfSQL FILE FROM MOODLEUSE [master]GO Object Databa.pdf
SQL FILE FROM MOODLEUSE [master]GO Object Databa.pdf
 

Recently uploaded

So einfach geht modernes Roaming fuer Notes und Nomad.pdf
So einfach geht modernes Roaming fuer Notes und Nomad.pdfSo einfach geht modernes Roaming fuer Notes und Nomad.pdf
So einfach geht modernes Roaming fuer Notes und Nomad.pdfpanagenda
 
Merck Moving Beyond Passwords: FIDO Paris Seminar.pptx
Merck Moving Beyond Passwords: FIDO Paris Seminar.pptxMerck Moving Beyond Passwords: FIDO Paris Seminar.pptx
Merck Moving Beyond Passwords: FIDO Paris Seminar.pptxLoriGlavin3
 
Take control of your SAP testing with UiPath Test Suite
Take control of your SAP testing with UiPath Test SuiteTake control of your SAP testing with UiPath Test Suite
Take control of your SAP testing with UiPath Test SuiteDianaGray10
 
DevEX - reference for building teams, processes, and platforms
DevEX - reference for building teams, processes, and platformsDevEX - reference for building teams, processes, and platforms
DevEX - reference for building teams, processes, and platformsSergiu Bodiu
 
A Deep Dive on Passkeys: FIDO Paris Seminar.pptx
A Deep Dive on Passkeys: FIDO Paris Seminar.pptxA Deep Dive on Passkeys: FIDO Paris Seminar.pptx
A Deep Dive on Passkeys: FIDO Paris Seminar.pptxLoriGlavin3
 
UiPath Community: Communication Mining from Zero to Hero
UiPath Community: Communication Mining from Zero to HeroUiPath Community: Communication Mining from Zero to Hero
UiPath Community: Communication Mining from Zero to HeroUiPathCommunity
 
Digital Identity is Under Attack: FIDO Paris Seminar.pptx
Digital Identity is Under Attack: FIDO Paris Seminar.pptxDigital Identity is Under Attack: FIDO Paris Seminar.pptx
Digital Identity is Under Attack: FIDO Paris Seminar.pptxLoriGlavin3
 
A Journey Into the Emotions of Software Developers
A Journey Into the Emotions of Software DevelopersA Journey Into the Emotions of Software Developers
A Journey Into the Emotions of Software DevelopersNicole Novielli
 
How to Effectively Monitor SD-WAN and SASE Environments with ThousandEyes
How to Effectively Monitor SD-WAN and SASE Environments with ThousandEyesHow to Effectively Monitor SD-WAN and SASE Environments with ThousandEyes
How to Effectively Monitor SD-WAN and SASE Environments with ThousandEyesThousandEyes
 
TeamStation AI System Report LATAM IT Salaries 2024
TeamStation AI System Report LATAM IT Salaries 2024TeamStation AI System Report LATAM IT Salaries 2024
TeamStation AI System Report LATAM IT Salaries 2024Lonnie McRorey
 
Connecting the Dots for Information Discovery.pdf
Connecting the Dots for Information Discovery.pdfConnecting the Dots for Information Discovery.pdf
Connecting the Dots for Information Discovery.pdfNeo4j
 
Why device, WIFI, and ISP insights are crucial to supporting remote Microsoft...
Why device, WIFI, and ISP insights are crucial to supporting remote Microsoft...Why device, WIFI, and ISP insights are crucial to supporting remote Microsoft...
Why device, WIFI, and ISP insights are crucial to supporting remote Microsoft...panagenda
 
Unleashing Real-time Insights with ClickHouse_ Navigating the Landscape in 20...
Unleashing Real-time Insights with ClickHouse_ Navigating the Landscape in 20...Unleashing Real-time Insights with ClickHouse_ Navigating the Landscape in 20...
Unleashing Real-time Insights with ClickHouse_ Navigating the Landscape in 20...Alkin Tezuysal
 
Scale your database traffic with Read & Write split using MySQL Router
Scale your database traffic with Read & Write split using MySQL RouterScale your database traffic with Read & Write split using MySQL Router
Scale your database traffic with Read & Write split using MySQL RouterMydbops
 
Transcript: New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024Transcript: New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024BookNet Canada
 
2024 April Patch Tuesday
2024 April Patch Tuesday2024 April Patch Tuesday
2024 April Patch TuesdayIvanti
 
Genislab builds better products and faster go-to-market with Lean project man...
Genislab builds better products and faster go-to-market with Lean project man...Genislab builds better products and faster go-to-market with Lean project man...
Genislab builds better products and faster go-to-market with Lean project man...Farhan Tariq
 
Manual 508 Accessibility Compliance Audit
Manual 508 Accessibility Compliance AuditManual 508 Accessibility Compliance Audit
Manual 508 Accessibility Compliance AuditSkynet Technologies
 
Potential of AI (Generative AI) in Business: Learnings and Insights
Potential of AI (Generative AI) in Business: Learnings and InsightsPotential of AI (Generative AI) in Business: Learnings and Insights
Potential of AI (Generative AI) in Business: Learnings and InsightsRavi Sanghani
 
How AI, OpenAI, and ChatGPT impact business and software.
How AI, OpenAI, and ChatGPT impact business and software.How AI, OpenAI, and ChatGPT impact business and software.
How AI, OpenAI, and ChatGPT impact business and software.Curtis Poe
 

Recently uploaded (20)

So einfach geht modernes Roaming fuer Notes und Nomad.pdf
So einfach geht modernes Roaming fuer Notes und Nomad.pdfSo einfach geht modernes Roaming fuer Notes und Nomad.pdf
So einfach geht modernes Roaming fuer Notes und Nomad.pdf
 
Merck Moving Beyond Passwords: FIDO Paris Seminar.pptx
Merck Moving Beyond Passwords: FIDO Paris Seminar.pptxMerck Moving Beyond Passwords: FIDO Paris Seminar.pptx
Merck Moving Beyond Passwords: FIDO Paris Seminar.pptx
 
Take control of your SAP testing with UiPath Test Suite
Take control of your SAP testing with UiPath Test SuiteTake control of your SAP testing with UiPath Test Suite
Take control of your SAP testing with UiPath Test Suite
 
DevEX - reference for building teams, processes, and platforms
DevEX - reference for building teams, processes, and platformsDevEX - reference for building teams, processes, and platforms
DevEX - reference for building teams, processes, and platforms
 
A Deep Dive on Passkeys: FIDO Paris Seminar.pptx
A Deep Dive on Passkeys: FIDO Paris Seminar.pptxA Deep Dive on Passkeys: FIDO Paris Seminar.pptx
A Deep Dive on Passkeys: FIDO Paris Seminar.pptx
 
UiPath Community: Communication Mining from Zero to Hero
UiPath Community: Communication Mining from Zero to HeroUiPath Community: Communication Mining from Zero to Hero
UiPath Community: Communication Mining from Zero to Hero
 
Digital Identity is Under Attack: FIDO Paris Seminar.pptx
Digital Identity is Under Attack: FIDO Paris Seminar.pptxDigital Identity is Under Attack: FIDO Paris Seminar.pptx
Digital Identity is Under Attack: FIDO Paris Seminar.pptx
 
A Journey Into the Emotions of Software Developers
A Journey Into the Emotions of Software DevelopersA Journey Into the Emotions of Software Developers
A Journey Into the Emotions of Software Developers
 
How to Effectively Monitor SD-WAN and SASE Environments with ThousandEyes
How to Effectively Monitor SD-WAN and SASE Environments with ThousandEyesHow to Effectively Monitor SD-WAN and SASE Environments with ThousandEyes
How to Effectively Monitor SD-WAN and SASE Environments with ThousandEyes
 
TeamStation AI System Report LATAM IT Salaries 2024
TeamStation AI System Report LATAM IT Salaries 2024TeamStation AI System Report LATAM IT Salaries 2024
TeamStation AI System Report LATAM IT Salaries 2024
 
Connecting the Dots for Information Discovery.pdf
Connecting the Dots for Information Discovery.pdfConnecting the Dots for Information Discovery.pdf
Connecting the Dots for Information Discovery.pdf
 
Why device, WIFI, and ISP insights are crucial to supporting remote Microsoft...
Why device, WIFI, and ISP insights are crucial to supporting remote Microsoft...Why device, WIFI, and ISP insights are crucial to supporting remote Microsoft...
Why device, WIFI, and ISP insights are crucial to supporting remote Microsoft...
 
Unleashing Real-time Insights with ClickHouse_ Navigating the Landscape in 20...
Unleashing Real-time Insights with ClickHouse_ Navigating the Landscape in 20...Unleashing Real-time Insights with ClickHouse_ Navigating the Landscape in 20...
Unleashing Real-time Insights with ClickHouse_ Navigating the Landscape in 20...
 
Scale your database traffic with Read & Write split using MySQL Router
Scale your database traffic with Read & Write split using MySQL RouterScale your database traffic with Read & Write split using MySQL Router
Scale your database traffic with Read & Write split using MySQL Router
 
Transcript: New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024Transcript: New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024
 
2024 April Patch Tuesday
2024 April Patch Tuesday2024 April Patch Tuesday
2024 April Patch Tuesday
 
Genislab builds better products and faster go-to-market with Lean project man...
Genislab builds better products and faster go-to-market with Lean project man...Genislab builds better products and faster go-to-market with Lean project man...
Genislab builds better products and faster go-to-market with Lean project man...
 
Manual 508 Accessibility Compliance Audit
Manual 508 Accessibility Compliance AuditManual 508 Accessibility Compliance Audit
Manual 508 Accessibility Compliance Audit
 
Potential of AI (Generative AI) in Business: Learnings and Insights
Potential of AI (Generative AI) in Business: Learnings and InsightsPotential of AI (Generative AI) in Business: Learnings and Insights
Potential of AI (Generative AI) in Business: Learnings and Insights
 
How AI, OpenAI, and ChatGPT impact business and software.
How AI, OpenAI, and ChatGPT impact business and software.How AI, OpenAI, and ChatGPT impact business and software.
How AI, OpenAI, and ChatGPT impact business and software.
 

SQL Tables and Data Insertion for Book Store Database

  • 1. CamiloUribe 2308542 Taller3 1. Creaciónde tablasenSQL. Tabla posiciones: CREATE TABLE "POSICIONES" ( "POSICIONID" NUMBER(*,0) NOT NULL ENABLE, "CARGO" CHAR(55) NOT NULL ENABLE, "DESCRIPCION" CHAR(60) NOT NULL ENABLE, CONSTRAINT "PK_POSICIONES" PRIMARY KEY ("POSICIONID") ENABLE ) Tabla autores: CREATE TABLE "AUTORES" ( "AUTORID" NUMBER(*,0) NOT NULL ENABLE, "NOMBRE" CHAR(30) NOT NULL ENABLE, "APELLIDO" CHAR(30) NOT NULL ENABLE, "AÑONAC" CHAR(15) NOT NULL ENABLE, "AÑOMUERTE" CHAR(15) NOT NULL ENABLE, "DESCRIPCION" CHAR(60) NOT NULL ENABLE, CONSTRAINT "PK_AUTORES" PRIMARY KEY ("AUTORID") ENABLE ) Tabla clientes: CREATE TABLE "CLIENTES" ( "CLIENTEID" NUMBER(*,0) NOT NULL ENABLE, "NOMBRE" CHAR(30) NOT NULL ENABLE, "APELLIDO" CHAR(30) NOT NULL ENABLE,
  • 2. "TELEFONO" NUMBER(15) NOT NULL ENABLE, "DIR1" CHAR(30) NOT NULL ENABLE, "DIR2" CHAR(30) NOT NULL ENABLE, "CIUDAD" CHAR(12) NOT NULL ENABLE, "ESTADO" CHAR(15) NOT NULL ENABLE, "PAIS" CHAR(20) NOT NULL ENABLE, "CP" CHAR(30) NOT NULL ENABLE, CONSTRAINT "PK_CLIENTES" PRIMARY KEY ("CLIENTEID") ENABLE ) Tabla EstadoOrden: CREATE TABLE "ESTADOORDEN" ( "ESTADOID" NUMBER(*,0) NOT NULL ENABLE, "ESTADODESCRIP" CHAR(60) NOT NULL ENABLE, CONSTRAINT "PK_ESTADOORDEN" PRIMARY KEY ("ESTADOID") ENABLE ) Tabla FormaPago: CREATE TABLE "FORMAPAGO" ( "PAGOID" NUMBER(*,0) NOT NULL ENABLE, "PAGODESCRIP" CHAR(60) NOT NULL ENABLE, CONSTRAINT "PK_FORMAPAGO" PRIMARY KEY ("PAGOID") ENABLE ) Tabla LibroEstado: CREATE TABLE "LIBROESTADO" ( "CONDICIONID" NUMBER(*,0) NOT NULL ENABLE, "NOMBRECOND" CHAR(20) NOT NULL ENABLE, "DESCRIPCION" CHAR(60) NOT NULL ENABLE, CONSTRAINT "PK_LIBROESTADO" PRIMARY KEY ("CONDICIONID") ENABLE )
  • 3. Tabla Empleados: CREATE TABLE "EMPLEADOS" ( "EMPLEADOSID" NUMBER(*,0) NOT NULL ENABLE, "POSICIONID" NUMBER(*,0), "NOMBRE" CHAR(30) NOT NULL ENABLE, "APELLIDO" CHAR(30) NOT NULL ENABLE, "DIR1" CHAR(30) NOT NULL ENABLE, "DIR2" CHAR(30) NOT NULL ENABLE, "CIUDAD" CHAR(12) NOT NULL ENABLE, "ESTADO" CHAR(12) NOT NULL ENABLE, "CP" CHAR(30) NOT NULL ENABLE, "TELEFONO" NUMBER (*,0) NOT NULL ENABLE, "FECHAING" CHAR(20) NOT NULL ENABLE, CONSTRAINT "PK_EMPLEADOS" PRIMARY KEY ("EMPLEADOSID") ENABLE, CONSTRAINT "FK_EMPLEAD_PERTENECE_POSICIO" FOREIGN KEY ("POSICIONID") REFERENCES "POSICIONES" ("POSICIONID") ENABLE ) Tabla Libros CREATE TABLE "LIBROS" ( "LIBROID" NUMBER(*,0) NOT NULL ENABLE, "CONDICIONID" NUMBER(*,0), "TITULO" CHAR(30) NOT NULL ENABLE, "EDITOR" CHAR(30) NOT NULL ENABLE, "FECHAED" CHAR(30) NOT NULL ENABLE, "COSTO" NUMBER(*,0) NOT NULL ENABLE, "VENDIDO" NUMBER(*,0) NOT NULL ENABLE, CONSTRAINT "PK_LIBROS" PRIMARY KEY ("LIBROID") ENABLE, CONSTRAINT "FK_LIBR_PERTENECE_LIBROEST" FOREIGN KEY ("CONDICIONID") REFERENCES "LIBROESTADO" ("CONDICIONID") ENABLE )
  • 4. Tabla LibrosAutores: CREATE TABLE "LIBROSAUTORES" ( "LIBROID" NUMBER NOT NULL ENABLE, "AUTORID" NUMBER NOT NULL ENABLE, CONSTRAINT "LIBROSAUTORES_FK" FOREIGN KEY ("LIBROID") REFERENCES "LIBROS" ("LIBROID") ENABLE, CONSTRAINT "LIBROSAUTORES_FK2" FOREIGN KEY ("AUTORID") REFERENCES "AUTORES" ("AUTORID") ENABLE ) Tabla Ordenes: CREATE TABLE "ORDENES" ( "ORDENID" NUMBER NOT NULL ENABLE, "EMPLEADOSID" NUMBER NOT NULL ENABLE, "PAGOID" NUMBER NOT NULL ENABLE, "FECHAENVIO" CHAR(30) NOT NULL ENABLE, "FECHAORDEN" CHAR(30) NOT NULL ENABLE, "MONTO" CHAR(30) NOT NULL ENABLE, "CLIENTEID" NUMBER NOT NULL ENABLE, "ESTADOID" NUMBER NOT NULL ENABLE, CONSTRAINT "ORDENES_PK" PRIMARY KEY ("ORDENID") ENABLE, CONSTRAINT "ORDENES_FK" FOREIGN KEY ("EMPLEADOSID") REFERENCES "EMPLEADOS" ("EMPLEADOSID") ENABLE, CONSTRAINT "ORDENES_FK2" FOREIGN KEY ("PAGOID") REFERENCES "FORMAPAGO" ("PAGOID") ENABLE, CONSTRAINT "ORDENES_FK3" FOREIGN KEY ("CLIENTEID") REFERENCES "CLIENTES" ("CLIENTEID") ENABLE, CONSTRAINT "ORDENES_FK4" FOREIGN KEY ("ESTADOID") REFERENCES "ESTADOORDEN" ("ESTADOID") ENABLE )
  • 5. Tabla LibrosOrdenes CREATE TABLE "LIBROSORDENES" ( "LIBROID" NUMBER(*,0), "ORDENID" NUMBER(*,0), CONSTRAINT "FK_LIBRSORD_PERTENECE_LIBR" FOREIGN KEY ("LIBROID") REFERENCES "LIBROS" ("LIBROID") ENABLE, CONSTRAINT "FK2_LIBRSORD_PERTENECE_ORDN" FOREIGN KEY ("ORDENID") REFERENCES "ORDENES" ("ORDENID") ENABLE )
  • 6. 2. Insertar datos por SQL. INSERT INTO ESTADOORDEN (ESTADOID, ESTADODESCRIP) VALUES (5, 'EN ESPERA') INSERT INTO LIBROESTADO (CONDICIONID, NOMBRECOND, DESCRIPCION) VALUES (01,'BUENA', 'PRESTADA') INSERT INTO FORMAPAGO (PAGOID, PAGODESCRIP) VALUES (01, 'EFECTIVO')
  • 7. INSERT INTO POSICIONES (POSICIONID, CARGO, DESCRIPCION) VALUES (01, 'GERENTE', 'DIRIGE PERSONAL') INSERT INTO CLIENTES (CLIENTEID, NOMBRE, APELLIDO, TELEFONO, DIR1, DIR2, CIUDAD, ESTADO, PAIS, CP) VALUES (01, 'ANDRES', 'TORO', 3166213877,'CALLE 26 A 25-23', 'CARRERA 15 26 B15', 'TULUA', 'ACTIVO', 'COLOMBIA',123) INSERT INTO AUTORES (AUTORID, NOMBRE, APELLIDO, AÑONAC, AÑOMUERTE, DESCRIPCION) VALUES (01, 'WILLIAM', 'SHAKESPEARE', '10/04/1652', '15/2/1738','BUEN AUTOR Y POETA')
  • 8. INSERT INTO LIBROS (LIBROID, CONDICIONID, TITULO, EDITOR, FECHAED, COSTO, VENDIDO) VALUES (01, 01, El Exilio De Sharra,'Darkover', '05/04/2000',35000,2) INSERT INTO EMPLEADOS (EMPLEADOSID, NOMBRE, APELLIDO, DIR1, DIR2, CIUDAD, ESTADO, CP, TELEFONO, FECHAING, POSICIONID) VALUES (02, 'JOSE', 'MENESES', 'CALLE 3 #4-5', 'CRA 8 # 5-6', 'TULUA', 'AFILIADO', 1210,3152002000,'01/07/09,01)
  • 9. INSERT INTO ORDENES (ORDENID, CLIENTEID, EMPLEADOSID, MONTO, FECHAORDEN, FECHAENVIO, PAGOID, ESTADOID) VALUES (01, 01, 01, 50, '12/08/10', '15/08/10', 01, 01) INSERT INTO LIBROSAUTORES (LIBROID, AUTORID) VALUES (01,01) INSERT INTO LIBROSORDENES (ORDENID, LIBROID) VALUES (01, 01)