2.2)
Relation 1: Orders
OrderId | CustomerId | dateOrdered | dateRequired | status |
---|---|---|---|---|
123456 | 234567 | 10/05/2014 | 14/05/2014 | completed |
123457 | 234567 | 12/04/2019 | 20/06/2019 | pending |
123458 |
234568 | 10/08/2018 | 16/08/2018 | completed |
123459 | 234569 | 17/04/2019 | 20/04/2019 | completed |
Relation 2: Customer
customerId | customerLastName | customerStreet | customerCity | customerState | customerZip |
---|---|---|---|---|---|
234567 | Joseph | St. anny | Blaine | Minnesota | 55444 |
234568 | Maria | W 18 | chicago | Illinois | 45544 |
234569 | Blood | Wall street | New york | New york | 34544 |
234570 | Varte | 300th ave | phoenix | Arizona | 24544 |
Relation 3: OrderDetails
orderId | productId | quantity | lineNumber | amount |
---|---|---|---|---|
123456 | 310794 | 50 | 2 | 100000 |
123457 | 310795 | 20 | 1 | 50000 |
123458 | 310796 | 10 | 3 | 8000 |
123459 | 310797 | 20 | 4 | 500000 |
Relation 4: Products
productId | name | description | qunatity | unitPrice |
---|---|---|---|---|
310794 | chairs | for educational institute | 50 | 2000 |
310795 | tables | for office | 20 | 2500 |
310796 | fans | for hotel | 10 | 800 |
310797 | Airconditioner | for adminstration | 20 | 25000 |
Relation 5:
accountNumber | customerId | dateOpened | creditCard | mailingStreet | mailingCity | mailingState | mailingZip |
---|---|---|---|---|---|---|---|
534567 | 234567 | 12/10/2010 | 2056458932 | St. anny | Blaine | Minnesota | 55444 |
534568 | 234568 | 10/04/2014 | 1045862378 | W 18 | chicago | Illinois | 45544 |
534569 | 234569 | 11/01/2013 | 2598374691 | Wall street | New york | New york | 34544 |
534570 | 234570 | 12/07/2015 | 1673089443 | 300th ave | phoenix | Arizona | 24544 |
2.4)
a) this query will result credit card details of the customer who have a mailingZip code as 55444 in the account table
b) this query will result the customerId and the account number of the customer where the customer city is chicago.
I hope this will help you so please give positive ratings :)))
Given the following relational database schema (primary keys are bold and underlined). Answer questions 2.1 to 2.4 Orde...
Database: Convert E-R diagrams to relational schema and show • Primary Keys (using underline) • Foreign Keys (using dotted underline) • Referential Integrity Convert the E-R diagrams to relational schema and show: Primary Keys (using underline) Foreign Keys (using dotted underline) . Referential Integrity Your schema should look similar to the example below. CUSTOMER CustName ORDER PROJECT Foect Title EMPLOYEE PROJECT assigecl to Tite BBli EMPLOYEE PROJECT 0 ProectTitle 4 student admitdate D,C gradstudent advisor major mimor class person name...
Below is the database schema for a company. Primary keys are underlined. Customers (CustomerID, CompanyName, Phone, BalanceDue) Oders (Orderid, orderdate, customerid, freightamount) Orderdetails (oderid, productid, qtyordered, price) Products (productid, productname, qtyinstock, suggestedprice, minstocklevel) Given this SQL statement: Select * From Customers Inner Join Orders on Orders.CustomerID=Customers.CustomerID Where Orders.CustomerID is Null; Which of the following statement is correct? It is a SQL select statement that will list the ProductName for all products where the Qtyinstock is less than the total QtyOrdered...
The relational schema shown below is part of a student database. The primary and foreign keys are highlighted in bold.Student (studNo, studName, address, mobileNo)Course (courseNo, courseName, creditHour, level) Registration (studNo, courseNo, regDate, semester, session)Project (projNo, projName, courseNo)Assignment (projNo, studNo, startDate, dueDate, hoursSpent)Write SQL queries based on the student database given above: 1. Create tables & constraints for the student database.2. Insert some data into the tables to check that the tables created are correct. No limit on how many rows you want...
**************PLEASE COMPLETE PART F) ONLY************** Consider the following relational database schema (primary keys are underlined) and SQL query: Hotel (hotelNo, hotelName, city) Room (roomNo, hotelNo, type, price) Booking (hotelNo, guestNo, dateFrom, dateTo, roomNo) Guest (guestNo, guestName, guestAddress) SELECT g.guestNo, g.guestName FROM Room r, Booking b, Hotel h, Guest g WHERE h.hotelNo = b.hotelNo AND g.guestNo = b.guestNo AND h.hotelNo = r.hotelNo AND h.hotelName = "Ritz" AND dateFrom >= "Jan 01, 2001" AND dateTo <= "Dec 31, 2001"; (A) state what...
**************PLEASE COMPLETE PART E) ONLY************** Consider the following relational database schema (primary keys are underlined) and SQL query: Hotel (hotelNo, hotelName, city) Room (roomNo, hotelNo, type, price) Booking (hotelNo, guestNo, dateFrom, dateTo, roomNo) Guest (guestNo, guestName, guestAddress) SELECT g.guestNo, g.guestName FROM Room r, Booking b, Hotel h, Guest g WHERE h.hotelNo = b.hotelNo AND g.guestNo = b.guestNo AND h.hotelNo = r.hotelNo AND h.hotelName = "Ritz" AND dateFrom >= "Jan 01, 2001" AND dateTo <= "Dec 31, 2001"; (A) state what...
consider the following relational database that records details of parts and suppliers. Primary keys are underlined and the Foreign Keys are identified with (FK). Suppliers (sid, sname, address, credit) Parts (pid, pname, color) Catalog (sid (FK), pid (FK), cost) The credit attribute denotes the size of the supplier’s credit account. The Catalog relation lists the prices charged for parts by Suppliers. Which of the following queries returns the snames of suppliers who supply every part? Select one or more: a....
Given the following relational schema, write queries in SQL to answer the English questions. The Access Database for the schema is available, as is a DDL file. It is also available on the MySQL server. You must only submit the SQL for your answers. You can get your answers without using a DBMS or by using Access or MySQL. Customer(cid: integer, cname: string, address: string, city: string, state: string) Product(pid: integer, pname: string, price: currency, inventory: integer) Shipment(sid: integer, cid:...
Database Exercise I (50 pts): This exercise deals with a database that stores information about Hotel Management System. Customer (C email, name, country) Payment (Invoice id, C email, payment method, date) invoice (Invoice id, starus, invoice description) Has (Bill id. Invoice id) 9a Bill (Invoice id, Bill id, amount, Bname, type, date, reservation id) Reservation (Hotel id, room id, C email, date, period, reservation id) Rooms(Hotel id. room id, price, category) Hotel (Hotel id. H name. country) Own (room id,...
Consider the following relational database to manage concert and ticket sales. The relations are artist, concert, venue, seat, ticket, and fan. The schemas for these relations (with primary key attributes underlined) are: Artist-schema = (artistname, type, salary) Concert-schema = (artistname, date, venuename, artistfees) Venue-schema = (venuename, address, seating_capacity) Seat-schema=(venuename, row, seatnumber) Ticket-schema = (fanID, date, venuename, row, seatnumber) Fan-schema = (fanID, name, address, creditcardno) Where: • artistname is a unique name for the artist (because of trademark/copyright rules no two...