|
2) Consider the following relations for an order processing database: CUSTOMER(Cust#, CustName, City) ORDER(Order#, OrdDate, Cust#, OrdAmount) ORDER_ITEM(Order#, Item#, Quantity) ITEM(Item#, UnitPrice) SHIPMENT(Order#, Warehouse#, ShipDate) WAREHOUSE (Warehouse#, City) Primary keys are underlined. OrdAmount is total dollar amount of an order. OrdDate is date the order was placed. ShipDate is date when order was shipped from the warehouse. An order can be shipped from several warehouses. Specify all foreign keys for this schema. For each foreign key specify referential integrity constraints in words. For example: ANSWER: ORDER. Cust# is foreign key and it refers to CUSTOMER.Cust#. |
ORDER. Cust# is foreign key and it refers to CUSTOMER.Cust#.
ORDER_ITEM.Order# is foreign key and it refers to ORDER.Order#
ORDER_ITEM.Item# is foreign key and it refers to ITEM.Item#
SHIPMENT.Order# is foreign key and it refers to ORDER.Order#
SHIPMENT.Warehouse# is foreign key and it refers to WAREHOUSE.Warehouse#
2) Consider the following relations for an order processing database: CUSTOMER(Cust#, CustName, City) ORDER(Order#, OrdDate, Cust#,...
Need help completing this schema below.
2. (3.14 Elmasri-6e)- Consider the following six relations for an order-processing database application in a company CUSTOMER (Cust#, Cnam City) ORDER (Orderf., Qdate Custf. QrdAmt ORDER ITEM (Order, Item#, Qty) ITEM Citen Unitaptice) SHIPMENT (Order Warehouse Ship. date) WAREHOUSE (Warehouses City) Here, Qrd Amt refers to total dollar amount of an order, Qdate is the date the order was placed; Ship.date is the date an order (or part of an order) is shipped from...
Consider the following relations for a database that keeps track of automobile sales in a car delarship (OPTION refers to some optional equipment installed on an automobile); CAR (Serialno, Model, Manufacturer, Price) OPTION (Serialno, optionname, Price) SALE (Salesperson_id, Serialno, Date, Sale_Price) SALESPERSON (Salespersn_id, Name, Phone) First specify the foreign keys for this schema, stating any assumptions you make. Next, populate the relations with a few sample tuples, and then give an example of an insertion in the SALE and SALESPERSON...
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...
Q) Integrity Constraints question. Consider following tables (bold are Primary Keys) •Hotel (hotelNo, hotelName, city) •Room (roomNo, hotelNo, type, price) •Booking (hotelNo, guestNo, dateFrom, dateTo, roomNo) •Guest (guestNo, guestName, guestAddress) Identify the foreign keys in this schema, Explain how the entity and referential integrity rules apply to these relations.
Consider the following relations for course-enrollment database in a university: STUDENT(S-ID,S-Name, Department, Birth-date) COURSE(C-ID, C-Name, Department) ENROLL(S-ID, C-ID, Grade) TEXTBOOK(B-ISBN, B-Title, Publisher, Author) BOOK-ADOPTION(C-ID, B-ISBN) (a) Draw the database relational schema and show the primary keys and referential integrity constraints on the schema. (b) How many superkeys does the relation TEXTBOOK have? List ALL of them. (c) Now assume each COURSE has distinct C-Name. (i) If C-ID is a primary key, what are the candidate keys and the unique keys...
Given the following relational database schema (primary keys are bold and underlined). Answer questions 2.1 to 2.4 Orders(orderld, customerld, dateOrdered, dateRequired, status) Customer(customerld, customerLastName, customerStreet, customerCity, customerState, customer Lip OrderDetails(orderld.productld, quantity, lineNumber, amount) Products(productld, name, description, quantity, unitPrice) Account(accountNumber, customerld, dateOpened, creditCard, mailingStreet, mailingCity, mailingState, mailingZip) 2.1 (2 Points) List all possible foreign keys. For each foreign key list both the referencing and referenced relations. 2.2 (2 Points) Devise a reasonable database instance by filling the tables with data of...
Consider the following relations for a database that keeps track of student enrollment in courses and books adopted for each course. -------------------------------------------------------------------------------------------------------- STUDENT(Ssn,Name,Major,Bdate) COURSE(Course#,Cname,Dept) ENROLL(Ssn,Course#,Quarter,Grade) TEXTBOOK(Book_isbn,Book_title,Publisher,Author) BOOK_ASSOC(Course#,Quarter,Book_isbn) ------------------------------------------------------------------------------------------------------------------------------- Having that a relation can have zero or more foreign keys and each foreign key can refer to different referenced relations. Specify the foreign keys for this schema.
Assume that The Queen Anne Curiosity Shop designs a database with the following tables. CUSTOMER (CustomerID, LastName, FirstName, EmailAddress, EncyptedPassword, City, State, ZIP, Phone, ReferredBy) EMPLOYEE (EmployeeID, LastName, FirstName, Position, Supervisor, OfficePhone, EmailAddress) VENDOR (VendorID, CompanyName, ContactLastName, ContactFirstName, Address, City, State, ZIP, Phone, Fax, EmailAddress) ITEM (ItemID, ItemDescription, PurchaseDate, ItemCost, ItemPrice, VendorID) SALE (SaleID, CustomerID, EmployeeID, SaleDate, SubTotal, Tax, Total) SALE_ITEM (SaleID, SaleItemID, ItemID, ItemPrice) The referential integrity constraints are: ReferredBy in CUSTOMER must exist in CustomerID in CUSTOMER Supervisor...
Database Schemas:
Please draw the schemas like the example and not just list the
entities and attributes! Thanks in advance!
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 OrderDate dob admitdate D,C gradstudent advisor major mimor class person phone D,C home homeid street buyer city ssn state ssn address zip nobedrms spousename profession spouseprofess minprice bdrms...
Q.1] Write SQL statements based on the tennis database schema (practice homework 5) Get all the different town names from the PLAYERS table. 2. For each town, find the number of players. 3. For each team, get the team number, the number of matches that has been played 'for that team, and the total number of sets won. 4. For each team that is captained by a player resident in "Eltham", get the team number and the number of matches...