createstmt

sql

School

University of the Fraser Valley *

*We aren’t endorsed by this school

Course

13

Subject

Information Systems

Date

Oct 30, 2023

Type

sql

Pages

2

Uploaded by kakger18

Report
CREATE TABLE countries( CountryID INTEGER NOT NULL, CountryName VARCHAR(50), CountryCode VARCHAR(2), PRIMARY KEY (CountryID) ); CREATE TABLE cities( CityID INTEGER NOT NULL, CityName VARCHAR(50), Zipcode INTEGER, CountryID INTEGER NOT NULL, PRIMARY KEY (CityID), FOREIGN KEY (CountryID) REFERENCES countries(CountryID) ); CREATE TABLE customers( CustomerID INTEGER NOT NULL, FirstName VARCHAR(50), MiddleInitial VARCHAR(4), LastName VARCHAR(50), CityID INTEGER NOT NULL, Address VARCHAR(255), PRIMARY KEY (CustomerID), FOREIGN KEY (CityID) REFERENCES cities(CityID) ); CREATE TABLE categories( CategoryID INTEGER NOT NULL, CategoryName VARCHAR(50), PRIMARY KEY (CategoryID) ); CREATE TABLE products( ProductID INTEGER NOT NULL, ProductName VARCHAR(255), Price INTEGER, "Temp" INTEGER, CategoryID INTEGER NOT NULL, "Class" VARCHAR(50), ModifyDate TIMESTAMP, Resistant VARCHAR(20), IsAllergic VARCHAR(10), VitalityDays VARCHAR(4), PRIMARY KEY (ProductID), FOREIGN KEY (CategoryID) REFERENCES categories(CategoryID) ); CREATE TABLE employes( EmployeeID INTEGER NOT NULL, FirstName VARCHAR(50), MiddleInitial VARCHAR(1), LastName VARCHAR(50), BirthDate TIMESTAMP, Gender VARCHAR(1), CityID INTEGER NOT NULL, HireDate TIMESTAMP, PRIMARY KEY (EmployeeID), FOREIGN KEY (CityID) REFERENCES cities(CityID)
); CREATE TABLE sales( SalesID INTEGER NOT NULL, SalesPersonID INTEGER NOT NULL, CustomerID INTEGER NOT NULL, ProductID INTEGER NOT NULL, Quantity INTEGER, Discount REAL, <<<<<<< HEAD TotalPrice INTEGER, "Temp" INTEGER, ======= TotalPrice REAL, >>>>>>> 548eb0662149b4117d4825401ade842accec3af1 SalesDate TIMESTAMP, TransactionNumber VARCHAR(20), PRIMARY KEY (SalesID), FOREIGN KEY (SalesPersonID) REFERENCES employes(EmployeeID), FOREIGN KEY (CustomerID) REFERENCES customers(CustomerID), FOREIGN KEY (ProductID) REFERENCES products(ProductID) ); <<<<<<< HEAD --drop temp and totalprice ======= >>>>>>> 548eb0662149b4117d4825401ade842accec3af1
Your preview ends here
Eager to read complete document? Join bartleby learn and gain access to the full version
  • Access to all documents
  • Unlimited textbook solutions
  • 24/7 expert homework help

Browse Popular Homework Q&A

Q: Calculate the quantity (mL) of glycerin needed to prepare 250 mL of the following ophthalmic…
Q: What enzyme uses phosphocreatine to make ATP? creatine kinase phosphorylation. oxidative What other…
Q: why would the company sell both pistachios and oranges instead of only pistachios?
Q: Test the series below for convergence using the Ratio Test. n=1 3 nº 0.7" The limit of the ratio…
Q: Find the equation of the tangent line to the curve (a lemniscate) 2(x^2+y^2)^2=25(x^2−y^2) at the…
Q: Predict the reactants of this chemical reaction. That is, fill in the left side of the chemical…
Q: Let L be the line segment with endpoints at (1,2,3) and (-1,1,4). A light source at is at the point…
Q: A molecule with the molecular formula of C3H8O produces the IR spectrum shown below. Draw a…
Q: HI can react to form hydrogen and iodine as shown in the reaction below. When this occurs a small…
Q: In the corn snake Pantherophis guttatus, there are several different color variants, including…
Q: What's a bijection between R and Z x [0,1) and how do I prove it is indeed bijection?
Q: This is a PHP code that generates a random number. It's supposed to check if my database already has…
Q: A 1.75 kg mass is attached to the end of a horizontal spring of spring constant 60 N/m and set into…
Q: Find the total deformation of the aluminum (E₁ = 73 GPa) bar Syste due to loading ? (unit m) Criven:…
Q: Determine whether or not the vector field is conservative. If it is conservative, find a function f…
Q: Explain how the body maintains the blood ph in ketoacidosis
Q: Step 2 of 6: Find the estimated y-intercept. Round your answer to three decimal places. Answer How…
Q: Suppose the scores of students on an exam are normally distributed with a mean of 376 and a standard…
Q: Categorize each diatomic molecule as diamagnetic or paramagnetic Dlagmagnetic 0₂ A No Answers Chosen…
Q: In the event that a nuclear reactor suffers an event that releases steam into the surrounding…
Q: Suppose you wanted to implement a control unit for a computer that you are designing. A. Would you…
Q: 10. Write a SQL code to find how many albums does the artist Led Zeppelin have. 11. Create a list of…