SlideShare una empresa de Scribd logo
1 de 6
usemaster
go
createdatabase ejemplo
onprimary (
name='ejemplo_data',
filename='C:dataejemplo_data.mdf',
size=4mb,
maxsize=10mb,
filegrowth=1mb
)
logon (
name='ejemplo_log',
filename='C:dataejemplo_data.ldf',
size=2mb,
maxsize=10mb,
filegrowth=1mb
)
go

use ejemplo
go

-------------------------
-- Create Customers table
-------------------------
CREATETABLE Customers
(
  cust_id      char(10)NOTNULL,
  cust_name    char(50)NOTNULL,
  cust_address char(50)NULL,
  cust_city    char(50)NULL,
  cust_state   char(5)NULL,
  cust_zip     char(10)NULL,
  cust_country char(50)NULL,
  cust_contact char(50)NULL,
  cust_email   char(255)NULL
)
select*from Customers

--------------------------
-- Create OrderItems table
--------------------------
CREATETABLE OrderItems
(
   order_num intNOTNULL,
   order_item intNOTNULL,
   prod_id    char(10)NOTNULL,
   quantity   intNOTNULL,
   item_price decimal(8,2)NOTNULL
);

----------------------
-- Create Orders table
----------------------
CREATETABLE Orders
(
  order_num intNOTNULL,
order_date datetimeNOTNULL,
     cust_id    char(10)NOTNULL
);


------------------------
-- Create Products table
------------------------
CREATETABLE Products
(
   prod_id    char(10)NOTNULL,
   vend_id    char(10)NOTNULL,
   prod_name char(255)NOTNULL,
   prod_price decimal(8,2)NOTNULL,
   prod_desc varchar(1000)NULL
);


-----------------------
-- Create Vendors table
-----------------------
CREATETABLE Vendors
(
   vend_id      char(10)NOTNULL,
   vend_name    char(50)NOTNULL,
   vend_address char(50)NULL,
   vend_city    char(50)NULL,
   vend_state   char(5)NULL,
   vend_zip     char(10)NULL,
   vend_country char(50)NULL
);


----------------------
-- Define primary keys
----------------------
ALTERTABLE Customers WITHNOCHECKADDCONSTRAINT PK_Customers
PRIMARYKEYCLUSTERED (cust_id);
ALTERTABLE OrderItems WITHNOCHECKADDCONSTRAINT PK_OrderItems
PRIMARYKEYCLUSTERED (order_num, order_item);
ALTERTABLE Orders WITHNOCHECKADDCONSTRAINT PK_Orders PRIMARYKEYCLUSTERED
(order_num);
ALTERTABLE Products WITHNOCHECKADDCONSTRAINT PK_Products
PRIMARYKEYCLUSTERED (prod_id);
ALTERTABLE Vendors WITHNOCHECKADDCONSTRAINT PK_Vendors
PRIMARYKEYCLUSTERED (vend_id);



----------------------
-- Define foreign keys
----------------------
ALTERTABLE OrderItems ADD
CONSTRAINT FK_OrderItems_Orders FOREIGNKEY (order_num)REFERENCES
Orders(order_num),
CONSTRAINT FK_OrderItems_Products FOREIGNKEY (prod_id)REFERENCES
Products(prod_id);
ALTERTABLE Orders ADD
CONSTRAINT FK_Orders_Customers FOREIGNKEY (cust_id)REFERENCES
Customers(cust_id);
ALTERTABLE Products ADD
CONSTRAINT FK_Products_Vendors FOREIGNKEY (vend_id)REFERENCES
Vendors(vend_id);


---------------------------
-- Populate Customers table
---------------------------
INSERTINTO Customers(cust_id, cust_name, cust_address, cust_city,
cust_state, cust_zip, cust_country, cust_contact, cust_email)
VALUES('1000000001','Village Toys','200 Maple
Lane','Detroit','MI','44444','USA','John Smith','sales@villagetoys.com');
INSERTINTO Customers(cust_id, cust_name, cust_address, cust_city,
cust_state, cust_zip, cust_country, cust_contact)
VALUES('1000000002','Kids Place','333 South Lake
Drive','Columbus','OH','43333','USA','Michelle Green');
INSERTINTO Customers(cust_id, cust_name, cust_address, cust_city,
cust_state, cust_zip, cust_country, cust_contact, cust_email)
VALUES('1000000003','Fun4All','1 Sunny
Place','Muncie','IN','42222','USA','Jim Jones','jjones@fun4all.com');
INSERTINTO Customers(cust_id, cust_name, cust_address, cust_city,
cust_state, cust_zip, cust_country, cust_contact, cust_email)
VALUES('1000000004','Fun4All','829 Riverside
Drive','Phoenix','AZ','88888','USA','Denise L.
Stephens','dstephens@fun4all.com');
INSERTINTO Customers(cust_id, cust_name, cust_address, cust_city,
cust_state, cust_zip, cust_country, cust_contact)
VALUES('1000000005','The Toy Store','4545 53rd
Street','Chicago','IL','54545','USA','Kim Howard');

select*from Customers


-------------------------
-- Populate Vendors table
-------------------------
INSERTINTO Vendors(vend_id, vend_name, vend_address,   vend_city,
vend_state, vend_zip, vend_country)
VALUES('BRS01','Bears R Us','123 Main Street','Bear
Town','MI','44444','USA');
INSERTINTO Vendors(vend_id, vend_name, vend_address,   vend_city,
vend_state, vend_zip, vend_country)
VALUES('BRE02','Bear Emporium','500 Park
Street','Anytown','OH','44333','USA');
INSERTINTO Vendors(vend_id, vend_name, vend_address,   vend_city,
vend_state, vend_zip, vend_country)
VALUES('DLL01','Doll House Inc.','555 High
Street','Dollsville','CA','99999','USA');
INSERTINTO Vendors(vend_id, vend_name, vend_address,   vend_city,
vend_state, vend_zip, vend_country)
VALUES('FRB01','Furball Inc.','1000 5th Avenue','New
York','NY','11111','USA');
INSERTINTO Vendors(vend_id, vend_name, vend_address,   vend_city,
vend_state, vend_zip, vend_country)
VALUES('FNG01','Fun and Games','42 Galaxy Road','London',NULL,'N16
6PS','England');
INSERTINTO Vendors(vend_id, vend_name, vend_address, vend_city,
vend_state, vend_zip, vend_country)
VALUES('JTS01','Jouets et ours','1 Rue
Amusement','Paris',NULL,'45678','France');

select*from Vendors


--------------------------
-- Populate Products table
--------------------------
INSERTINTO Products(prod_id, vend_id, prod_name, prod_price, prod_desc)
VALUES('BR01','BRS01','8 inch teddy bear', 5.99,'8 inch teddy bear, comes
with cap and jacket');
INSERTINTO Products(prod_id, vend_id, prod_name, prod_price, prod_desc)
VALUES('BR02','BRS01','12 inch teddy bear', 8.99,'12 inch teddy bear,
comes with cap and jacket');
INSERTINTO Products(prod_id, vend_id, prod_name, prod_price, prod_desc)
VALUES('BR03','BRS01','18 inch teddy bear', 11.99,'18 inch teddy bear,
comes with cap and jacket');
INSERTINTO Products(prod_id, vend_id, prod_name, prod_price, prod_desc)
VALUES('BNBG01','DLL01','Fish bean bag toy', 3.49,'Fish bean bag toy,
complete with bean bag worms with which to feed it');
INSERTINTO Products(prod_id, vend_id, prod_name, prod_price, prod_desc)
VALUES('BNBG02','DLL01','Bird bean bag toy', 3.49,'Bird bean bag toy,
eggs are not included');
INSERTINTO Products(prod_id, vend_id, prod_name, prod_price, prod_desc)
VALUES('BNBG03','DLL01','Rabbit bean bag toy', 3.49,'Rabbit bean bag toy,
comes with bean bag carrots');
INSERTINTO Products(prod_id, vend_id, prod_name, prod_price, prod_desc)
VALUES('RGAN01','DLL01','Raggedy Ann', 4.99,'18 inch Raggedy Ann doll');
INSERTINTO Products(prod_id, vend_id, prod_name, prod_price, prod_desc)
VALUES('RYL01','FNG01','King doll', 9.49,'12 inch king doll with royal
garments and crown');
INSERTINTO Products(prod_id, vend_id, prod_name, prod_price, prod_desc)
VALUES('RYL02','FNG01','Queen doll', 9.49,'12 inch queen doll with royal
garments and crown');

select*from Products

------------------------
-- Populate Orders table
------------------------
INSERTINTO Orders(order_num, order_date,   cust_id)
VALUES(20005,'2004-05-01','1000000001');
INSERTINTO Orders(order_num, order_date,   cust_id)
VALUES(20006,'2004-01-12','1000000003');
INSERTINTO Orders(order_num, order_date,   cust_id)
VALUES(20007,'2004-01-30','1000000004');
INSERTINTO Orders(order_num, order_date,   cust_id)
VALUES(20008,'2004-02-03','1000000005');
INSERTINTO Orders(order_num, order_date,   cust_id)
VALUES(20009,'2004-02-08','1000000001');

select*from Orders
----------------------------
-- Populate OrderItems table
----------------------------
INSERTINTO OrderItems(order_num, order_item,   prod_id, quantity,
item_price)
VALUES(20005, 1,'BR01', 100, 5.49);
INSERTINTO OrderItems(order_num, order_item,   prod_id, quantity,
item_price)
VALUES(20005, 2,'BR03', 100, 10.99);
INSERTINTO OrderItems(order_num, order_item,   prod_id, quantity,
item_price)
VALUES(20006, 1,'BR01', 20, 5.99);
INSERTINTO OrderItems(order_num, order_item,   prod_id, quantity,
item_price)
VALUES(20006, 2,'BR02', 10, 8.99);
INSERTINTO OrderItems(order_num, order_item,   prod_id, quantity,
item_price)
VALUES(20006, 3,'BR03', 10, 11.99);
INSERTINTO OrderItems(order_num, order_item,   prod_id, quantity,
item_price)
VALUES(20007, 1,'BR03', 50, 11.49);
INSERTINTO OrderItems(order_num, order_item,   prod_id, quantity,
item_price)
VALUES(20007, 2,'BNBG01', 100, 2.99);
INSERTINTO OrderItems(order_num, order_item,   prod_id, quantity,
item_price)
VALUES(20007, 3,'BNBG02', 100, 2.99);
INSERTINTO OrderItems(order_num, order_item,   prod_id, quantity,
item_price)
VALUES(20007, 4,'BNBG03', 100, 2.99);
INSERTINTO OrderItems(order_num, order_item,   prod_id, quantity,
item_price)
VALUES(20007, 5,'RGAN01', 50, 4.49);
INSERTINTO OrderItems(order_num, order_item,   prod_id, quantity,
item_price)
VALUES(20008, 1,'RGAN01', 5, 4.99);
INSERTINTO OrderItems(order_num, order_item,   prod_id, quantity,
item_price)
VALUES(20008, 2,'BR03', 5, 11.99);
INSERTINTO OrderItems(order_num, order_item,   prod_id, quantity,
item_price)
VALUES(20008, 3,'BNBG01', 10, 3.49);
INSERTINTO OrderItems(order_num, order_item,   prod_id, quantity,
item_price)
VALUES(20008, 4,'BNBG02', 10, 3.49);
INSERTINTO OrderItems(order_num, order_item,   prod_id, quantity,
item_price)
VALUES(20008, 5,'BNBG03', 10, 3.49);
INSERTINTO OrderItems(order_num, order_item,   prod_id, quantity,
item_price)
VALUES(20009, 1,'BNBG01', 250, 2.49);
INSERTINTO OrderItems(order_num, order_item,   prod_id, quantity,
item_price)
VALUES(20009, 2,'BNBG02', 250, 2.49);
INSERTINTO OrderItems(order_num, order_item, prod_id, quantity,
item_price)
VALUES(20009, 3,'BNBG03', 250, 2.49);

select*from OrderItems

Más contenido relacionado

La actualidad más candente

Seistech SQL code
Seistech SQL codeSeistech SQL code
Seistech SQL codeSimon Hoyle
 
Oracle forms 10 j – dynamic color customization 2udfoh community paper-colo...
Oracle forms 10 j – dynamic color customization  2udfoh  community paper-colo...Oracle forms 10 j – dynamic color customization  2udfoh  community paper-colo...
Oracle forms 10 j – dynamic color customization 2udfoh community paper-colo...FITSFSd
 
Reading the .explain() Output
Reading the .explain() OutputReading the .explain() Output
Reading the .explain() OutputMongoDB
 
SQL Portfolio
SQL PortfolioSQL Portfolio
SQL Portfoliobeehkae
 
Greg Lewis SQL Portfolio
Greg Lewis SQL PortfolioGreg Lewis SQL Portfolio
Greg Lewis SQL Portfoliogregmlewis
 
Calendar working days and holidays for Oracle EBS R12 Absence management
Calendar working days and holidays for Oracle EBS R12 Absence managementCalendar working days and holidays for Oracle EBS R12 Absence management
Calendar working days and holidays for Oracle EBS R12 Absence managementFeras Ahmad
 
Microsoft MCSA 70-457 it exams dumps
Microsoft MCSA 70-457 it exams dumpsMicrosoft MCSA 70-457 it exams dumps
Microsoft MCSA 70-457 it exams dumpslilylucy
 
Protocols
ProtocolsProtocols
ProtocolsSV.CO
 
Produce nice outputs for graphical, tabular and textual reporting in R-Report...
Produce nice outputs for graphical, tabular and textual reporting in R-Report...Produce nice outputs for graphical, tabular and textual reporting in R-Report...
Produce nice outputs for graphical, tabular and textual reporting in R-Report...Dr. Volkan OBAN
 
Learning sql from w3schools
Learning sql from w3schoolsLearning sql from w3schools
Learning sql from w3schoolsfarhan516
 
New Features of SQL Server 2016
New Features of SQL Server 2016New Features of SQL Server 2016
New Features of SQL Server 2016Mir Mahmood
 
Relational / XML DB -SQL Server & Oracle Database
 Relational /  XML DB -SQL Server & Oracle Database Relational /  XML DB -SQL Server & Oracle Database
Relational / XML DB -SQL Server & Oracle DatabaseSunny U Okoro
 
Aggregation Pipeline Power++: MongoDB 4.2 파이프 라인 쿼리, 업데이트 및 구체화된 뷰 소개 [MongoDB]
Aggregation Pipeline Power++: MongoDB 4.2 파이프 라인 쿼리, 업데이트 및 구체화된 뷰 소개 [MongoDB]Aggregation Pipeline Power++: MongoDB 4.2 파이프 라인 쿼리, 업데이트 및 구체화된 뷰 소개 [MongoDB]
Aggregation Pipeline Power++: MongoDB 4.2 파이프 라인 쿼리, 업데이트 및 구체화된 뷰 소개 [MongoDB]MongoDB
 
ALL BASIC SQL SERVER QUERY
ALL BASIC SQL SERVER QUERY ALL BASIC SQL SERVER QUERY
ALL BASIC SQL SERVER QUERY Rajesh Patel
 
Swift - 혼자 공부하면 분명히 안할테니까 같이 공부하기
Swift - 혼자 공부하면 분명히 안할테니까 같이 공부하기Swift - 혼자 공부하면 분명히 안할테니까 같이 공부하기
Swift - 혼자 공부하면 분명히 안할테니까 같이 공부하기Suyeol Jeon
 

La actualidad más candente (16)

Seistech SQL code
Seistech SQL codeSeistech SQL code
Seistech SQL code
 
Oracle forms 10 j – dynamic color customization 2udfoh community paper-colo...
Oracle forms 10 j – dynamic color customization  2udfoh  community paper-colo...Oracle forms 10 j – dynamic color customization  2udfoh  community paper-colo...
Oracle forms 10 j – dynamic color customization 2udfoh community paper-colo...
 
Reading the .explain() Output
Reading the .explain() OutputReading the .explain() Output
Reading the .explain() Output
 
MongoDB With Style
MongoDB With StyleMongoDB With Style
MongoDB With Style
 
SQL Portfolio
SQL PortfolioSQL Portfolio
SQL Portfolio
 
Greg Lewis SQL Portfolio
Greg Lewis SQL PortfolioGreg Lewis SQL Portfolio
Greg Lewis SQL Portfolio
 
Calendar working days and holidays for Oracle EBS R12 Absence management
Calendar working days and holidays for Oracle EBS R12 Absence managementCalendar working days and holidays for Oracle EBS R12 Absence management
Calendar working days and holidays for Oracle EBS R12 Absence management
 
Microsoft MCSA 70-457 it exams dumps
Microsoft MCSA 70-457 it exams dumpsMicrosoft MCSA 70-457 it exams dumps
Microsoft MCSA 70-457 it exams dumps
 
Protocols
ProtocolsProtocols
Protocols
 
Produce nice outputs for graphical, tabular and textual reporting in R-Report...
Produce nice outputs for graphical, tabular and textual reporting in R-Report...Produce nice outputs for graphical, tabular and textual reporting in R-Report...
Produce nice outputs for graphical, tabular and textual reporting in R-Report...
 
Learning sql from w3schools
Learning sql from w3schoolsLearning sql from w3schools
Learning sql from w3schools
 
New Features of SQL Server 2016
New Features of SQL Server 2016New Features of SQL Server 2016
New Features of SQL Server 2016
 
Relational / XML DB -SQL Server & Oracle Database
 Relational /  XML DB -SQL Server & Oracle Database Relational /  XML DB -SQL Server & Oracle Database
Relational / XML DB -SQL Server & Oracle Database
 
Aggregation Pipeline Power++: MongoDB 4.2 파이프 라인 쿼리, 업데이트 및 구체화된 뷰 소개 [MongoDB]
Aggregation Pipeline Power++: MongoDB 4.2 파이프 라인 쿼리, 업데이트 및 구체화된 뷰 소개 [MongoDB]Aggregation Pipeline Power++: MongoDB 4.2 파이프 라인 쿼리, 업데이트 및 구체화된 뷰 소개 [MongoDB]
Aggregation Pipeline Power++: MongoDB 4.2 파이프 라인 쿼리, 업데이트 및 구체화된 뷰 소개 [MongoDB]
 
ALL BASIC SQL SERVER QUERY
ALL BASIC SQL SERVER QUERY ALL BASIC SQL SERVER QUERY
ALL BASIC SQL SERVER QUERY
 
Swift - 혼자 공부하면 분명히 안할테니까 같이 공부하기
Swift - 혼자 공부하면 분명히 안할테니까 같이 공부하기Swift - 혼자 공부하면 분명히 안할테니까 같이 공부하기
Swift - 혼자 공부하면 분명히 안할테니까 같이 공부하기
 

Destacado (8)

Yuli's cosmetics (1)
Yuli's cosmetics (1)Yuli's cosmetics (1)
Yuli's cosmetics (1)
 
Yuli's cosmetics (1)
Yuli's cosmetics (1)Yuli's cosmetics (1)
Yuli's cosmetics (1)
 
Benforta
BenfortaBenforta
Benforta
 
Ejercicios
EjerciciosEjercicios
Ejercicios
 
Scrip de la base de datos
Scrip de la base de datosScrip de la base de datos
Scrip de la base de datos
 
Ambiente sql server 2008
Ambiente sql server 2008Ambiente sql server 2008
Ambiente sql server 2008
 
Scrip de la base de datos cine
Scrip de la base de datos cineScrip de la base de datos cine
Scrip de la base de datos cine
 
Pyme original
Pyme originalPyme original
Pyme original
 

Similar a Benforta

EJERCICIOS DE BENFORTAN
EJERCICIOS DE BENFORTANEJERCICIOS DE BENFORTAN
EJERCICIOS DE BENFORTANarkangel8801
 
DROP TABLE ordline ;Drop TABLE OrderTBL ;DROP TABLE Customer.docx
DROP TABLE ordline ;Drop TABLE OrderTBL ;DROP TABLE Customer.docxDROP TABLE ordline ;Drop TABLE OrderTBL ;DROP TABLE Customer.docx
DROP TABLE ordline ;Drop TABLE OrderTBL ;DROP TABLE Customer.docxjacksnathalie
 
When debugging the code, use Drop table statementsto drop pr.docx
 When debugging the code, use Drop table statementsto drop pr.docx When debugging the code, use Drop table statementsto drop pr.docx
When debugging the code, use Drop table statementsto drop pr.docxaryan532920
 
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
 
SQL structure query language full presentation
SQL structure query language full presentationSQL structure query language full presentation
SQL structure query language full presentationJKarthickMyilvahanan
 
SPOOL output.log DROP TABL.pdf
SPOOL output.log DROP TABL.pdfSPOOL output.log DROP TABL.pdf
SPOOL output.log DROP TABL.pdffashionfootwear1
 
Create table dimcustomer ( customerid int/tutorialoutlet
Create table dimcustomer ( customerid int/tutorialoutletCreate table dimcustomer ( customerid int/tutorialoutlet
Create table dimcustomer ( customerid int/tutorialoutletPittock
 
SQL SQL 2) Add 25 CUSTOMERSs so that you now have 50 total..docx
SQL SQL 2) Add 25 CUSTOMERSs so that you now have 50 total..docxSQL SQL 2) Add 25 CUSTOMERSs so that you now have 50 total..docx
SQL SQL 2) Add 25 CUSTOMERSs so that you now have 50 total..docxrafbolet0
 
CompanyDB Problemspage 1 of 3Consider the employee database of .docx
CompanyDB Problemspage 1 of 3Consider the employee database of .docxCompanyDB Problemspage 1 of 3Consider the employee database of .docx
CompanyDB Problemspage 1 of 3Consider the employee database of .docxmonicafrancis71118
 
Introducing N1QL: New SQL Based Query Language for JSON
Introducing N1QL: New SQL Based Query Language for JSONIntroducing N1QL: New SQL Based Query Language for JSON
Introducing N1QL: New SQL Based Query Language for JSONKeshav Murthy
 
Use this script for the assignment.Please follow instructions as t.docx
Use this script for the assignment.Please follow instructions as t.docxUse this script for the assignment.Please follow instructions as t.docx
Use this script for the assignment.Please follow instructions as t.docxgarnerangelika
 
On SQL Managment studioThis lab is all about database normalizatio.pdf
On SQL Managment studioThis lab is all about database normalizatio.pdfOn SQL Managment studioThis lab is all about database normalizatio.pdf
On SQL Managment studioThis lab is all about database normalizatio.pdfinfomalad
 
- 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 Server 2008 Portfolio
SQL Server 2008 PortfolioSQL Server 2008 Portfolio
SQL Server 2008 Portfoliolilredlokita
 
MongoDB .local Paris 2020: La puissance du Pipeline d'Agrégation de MongoDB
MongoDB .local Paris 2020: La puissance du Pipeline d'Agrégation de MongoDBMongoDB .local Paris 2020: La puissance du Pipeline d'Agrégation de MongoDB
MongoDB .local Paris 2020: La puissance du Pipeline d'Agrégation de MongoDBMongoDB
 
Data Warehouses and Multi-Dimensional Data Analysis
Data Warehouses and Multi-Dimensional Data AnalysisData Warehouses and Multi-Dimensional Data Analysis
Data Warehouses and Multi-Dimensional Data AnalysisRaimonds Simanovskis
 
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
 

Similar a Benforta (20)

EJERCICIOS DE BENFORTAN
EJERCICIOS DE BENFORTANEJERCICIOS DE BENFORTAN
EJERCICIOS DE BENFORTAN
 
DROP TABLE ordline ;Drop TABLE OrderTBL ;DROP TABLE Customer.docx
DROP TABLE ordline ;Drop TABLE OrderTBL ;DROP TABLE Customer.docxDROP TABLE ordline ;Drop TABLE OrderTBL ;DROP TABLE Customer.docx
DROP TABLE ordline ;Drop TABLE OrderTBL ;DROP TABLE Customer.docx
 
When debugging the code, use Drop table statementsto drop pr.docx
 When debugging the code, use Drop table statementsto drop pr.docx When debugging the code, use Drop table statementsto drop pr.docx
When debugging the code, use Drop table statementsto drop pr.docx
 
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
 
Actividad 1
Actividad 1Actividad 1
Actividad 1
 
SQL structure query language full presentation
SQL structure query language full presentationSQL structure query language full presentation
SQL structure query language full presentation
 
SPOOL output.log DROP TABL.pdf
SPOOL output.log DROP TABL.pdfSPOOL output.log DROP TABL.pdf
SPOOL output.log DROP TABL.pdf
 
Sql ejercicio 1
Sql ejercicio 1Sql ejercicio 1
Sql ejercicio 1
 
Create table dimcustomer ( customerid int/tutorialoutlet
Create table dimcustomer ( customerid int/tutorialoutletCreate table dimcustomer ( customerid int/tutorialoutlet
Create table dimcustomer ( customerid int/tutorialoutlet
 
SQL SQL 2) Add 25 CUSTOMERSs so that you now have 50 total..docx
SQL SQL 2) Add 25 CUSTOMERSs so that you now have 50 total..docxSQL SQL 2) Add 25 CUSTOMERSs so that you now have 50 total..docx
SQL SQL 2) Add 25 CUSTOMERSs so that you now have 50 total..docx
 
Sql commands
Sql commandsSql commands
Sql commands
 
CompanyDB Problemspage 1 of 3Consider the employee database of .docx
CompanyDB Problemspage 1 of 3Consider the employee database of .docxCompanyDB Problemspage 1 of 3Consider the employee database of .docx
CompanyDB Problemspage 1 of 3Consider the employee database of .docx
 
Introducing N1QL: New SQL Based Query Language for JSON
Introducing N1QL: New SQL Based Query Language for JSONIntroducing N1QL: New SQL Based Query Language for JSON
Introducing N1QL: New SQL Based Query Language for JSON
 
Use this script for the assignment.Please follow instructions as t.docx
Use this script for the assignment.Please follow instructions as t.docxUse this script for the assignment.Please follow instructions as t.docx
Use this script for the assignment.Please follow instructions as t.docx
 
On SQL Managment studioThis lab is all about database normalizatio.pdf
On SQL Managment studioThis lab is all about database normalizatio.pdfOn SQL Managment studioThis lab is all about database normalizatio.pdf
On SQL Managment studioThis lab is all about database normalizatio.pdf
 
- 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 Server 2008 Portfolio
SQL Server 2008 PortfolioSQL Server 2008 Portfolio
SQL Server 2008 Portfolio
 
MongoDB .local Paris 2020: La puissance du Pipeline d'Agrégation de MongoDB
MongoDB .local Paris 2020: La puissance du Pipeline d'Agrégation de MongoDBMongoDB .local Paris 2020: La puissance du Pipeline d'Agrégation de MongoDB
MongoDB .local Paris 2020: La puissance du Pipeline d'Agrégation de MongoDB
 
Data Warehouses and Multi-Dimensional Data Analysis
Data Warehouses and Multi-Dimensional Data AnalysisData Warehouses and Multi-Dimensional Data Analysis
Data Warehouses and Multi-Dimensional Data Analysis
 
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
 

Más de LSCA Hermilo Salazar Chávez (17)

Reportes
ReportesReportes
Reportes
 
Script base de datos
Script base de datosScript base de datos
Script base de datos
 
Script base de datos
Script base de datosScript base de datos
Script base de datos
 
Yuli´s
Yuli´sYuli´s
Yuli´s
 
Comparacion smdb
Comparacion smdbComparacion smdb
Comparacion smdb
 
Smbd
SmbdSmbd
Smbd
 
Codigo corregido del ejercicio peliculas
Codigo corregido del ejercicio peliculasCodigo corregido del ejercicio peliculas
Codigo corregido del ejercicio peliculas
 
Performance and scalability
Performance and scalabilityPerformance and scalability
Performance and scalability
 
Reglas sql
Reglas sqlReglas sql
Reglas sql
 
Conceptos de sql
Conceptos de sqlConceptos de sql
Conceptos de sql
 
Caracteristicas sql
Caracteristicas sqlCaracteristicas sql
Caracteristicas sql
 
Ambiente sql server 2008
Ambiente sql server 2008Ambiente sql server 2008
Ambiente sql server 2008
 
Componentes de sql
Componentes de sqlComponentes de sql
Componentes de sql
 
Ambiente sql server 2008
Ambiente sql server 2008Ambiente sql server 2008
Ambiente sql server 2008
 
Yuly´s
Yuly´sYuly´s
Yuly´s
 
Versiones de sql
Versiones de sqlVersiones de sql
Versiones de sql
 
Smdb equipo #3
Smdb equipo #3Smdb equipo #3
Smdb equipo #3
 

Último

Model Call Girls In Pazhavanthangal WhatsApp Booking 7427069034 call girl ser...
Model Call Girls In Pazhavanthangal WhatsApp Booking 7427069034 call girl ser...Model Call Girls In Pazhavanthangal WhatsApp Booking 7427069034 call girl ser...
Model Call Girls In Pazhavanthangal WhatsApp Booking 7427069034 call girl ser... Shivani Pandey
 
👙 Kolkata Call Girls Shyam Bazar 💫💫7001035870 Model escorts Service
👙  Kolkata Call Girls Shyam Bazar 💫💫7001035870 Model escorts Service👙  Kolkata Call Girls Shyam Bazar 💫💫7001035870 Model escorts Service
👙 Kolkata Call Girls Shyam Bazar 💫💫7001035870 Model escorts Serviceanamikaraghav4
 
VIP Call Girls Nagpur Megha Call 7001035870 Meet With Nagpur Escorts
VIP Call Girls Nagpur Megha Call 7001035870 Meet With Nagpur EscortsVIP Call Girls Nagpur Megha Call 7001035870 Meet With Nagpur Escorts
VIP Call Girls Nagpur Megha Call 7001035870 Meet With Nagpur Escortsranjana rawat
 
Beautiful 😋 Call girls in Lahore 03210033448
Beautiful 😋 Call girls in Lahore 03210033448Beautiful 😋 Call girls in Lahore 03210033448
Beautiful 😋 Call girls in Lahore 03210033448ont65320
 
Call Girls Agency In Goa 💚 9316020077 💚 Call Girl Goa By Russian Call Girl ...
Call Girls  Agency In Goa  💚 9316020077 💚 Call Girl Goa By Russian Call Girl ...Call Girls  Agency In Goa  💚 9316020077 💚 Call Girl Goa By Russian Call Girl ...
Call Girls Agency In Goa 💚 9316020077 💚 Call Girl Goa By Russian Call Girl ...russian goa call girl and escorts service
 
Independent Hatiara Escorts ✔ 8250192130 ✔ Full Night With Room Online Bookin...
Independent Hatiara Escorts ✔ 8250192130 ✔ Full Night With Room Online Bookin...Independent Hatiara Escorts ✔ 8250192130 ✔ Full Night With Room Online Bookin...
Independent Hatiara Escorts ✔ 8250192130 ✔ Full Night With Room Online Bookin...Riya Pathan
 
Call Girls Manjri Call Me 7737669865 Budget Friendly No Advance Booking
Call Girls Manjri Call Me 7737669865 Budget Friendly No Advance BookingCall Girls Manjri Call Me 7737669865 Budget Friendly No Advance Booking
Call Girls Manjri Call Me 7737669865 Budget Friendly No Advance Bookingroncy bisnoi
 
5* Hotels Call Girls In Goa {{07028418221}} Call Girls In North Goa Escort Se...
5* Hotels Call Girls In Goa {{07028418221}} Call Girls In North Goa Escort Se...5* Hotels Call Girls In Goa {{07028418221}} Call Girls In North Goa Escort Se...
5* Hotels Call Girls In Goa {{07028418221}} Call Girls In North Goa Escort Se...Apsara Of India
 
Book Paid Sonagachi Call Girls Kolkata 𖠋 8250192130 𖠋Low Budget Full Independ...
Book Paid Sonagachi Call Girls Kolkata 𖠋 8250192130 𖠋Low Budget Full Independ...Book Paid Sonagachi Call Girls Kolkata 𖠋 8250192130 𖠋Low Budget Full Independ...
Book Paid Sonagachi Call Girls Kolkata 𖠋 8250192130 𖠋Low Budget Full Independ...noor ahmed
 
Call Girl Nashik Amaira 7001305949 Independent Escort Service Nashik
Call Girl Nashik Amaira 7001305949 Independent Escort Service NashikCall Girl Nashik Amaira 7001305949 Independent Escort Service Nashik
Call Girl Nashik Amaira 7001305949 Independent Escort Service NashikCall Girls in Nagpur High Profile
 
Russian Call Girl South End Park - Call 8250192130 Rs-3500 with A/C Room Cash...
Russian Call Girl South End Park - Call 8250192130 Rs-3500 with A/C Room Cash...Russian Call Girl South End Park - Call 8250192130 Rs-3500 with A/C Room Cash...
Russian Call Girl South End Park - Call 8250192130 Rs-3500 with A/C Room Cash...anamikaraghav4
 
2k Shot Call girls Laxmi Nagar Delhi 9205541914
2k Shot Call girls Laxmi Nagar Delhi 92055419142k Shot Call girls Laxmi Nagar Delhi 9205541914
2k Shot Call girls Laxmi Nagar Delhi 9205541914Delhi Call girls
 
Nayabad Call Girls ✔ 8005736733 ✔ Hot Model With Sexy Bhabi Ready For Sex At ...
Nayabad Call Girls ✔ 8005736733 ✔ Hot Model With Sexy Bhabi Ready For Sex At ...Nayabad Call Girls ✔ 8005736733 ✔ Hot Model With Sexy Bhabi Ready For Sex At ...
Nayabad Call Girls ✔ 8005736733 ✔ Hot Model With Sexy Bhabi Ready For Sex At ...aamir
 
Top Rated Kolkata Call Girls Khardah ⟟ 6297143586 ⟟ Call Me For Genuine Sex S...
Top Rated Kolkata Call Girls Khardah ⟟ 6297143586 ⟟ Call Me For Genuine Sex S...Top Rated Kolkata Call Girls Khardah ⟟ 6297143586 ⟟ Call Me For Genuine Sex S...
Top Rated Kolkata Call Girls Khardah ⟟ 6297143586 ⟟ Call Me For Genuine Sex S...ritikasharma
 
Top Rated Pune Call Girls Pimpri Chinchwad ⟟ 6297143586 ⟟ Call Me For Genuin...
Top Rated  Pune Call Girls Pimpri Chinchwad ⟟ 6297143586 ⟟ Call Me For Genuin...Top Rated  Pune Call Girls Pimpri Chinchwad ⟟ 6297143586 ⟟ Call Me For Genuin...
Top Rated Pune Call Girls Pimpri Chinchwad ⟟ 6297143586 ⟟ Call Me For Genuin...Call Girls in Nagpur High Profile
 
VIP Call Girls Sonagachi - 8250192130 Escorts Service 50% Off with Cash ON De...
VIP Call Girls Sonagachi - 8250192130 Escorts Service 50% Off with Cash ON De...VIP Call Girls Sonagachi - 8250192130 Escorts Service 50% Off with Cash ON De...
VIP Call Girls Sonagachi - 8250192130 Escorts Service 50% Off with Cash ON De...anamikaraghav4
 
Dakshineswar Call Girls ✔ 8005736733 ✔ Hot Model With Sexy Bhabi Ready For Se...
Dakshineswar Call Girls ✔ 8005736733 ✔ Hot Model With Sexy Bhabi Ready For Se...Dakshineswar Call Girls ✔ 8005736733 ✔ Hot Model With Sexy Bhabi Ready For Se...
Dakshineswar Call Girls ✔ 8005736733 ✔ Hot Model With Sexy Bhabi Ready For Se...aamir
 
↑Top Model (Kolkata) Call Girls Howrah ⟟ 8250192130 ⟟ High Class Call Girl In...
↑Top Model (Kolkata) Call Girls Howrah ⟟ 8250192130 ⟟ High Class Call Girl In...↑Top Model (Kolkata) Call Girls Howrah ⟟ 8250192130 ⟟ High Class Call Girl In...
↑Top Model (Kolkata) Call Girls Howrah ⟟ 8250192130 ⟟ High Class Call Girl In...noor ahmed
 
Call Girls in Barasat | 7001035870 At Low Cost Cash Payment Booking
Call Girls in Barasat | 7001035870 At Low Cost Cash Payment BookingCall Girls in Barasat | 7001035870 At Low Cost Cash Payment Booking
Call Girls in Barasat | 7001035870 At Low Cost Cash Payment Bookingnoor ahmed
 

Último (20)

Model Call Girls In Pazhavanthangal WhatsApp Booking 7427069034 call girl ser...
Model Call Girls In Pazhavanthangal WhatsApp Booking 7427069034 call girl ser...Model Call Girls In Pazhavanthangal WhatsApp Booking 7427069034 call girl ser...
Model Call Girls In Pazhavanthangal WhatsApp Booking 7427069034 call girl ser...
 
👙 Kolkata Call Girls Shyam Bazar 💫💫7001035870 Model escorts Service
👙  Kolkata Call Girls Shyam Bazar 💫💫7001035870 Model escorts Service👙  Kolkata Call Girls Shyam Bazar 💫💫7001035870 Model escorts Service
👙 Kolkata Call Girls Shyam Bazar 💫💫7001035870 Model escorts Service
 
VIP Call Girls Nagpur Megha Call 7001035870 Meet With Nagpur Escorts
VIP Call Girls Nagpur Megha Call 7001035870 Meet With Nagpur EscortsVIP Call Girls Nagpur Megha Call 7001035870 Meet With Nagpur Escorts
VIP Call Girls Nagpur Megha Call 7001035870 Meet With Nagpur Escorts
 
Beautiful 😋 Call girls in Lahore 03210033448
Beautiful 😋 Call girls in Lahore 03210033448Beautiful 😋 Call girls in Lahore 03210033448
Beautiful 😋 Call girls in Lahore 03210033448
 
Goa Call "Girls Service 9316020077 Call "Girls in Goa
Goa Call "Girls  Service   9316020077 Call "Girls in GoaGoa Call "Girls  Service   9316020077 Call "Girls in Goa
Goa Call "Girls Service 9316020077 Call "Girls in Goa
 
Call Girls Agency In Goa 💚 9316020077 💚 Call Girl Goa By Russian Call Girl ...
Call Girls  Agency In Goa  💚 9316020077 💚 Call Girl Goa By Russian Call Girl ...Call Girls  Agency In Goa  💚 9316020077 💚 Call Girl Goa By Russian Call Girl ...
Call Girls Agency In Goa 💚 9316020077 💚 Call Girl Goa By Russian Call Girl ...
 
Independent Hatiara Escorts ✔ 8250192130 ✔ Full Night With Room Online Bookin...
Independent Hatiara Escorts ✔ 8250192130 ✔ Full Night With Room Online Bookin...Independent Hatiara Escorts ✔ 8250192130 ✔ Full Night With Room Online Bookin...
Independent Hatiara Escorts ✔ 8250192130 ✔ Full Night With Room Online Bookin...
 
Call Girls Manjri Call Me 7737669865 Budget Friendly No Advance Booking
Call Girls Manjri Call Me 7737669865 Budget Friendly No Advance BookingCall Girls Manjri Call Me 7737669865 Budget Friendly No Advance Booking
Call Girls Manjri Call Me 7737669865 Budget Friendly No Advance Booking
 
5* Hotels Call Girls In Goa {{07028418221}} Call Girls In North Goa Escort Se...
5* Hotels Call Girls In Goa {{07028418221}} Call Girls In North Goa Escort Se...5* Hotels Call Girls In Goa {{07028418221}} Call Girls In North Goa Escort Se...
5* Hotels Call Girls In Goa {{07028418221}} Call Girls In North Goa Escort Se...
 
Book Paid Sonagachi Call Girls Kolkata 𖠋 8250192130 𖠋Low Budget Full Independ...
Book Paid Sonagachi Call Girls Kolkata 𖠋 8250192130 𖠋Low Budget Full Independ...Book Paid Sonagachi Call Girls Kolkata 𖠋 8250192130 𖠋Low Budget Full Independ...
Book Paid Sonagachi Call Girls Kolkata 𖠋 8250192130 𖠋Low Budget Full Independ...
 
Call Girl Nashik Amaira 7001305949 Independent Escort Service Nashik
Call Girl Nashik Amaira 7001305949 Independent Escort Service NashikCall Girl Nashik Amaira 7001305949 Independent Escort Service Nashik
Call Girl Nashik Amaira 7001305949 Independent Escort Service Nashik
 
Russian Call Girl South End Park - Call 8250192130 Rs-3500 with A/C Room Cash...
Russian Call Girl South End Park - Call 8250192130 Rs-3500 with A/C Room Cash...Russian Call Girl South End Park - Call 8250192130 Rs-3500 with A/C Room Cash...
Russian Call Girl South End Park - Call 8250192130 Rs-3500 with A/C Room Cash...
 
2k Shot Call girls Laxmi Nagar Delhi 9205541914
2k Shot Call girls Laxmi Nagar Delhi 92055419142k Shot Call girls Laxmi Nagar Delhi 9205541914
2k Shot Call girls Laxmi Nagar Delhi 9205541914
 
Nayabad Call Girls ✔ 8005736733 ✔ Hot Model With Sexy Bhabi Ready For Sex At ...
Nayabad Call Girls ✔ 8005736733 ✔ Hot Model With Sexy Bhabi Ready For Sex At ...Nayabad Call Girls ✔ 8005736733 ✔ Hot Model With Sexy Bhabi Ready For Sex At ...
Nayabad Call Girls ✔ 8005736733 ✔ Hot Model With Sexy Bhabi Ready For Sex At ...
 
Top Rated Kolkata Call Girls Khardah ⟟ 6297143586 ⟟ Call Me For Genuine Sex S...
Top Rated Kolkata Call Girls Khardah ⟟ 6297143586 ⟟ Call Me For Genuine Sex S...Top Rated Kolkata Call Girls Khardah ⟟ 6297143586 ⟟ Call Me For Genuine Sex S...
Top Rated Kolkata Call Girls Khardah ⟟ 6297143586 ⟟ Call Me For Genuine Sex S...
 
Top Rated Pune Call Girls Pimpri Chinchwad ⟟ 6297143586 ⟟ Call Me For Genuin...
Top Rated  Pune Call Girls Pimpri Chinchwad ⟟ 6297143586 ⟟ Call Me For Genuin...Top Rated  Pune Call Girls Pimpri Chinchwad ⟟ 6297143586 ⟟ Call Me For Genuin...
Top Rated Pune Call Girls Pimpri Chinchwad ⟟ 6297143586 ⟟ Call Me For Genuin...
 
VIP Call Girls Sonagachi - 8250192130 Escorts Service 50% Off with Cash ON De...
VIP Call Girls Sonagachi - 8250192130 Escorts Service 50% Off with Cash ON De...VIP Call Girls Sonagachi - 8250192130 Escorts Service 50% Off with Cash ON De...
VIP Call Girls Sonagachi - 8250192130 Escorts Service 50% Off with Cash ON De...
 
Dakshineswar Call Girls ✔ 8005736733 ✔ Hot Model With Sexy Bhabi Ready For Se...
Dakshineswar Call Girls ✔ 8005736733 ✔ Hot Model With Sexy Bhabi Ready For Se...Dakshineswar Call Girls ✔ 8005736733 ✔ Hot Model With Sexy Bhabi Ready For Se...
Dakshineswar Call Girls ✔ 8005736733 ✔ Hot Model With Sexy Bhabi Ready For Se...
 
↑Top Model (Kolkata) Call Girls Howrah ⟟ 8250192130 ⟟ High Class Call Girl In...
↑Top Model (Kolkata) Call Girls Howrah ⟟ 8250192130 ⟟ High Class Call Girl In...↑Top Model (Kolkata) Call Girls Howrah ⟟ 8250192130 ⟟ High Class Call Girl In...
↑Top Model (Kolkata) Call Girls Howrah ⟟ 8250192130 ⟟ High Class Call Girl In...
 
Call Girls in Barasat | 7001035870 At Low Cost Cash Payment Booking
Call Girls in Barasat | 7001035870 At Low Cost Cash Payment BookingCall Girls in Barasat | 7001035870 At Low Cost Cash Payment Booking
Call Girls in Barasat | 7001035870 At Low Cost Cash Payment Booking
 

Benforta

  • 1. usemaster go createdatabase ejemplo onprimary ( name='ejemplo_data', filename='C:dataejemplo_data.mdf', size=4mb, maxsize=10mb, filegrowth=1mb ) logon ( name='ejemplo_log', filename='C:dataejemplo_data.ldf', size=2mb, maxsize=10mb, filegrowth=1mb ) go use ejemplo go ------------------------- -- Create Customers table ------------------------- CREATETABLE Customers ( cust_id char(10)NOTNULL, cust_name char(50)NOTNULL, cust_address char(50)NULL, cust_city char(50)NULL, cust_state char(5)NULL, cust_zip char(10)NULL, cust_country char(50)NULL, cust_contact char(50)NULL, cust_email char(255)NULL ) select*from Customers -------------------------- -- Create OrderItems table -------------------------- CREATETABLE OrderItems ( order_num intNOTNULL, order_item intNOTNULL, prod_id char(10)NOTNULL, quantity intNOTNULL, item_price decimal(8,2)NOTNULL ); ---------------------- -- Create Orders table ---------------------- CREATETABLE Orders ( order_num intNOTNULL,
  • 2. order_date datetimeNOTNULL, cust_id char(10)NOTNULL ); ------------------------ -- Create Products table ------------------------ CREATETABLE Products ( prod_id char(10)NOTNULL, vend_id char(10)NOTNULL, prod_name char(255)NOTNULL, prod_price decimal(8,2)NOTNULL, prod_desc varchar(1000)NULL ); ----------------------- -- Create Vendors table ----------------------- CREATETABLE Vendors ( vend_id char(10)NOTNULL, vend_name char(50)NOTNULL, vend_address char(50)NULL, vend_city char(50)NULL, vend_state char(5)NULL, vend_zip char(10)NULL, vend_country char(50)NULL ); ---------------------- -- Define primary keys ---------------------- ALTERTABLE Customers WITHNOCHECKADDCONSTRAINT PK_Customers PRIMARYKEYCLUSTERED (cust_id); ALTERTABLE OrderItems WITHNOCHECKADDCONSTRAINT PK_OrderItems PRIMARYKEYCLUSTERED (order_num, order_item); ALTERTABLE Orders WITHNOCHECKADDCONSTRAINT PK_Orders PRIMARYKEYCLUSTERED (order_num); ALTERTABLE Products WITHNOCHECKADDCONSTRAINT PK_Products PRIMARYKEYCLUSTERED (prod_id); ALTERTABLE Vendors WITHNOCHECKADDCONSTRAINT PK_Vendors PRIMARYKEYCLUSTERED (vend_id); ---------------------- -- Define foreign keys ---------------------- ALTERTABLE OrderItems ADD CONSTRAINT FK_OrderItems_Orders FOREIGNKEY (order_num)REFERENCES Orders(order_num), CONSTRAINT FK_OrderItems_Products FOREIGNKEY (prod_id)REFERENCES Products(prod_id);
  • 3. ALTERTABLE Orders ADD CONSTRAINT FK_Orders_Customers FOREIGNKEY (cust_id)REFERENCES Customers(cust_id); ALTERTABLE Products ADD CONSTRAINT FK_Products_Vendors FOREIGNKEY (vend_id)REFERENCES Vendors(vend_id); --------------------------- -- Populate Customers table --------------------------- INSERTINTO Customers(cust_id, cust_name, cust_address, cust_city, cust_state, cust_zip, cust_country, cust_contact, cust_email) VALUES('1000000001','Village Toys','200 Maple Lane','Detroit','MI','44444','USA','John Smith','sales@villagetoys.com'); INSERTINTO Customers(cust_id, cust_name, cust_address, cust_city, cust_state, cust_zip, cust_country, cust_contact) VALUES('1000000002','Kids Place','333 South Lake Drive','Columbus','OH','43333','USA','Michelle Green'); INSERTINTO Customers(cust_id, cust_name, cust_address, cust_city, cust_state, cust_zip, cust_country, cust_contact, cust_email) VALUES('1000000003','Fun4All','1 Sunny Place','Muncie','IN','42222','USA','Jim Jones','jjones@fun4all.com'); INSERTINTO Customers(cust_id, cust_name, cust_address, cust_city, cust_state, cust_zip, cust_country, cust_contact, cust_email) VALUES('1000000004','Fun4All','829 Riverside Drive','Phoenix','AZ','88888','USA','Denise L. Stephens','dstephens@fun4all.com'); INSERTINTO Customers(cust_id, cust_name, cust_address, cust_city, cust_state, cust_zip, cust_country, cust_contact) VALUES('1000000005','The Toy Store','4545 53rd Street','Chicago','IL','54545','USA','Kim Howard'); select*from Customers ------------------------- -- Populate Vendors table ------------------------- INSERTINTO Vendors(vend_id, vend_name, vend_address, vend_city, vend_state, vend_zip, vend_country) VALUES('BRS01','Bears R Us','123 Main Street','Bear Town','MI','44444','USA'); INSERTINTO Vendors(vend_id, vend_name, vend_address, vend_city, vend_state, vend_zip, vend_country) VALUES('BRE02','Bear Emporium','500 Park Street','Anytown','OH','44333','USA'); INSERTINTO Vendors(vend_id, vend_name, vend_address, vend_city, vend_state, vend_zip, vend_country) VALUES('DLL01','Doll House Inc.','555 High Street','Dollsville','CA','99999','USA'); INSERTINTO Vendors(vend_id, vend_name, vend_address, vend_city, vend_state, vend_zip, vend_country) VALUES('FRB01','Furball Inc.','1000 5th Avenue','New York','NY','11111','USA'); INSERTINTO Vendors(vend_id, vend_name, vend_address, vend_city, vend_state, vend_zip, vend_country)
  • 4. VALUES('FNG01','Fun and Games','42 Galaxy Road','London',NULL,'N16 6PS','England'); INSERTINTO Vendors(vend_id, vend_name, vend_address, vend_city, vend_state, vend_zip, vend_country) VALUES('JTS01','Jouets et ours','1 Rue Amusement','Paris',NULL,'45678','France'); select*from Vendors -------------------------- -- Populate Products table -------------------------- INSERTINTO Products(prod_id, vend_id, prod_name, prod_price, prod_desc) VALUES('BR01','BRS01','8 inch teddy bear', 5.99,'8 inch teddy bear, comes with cap and jacket'); INSERTINTO Products(prod_id, vend_id, prod_name, prod_price, prod_desc) VALUES('BR02','BRS01','12 inch teddy bear', 8.99,'12 inch teddy bear, comes with cap and jacket'); INSERTINTO Products(prod_id, vend_id, prod_name, prod_price, prod_desc) VALUES('BR03','BRS01','18 inch teddy bear', 11.99,'18 inch teddy bear, comes with cap and jacket'); INSERTINTO Products(prod_id, vend_id, prod_name, prod_price, prod_desc) VALUES('BNBG01','DLL01','Fish bean bag toy', 3.49,'Fish bean bag toy, complete with bean bag worms with which to feed it'); INSERTINTO Products(prod_id, vend_id, prod_name, prod_price, prod_desc) VALUES('BNBG02','DLL01','Bird bean bag toy', 3.49,'Bird bean bag toy, eggs are not included'); INSERTINTO Products(prod_id, vend_id, prod_name, prod_price, prod_desc) VALUES('BNBG03','DLL01','Rabbit bean bag toy', 3.49,'Rabbit bean bag toy, comes with bean bag carrots'); INSERTINTO Products(prod_id, vend_id, prod_name, prod_price, prod_desc) VALUES('RGAN01','DLL01','Raggedy Ann', 4.99,'18 inch Raggedy Ann doll'); INSERTINTO Products(prod_id, vend_id, prod_name, prod_price, prod_desc) VALUES('RYL01','FNG01','King doll', 9.49,'12 inch king doll with royal garments and crown'); INSERTINTO Products(prod_id, vend_id, prod_name, prod_price, prod_desc) VALUES('RYL02','FNG01','Queen doll', 9.49,'12 inch queen doll with royal garments and crown'); select*from Products ------------------------ -- Populate Orders table ------------------------ INSERTINTO Orders(order_num, order_date, cust_id) VALUES(20005,'2004-05-01','1000000001'); INSERTINTO Orders(order_num, order_date, cust_id) VALUES(20006,'2004-01-12','1000000003'); INSERTINTO Orders(order_num, order_date, cust_id) VALUES(20007,'2004-01-30','1000000004'); INSERTINTO Orders(order_num, order_date, cust_id) VALUES(20008,'2004-02-03','1000000005'); INSERTINTO Orders(order_num, order_date, cust_id) VALUES(20009,'2004-02-08','1000000001'); select*from Orders
  • 5. ---------------------------- -- Populate OrderItems table ---------------------------- INSERTINTO OrderItems(order_num, order_item, prod_id, quantity, item_price) VALUES(20005, 1,'BR01', 100, 5.49); INSERTINTO OrderItems(order_num, order_item, prod_id, quantity, item_price) VALUES(20005, 2,'BR03', 100, 10.99); INSERTINTO OrderItems(order_num, order_item, prod_id, quantity, item_price) VALUES(20006, 1,'BR01', 20, 5.99); INSERTINTO OrderItems(order_num, order_item, prod_id, quantity, item_price) VALUES(20006, 2,'BR02', 10, 8.99); INSERTINTO OrderItems(order_num, order_item, prod_id, quantity, item_price) VALUES(20006, 3,'BR03', 10, 11.99); INSERTINTO OrderItems(order_num, order_item, prod_id, quantity, item_price) VALUES(20007, 1,'BR03', 50, 11.49); INSERTINTO OrderItems(order_num, order_item, prod_id, quantity, item_price) VALUES(20007, 2,'BNBG01', 100, 2.99); INSERTINTO OrderItems(order_num, order_item, prod_id, quantity, item_price) VALUES(20007, 3,'BNBG02', 100, 2.99); INSERTINTO OrderItems(order_num, order_item, prod_id, quantity, item_price) VALUES(20007, 4,'BNBG03', 100, 2.99); INSERTINTO OrderItems(order_num, order_item, prod_id, quantity, item_price) VALUES(20007, 5,'RGAN01', 50, 4.49); INSERTINTO OrderItems(order_num, order_item, prod_id, quantity, item_price) VALUES(20008, 1,'RGAN01', 5, 4.99); INSERTINTO OrderItems(order_num, order_item, prod_id, quantity, item_price) VALUES(20008, 2,'BR03', 5, 11.99); INSERTINTO OrderItems(order_num, order_item, prod_id, quantity, item_price) VALUES(20008, 3,'BNBG01', 10, 3.49); INSERTINTO OrderItems(order_num, order_item, prod_id, quantity, item_price) VALUES(20008, 4,'BNBG02', 10, 3.49); INSERTINTO OrderItems(order_num, order_item, prod_id, quantity, item_price) VALUES(20008, 5,'BNBG03', 10, 3.49); INSERTINTO OrderItems(order_num, order_item, prod_id, quantity, item_price) VALUES(20009, 1,'BNBG01', 250, 2.49); INSERTINTO OrderItems(order_num, order_item, prod_id, quantity, item_price) VALUES(20009, 2,'BNBG02', 250, 2.49);
  • 6. INSERTINTO OrderItems(order_num, order_item, prod_id, quantity, item_price) VALUES(20009, 3,'BNBG03', 250, 2.49); select*from OrderItems