de la Constitución 2222', 'México D.F.', '5021', 'Mexico' ) INSERT INTO Customers VALUES ( 3, 'Antonio Moreno Taquería', 'Antonio Moreno', 'Mataderos 2312', 'México D.F.', '5023', 'Mexico' ) INSERT INTO Customers VALUES ( 4, 'Around the Horn', 'Thomas Hardy', '120 Hanover Sq.', 'London', 'WA1 1DP', 'UK' ) INSERT INTO Customers VALUES ( 5, 'Berglunds snabbköp', 'Christina Berglund', 'Berguvsvägen 8', 'Luleå', 'S-958 22', 'Sweden' ) INSERT INTO Customers VALUES ( 6, 'Blauer See Delikatessen', 'Hanna Moos', 'Forsterstr. 57', 'Berlin', '12209', 'Germany' ) INSERT INTO Customers VALUES ( 2, 'Ana Trujillo Emparedados y helados', 'Ana Trujillo', 'Avda. DROP TABLE IF EXISTS OrderDetails DROP TABLE IF EXISTS Orders DROP TABLE IF EXISTS Products DROP TABLE IF EXISTS Categories DROP TABLE IF EXISTS Customers DROP TABLE IF EXISTS Employees DROP TABLE IF EXISTS Shippers DROP TABLE IF EXISTS Suppliers CREATE TABLE Categories ( CategoryID INTEGER PRIMARY KEY AUTOINCREMENT, CategoryName TEXT, Description TEXT ) CREATE TABLE Customers ( CustomerID INTEGER PRIMARY KEY AUTOINCREMENT, CustomerName TEXT, ContactName TEXT, Address TEXT, City TEXT, PostalCode TEXT, Country TEXT ) CREATE TABLE Employees ( EmployeeID INTEGER PRIMARY KEY AUTOINCREMENT, LastName TEXT, FirstName TEXT, BirthDate DATE, Photo TEXT, Notes TEXT ) CREATE TABLE Shippers ( ShipperID INTEGER PRIMARY KEY AUTOINCREMENT, ShipperName TEXT, Phone TEXT ) CREATE TABLE Suppliers ( SupplierID INTEGER PRIMARY KEY AUTOINCREMENT, SupplierName TEXT, ContactName TEXT, Address TEXT, City TEXT, PostalCode TEXT, Country TEXT, Phone TEXT ) CREATE TABLE Products ( ProductID INTEGER PRIMARY KEY AUTOINCREMENT, ProductName TEXT, SupplierID INTEGER, CategoryID INTEGER, Unit TEXT, Price NUMERIC DEFAULT 0, FOREIGN KEY ( CategoryID ) REFERENCES Categories ( CategoryID ), FOREIGN KEY ( SupplierID ) REFERENCES Suppliers ( SupplierID ) ) CREATE TABLE Orders ( OrderID INTEGER PRIMARY KEY AUTOINCREMENT, CustomerID INTEGER, EmployeeID INTEGER, OrderDate DATETIME, ShipperID INTEGER, FOREIGN KEY ( EmployeeID ) REFERENCES Employees ( EmployeeID ), FOREIGN KEY ( CustomerID ) REFERENCES Customers ( CustomerID ), FOREIGN KEY ( ShipperID ) REFERENCES Shippers ( ShipperID ) ) CREATE TABLE OrderDetails ( OrderDetailID INTEGER PRIMARY KEY AUTOINCREMENT, OrderID INTEGER, ProductID INTEGER, Quantity INTEGER, FOREIGN KEY ( OrderID ) REFERENCES Orders ( OrderID ), FOREIGN KEY ( ProductID ) REFERENCES Products ( ProductID ) ) INSERT INTO Categories VALUES ( 1, 'Beverages', 'Soft drinks, coffees, teas, beers, and ales' ) INSERT INTO Categories VALUES ( 2, 'Condiments', 'Sweet and savory sauces, relishes, spreads, and seasonings' ) INSERT INTO Categories VALUES ( 3, 'Confections', 'Desserts, candies, and sweet breads' ) INSERT INTO Categories VALUES ( 4, 'Dairy Products', 'Cheeses' ) INSERT INTO Categories VALUES ( 5, 'Grains/Cereals', 'Breads, crackers, pasta, and cereal' ) INSERT INTO Categories VALUES ( 6, 'Meat/Poultry', 'Prepared meats' ) INSERT INTO Categories VALUES ( 7, 'Produce', 'Dried fruit and bean curd' ) INSERT INTO Categories VALUES ( 8, 'Seafood', 'Seaweed and fish' ) INSERT INTO Customers VALUES ( 1, 'Alfreds Futterkiste', 'Maria Anders', 'Obere Str. sqlite3 Northwind.db - Copy and paste the SQL below into the terminal window to populate the Northwind database. Or: - Run the following command in a terminal window. Run the script to populate the Northwind database. Copy and paste the SQL below into the Execute SQL window. Create a new database named Northwind.db.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |