Presentation is loading. Please wait.

Presentation is loading. Please wait.

CS 205: Database Systems Jake Molko, David Branker, and James Petri Used Cars Sales Database Client Letter Our database design started with a client’s.

Similar presentations


Presentation on theme: "CS 205: Database Systems Jake Molko, David Branker, and James Petri Used Cars Sales Database Client Letter Our database design started with a client’s."— Presentation transcript:

1 CS 205: Database Systems Jake Molko, David Branker, and James Petri Used Cars Sales Database Client Letter Our database design started with a client’s request : Dear Sir/Madam: I am writing to request a database solution that could have the potential to reduce enormous administrative costs for my business. For years, we have filed physical records regarding the sales of used automobiles. We keep our records for quite some time in keeping with good business practices. However, if all of this data could be centrally located in one electronic database, we would ultimately be able to save large sums of money, greatly reduce the amount of space taken up by our many sales records, and provide better services to our customers. I have been told that you would be able to provide me with a “conceptual model” of a database that would suit our needs. Upon successful completion, I am prepared to pay handsomely for your efforts. My deepest thanks, Mike Branker Branker Buick, Inc. Client Queries We then found out what kinds of questions the client wanted the database to answer. I would like the database to be able to answer questions such as the following: How many white Toyota Corollas were sold in Lincoln in 1997? How many Fords were sold by Horizon Motors in 1997? What were the sale prices of Corvettes? What were all the vehicles sold by Horizon Motors in 1994? What color were Buicks that sold for over $5,000 in Lincoln, NE? How many Nissan pickup sales occurred between 1994 and 1995 from Horizon Motors? What was the name of the buyer of the Dodge Spirit with VIN #3B3AA463XBT278495? What was the average sale price of brown vehicles sold by Horizon Motors in 1996? What is the suggested retail price of a 1994 Nissan Sentra? Who was the vendor for VIN# 1B3EG24J2KKG212824? Conceptual Model Design At this point, we created a conceptual model which accurately represents the needed database. All the client’s questions can be answered with this model. create table city ( ID serial primary key, CityName character varying (15) not null, State character (2) not null /*CityName and State are "not null" because they are actually the real keys.*/ ) create table cvehicle ( ID serial primary key, Year smallint (4) not null, Make character varying (15) not null, Model character varying (20) not null, SuggPrice integer /*Year, Make, and Model are all "not null" because they are actually the real keys.*/ )... User Interface Design Since browsers are ubiquitous and easy-to-use, we created a browser interface to our database using PHP, CSS, and HTML. Here is a screen shot of our interface. Q: What were all the vehicles sold by Horizon Motors that were 94’s? To get the desired answer, select 1994 from the Year tab in the Car Type row. From the display criteria, select what you want to know about the car from the Year, Make, Model, and Suggested Price checkboxes. Relational Model Design Next we converted (a straightforward process) the conceptual model into a model suited for a relational database, adding artificial ID’s for efficiency. Keys are underlined. ConceptualVehicle(ID, Year, Make, Model, SuggPrice) Vehicle(VIN, YearMakeModel, Color, Condition) Foreign key: YearMakeModel references ID in ConceptualVehicle Buyer(SS#, Name, Address) Vendor(ID, Name, Phone#, Location) Foreign key: Location references ID in City Sale(Sale#, VIN, BuyerID, VendorID, Price, Date) Foreign key: BuyerID references SS# in Buyer Foreign key: VendorID references ID in Vendor Foreign key: VIN references VIN in Vehicle City(ID, CityName, State) Relational Database Implementation We chose the relational database MySQL for implementation. Since MySQL runs as a server, it’s possible to access our database from any Internet-connected computer. Here is the beginning of an SQL script which creates tables in MySQL (or any other SQL-compliant relational database). create table buyer ( ss_num character varying (11) primary key, name character varying (30), address character varying (55) ) Summary After completing the CS 205 course, the database project was about three to four weeks of work for our three-person team.


Download ppt "CS 205: Database Systems Jake Molko, David Branker, and James Petri Used Cars Sales Database Client Letter Our database design started with a client’s."

Similar presentations


Ads by Google