Great Deal! Get Instant $10 FREE in Account on First Order + 10% Cashback on Every Order Order Now

AMC er dIAGRAM AMC ER Diagram PostgreSQL CREATE TABLE "STORE" ( "StoreID" INTEGER PRIMARY KEY, "Name" TEXT, "Contact" INTEGER, " Email" TEXT, " Location" TEXT ); CREATE TABLE "STOREMANAGER" (...

1 answer below »
AMC er dIAGRAM
AMC ER Diagram
PostgreSQL
CREATE TABLE "STORE" (
"StoreID" INTEGER PRIMARY KEY,
"Name" TEXT,
"Contact" INTEGER,
" Email" TEXT,
" Location" TEXT
);
CREATE TABLE "STOREMANAGER" (
"StoremanagerID" INTEGER PRIMARY KEY,
"Name" TEXT,
"Contact" INTEGER,
"Email" TEXT,
"Address" TEXT
);
CRSEATE TABLE "SUPPLIER" (
"SupplierID" INTEGER PRIMARY KEY,
"Name" TEXT,
"Contact" INTEGER,
"Email" TEXT,
"Location" TEXT,
);
CREATE TABLE "INVENTORY" (
"InventoryID" INVENTORY PRIMARY KEY,
"ProductNumber" INTEGER REFERENCES PRODUCTS(ProductNumber) ,
"Quantity" INTEGER
);
CREATE TABLE "CASUAL" (
"EmployeeID" INTEGER REFERENCES EMPLOYEES(EmployeeID),
"Starttime" INTEGER,
"Endtime" INTEGER,
"Hourlyrate" INTEGER
);
CREATE TABLE "DEPARTMENT" (
"DepartmentNO" INTEGER PRIMARY KEY,
"Title" TEXT,
"Phone" INTEGER,
"Email" TEXT,
);
CREATE TABLE "EMPLOYEES" (
"EmployeeID" INTEGER PRIMARY KEY,
"Name" TEXT,
"Positiosn" INTEGER,
"Email" TEXT,
"Address" TEXT
);
CREATE TABLE "SUPERVISOR" (
"SupervisorID" INTEGER PRIMARY KEY,
"Name" TEXT,
"Contact" INTEGER,
"Email" TEXT,
"Address" TEXT
);
CREATE TABLE "FULLTIME" (
"EmployeeID" INTEGER REFERENCES EMPLOYEES(EmployeeID),
"Starttime" INTEGER,
"Endtime" INTEGER,
"Annualrate" INTEGER,
);
CREATE TABLE "PRODUCTS" (
"ProductNumber" INTEGER PRIMARY KEY,
"Name" TEXT,
"Brand" TEXT,
"Price" INTEGER,
);
CREATE TABLE "PATRON" (
"PatronID" INTEGER PRIMARY KEY,
"Name" TEXT,
"Contact" INTEGER,
"Email" TEXT,
"Location" TEXT
);
CREATE TABLE "ORDER" (
"OrderID" INTEGER PRIMARY KEY,
"OrderDate" INTEGER,
"Numberofproducts" INTEGER,
"PatronID" INTEGER REFERENCES PATRON(PatronID),
);
CREATE TABLE "PAYSLIPS" (
"PayID" INTEGER PRIMARY KEY,
"EmployeeID" INTEGER REFERENCES EMPLOYEES(EmployeeID),
"Starttime" INTERGER,
"Endtime" INTEGER,
"TotalHours" INTEGER,
"Tax" INTEGER
);
Answered Same Day May 27, 2021

Solution

Neha answered on May 28 2021
135 Votes
59043/59043.docx
select CustomerId,concat(firstName, ' ',lastName) as CustomerName, Phone,Address from customer order by CustomerId desc;
CustomerId    CustomerName        Phone        Phone
3        "John Phillips"        "575675555"    "NSW"
2        "David "        "45656666"    "Tasmania"
1        "Sally Williams"        "34546666"    "NSW"
select * from product where price<100;
orderid        name        
and        description    price
4        "Charger"    "Lenovo"    "Local Charger"    89
Select Name, street,subu
,state, postcode from store where street like 'George';
Name    street        subu
        state        postcode
"IJK"    "George"    "8009"        "New East"    4004
select * from orderdetail group by orderid, prodid having count(prodid)>2;
orderid        date    prodid        quantity    customerid
Select distinct customer.customerId, concat(firstName,' ',lastName) As FullName, Address from custome
left join orderdetail on orderdetail.customerId=customer.customerId
where orderdetail.customerId is null;
customerid    FullName    Address
3        "John Phillips"    "NSW"
Select employee.employeeId as EmployeeNumber, firstName, lastName,department.Name As DepartmentName,store.Name As StoreName from employee
inner join department on department.departmentId = deptId
inner join store on store.storeId = department.storeid;
EmployeeNumber    firstName    lastName    DepartmentName    StoreName
3            "David"        "Smith"        "Finance"        "ABC"
2            "Sara"        "Williams”    "Finance"        "ABC"
1            "Parag"        "Smith"        "Finance"        "ABC"
4            "Lucy"        " "        "Accounts"        "ABC"
select store.Name as StoreName, count(employee.employeeId) As Number from store
inner join department on department.StoreId= store.storeId
inner join employee on employee.deptId = department.departmentId
where department.Name like 'Accounts'
group by store.Name;
StoreName    Numbe
"ABC"        1
select * from orderdetail where orderdetail.Date > '2017-06-30' and orderdetail.Date < '2018-07-01';
orderid        date        prodid        quantity    customerid    
1006        "2018-06-30"    2        12        1
Select customer.customerId As CustomerId,count(orderdetail.orderId) As NumberOfOrders from custome
inner join orderdetail on orderdetail.customerId = customer.customerId
group by customer.customerId;
CustomerId    NumberOfOrders
2        1
1        7
Select orderId,Date, count(ProdId) as NumberOfProducts from orderdetail
group by ProdId,orderId order by orderId desc;
orderId         Date        NumberOfProducts
1008        "2018-08-19"    1
1007        "2018-10-09"    1
1006        "2018-06-30"    1
1005        "2017-06-30"    1
1004        "2018-10-23"    1
1003        "2018-08-19"    1
1002        "2011-10-19"    1
1001        "2018-10-23"    1
59043/tables creation.sql
Create table Custome
( CustomerId bigint primary key,
firstName varchar(50),
lastName varchar(50),
Address varchar(100),
Phone varchar(20),
Email varchar(50)
);
insert into...
SOLUTION.PDF

Answer To This Question Is Available To Download

Related Questions & Answers

More Questions »

Submit New Assignment

Copy and Paste Your Assignment Here