Ask Question, Ask an Expert

+61-413 786 465

info@mywordsolution.com

Ask DBMS Expert


Home >> DBMS

The Database

MySQL scripts cars_for_sale.sql and car_details.sql containing the data to use for this task have been supplied. To complete this task, you need to first create a database called inb104 and two tables called cars_for_sale and car_details. how to enter data into the two tables by using the supplied scripts. (Note that the supplied scripts are not database 'dumps', so you cannot just 'import' the whole database. You need to manually set up the database first and then run the scripts.) The two tables you must create in the inb104 database must contain the following fields. For the cars_for_sale table:

CarId    VARCHAR(45)

make     VARCHAR(45)

model    VARCHAR(45)

 For the car_details  table:

 CarId       VARCHAR(45)

seriesyear   VARCHAR(45)

price             INT(11)

kilometres   VARCHAR(45)

color              VARCHAR(100)

transmission  VARCHAR(45)

CarId is the Primary Key for both tables.

As usual we have supplied Python 'question' template files for you to complete, containing unit tests that your functions must pass. You should rename these files, removing the "_Q" suffixes, and complete your solutions in the places indicated.

Specific Tasks

The specific things you must do to complete this portfolio task are as follows.

1.  Create a database named inb104 containing  two tables called cars_for_sale and car_details, as explained above, to import the data into.

2.  Import the  vehicle  data  via the  cars_for_sale.sql and  car_details.sql scripts.

3.  Write  a Python function named  top_N_makes(N)  that  extract the  number of occurrences of each make in the car dataset and prints the top N most frequent makes together with their corresponding number of occurrences, one make per line.  Parameter N indicates the number of makes to be printed. 

For example, if BMW appears in 100 rows in the table cars_for_sale, its frequency will be 100.  If BMW and KIA are the top two most frequent makes, occurring 100 and 89 times,  respectively, your function is expected to produce the following result for the function call top_N_makes(2).

>>> top_N_makes(2) 

BMW 100

KIA 89

Note that if more results are requested than there are distinct makes in the database then all makes must be listed.  Also note that if two makes have the same frequency of occurrence then they should appear alphabetically.

DBMS, Programming

  • Category:- DBMS
  • Reference No.:- M9522674

Have any Question?


Related Questions in DBMS

Assignment task -write and run sql statements to complete

Assignment Task - Write and run SQL statements to complete the following tasks Part A - DML 1. Show the details of the products where the product code starts with '22'. 2. Display the vendor details from areacode 615. 3. ...

In sql database questions phase-1 in 100 words what steps

In SQL Database Questions: Phase-1 In 100 words, what steps can one take to avoid losing work? Which command is used to save changes to the database? What is the syntax for this command? Phase-2 In 100 words, explain the ...

Database design amp development assignment -assignment

Database Design & Development Assignment - Assignment title - Design and Implement a Relational Database for a local Print and Ink Refill Business. Learning Outcome - Use an appropriate design tool to design a relational ...

Students will select a situation or problem from their

Students will select a situation or problem from their company as a course project that can be solved using a database system. Using MS Access, or MS SQL Server Express, students will create a relational database model o ...

Database and information retrieval assignment - data

Database and Information Retrieval Assignment - Data Privacy Essay Task - Write an essay (aim for 750 words) that addresses issues associated with data proivacy. Use the Australian Privacy Principles - discussed in class ...

Question we can sort a given set of n numbers by first

Question : We can sort a given set of n numbers by first building a binary search tree containing these numbers (using TREE-INSERT repeatedly to insert the numbers one by one) and then printing the numbers by an inorder ...

The relation memberstudentid organizationid roleid stores

The relation Member(StudentId, OrganizationId, RoleId) stores the membership information of student joining organization. For example, ('S1', 'O2', 'R3') indicates that student with Id 'S1' joined the organization with i ...

Database design and development assignment -assessment task

Database Design and Development Assignment - Assessment task - 1. Normalization a) Map the ERD, from the sample solution, into a set of relations in at least Third Normal Form (3NF). You must ensure that your relations m ...

This assignment is a continuation of this solution the case

This assignment is a continuation of this solution The case study company has received the first report from its enterprise content management (ECM) consultant and now has a documented list of major content requirements ...

The system development team at the xyz company is working

The system development team at the XYZ Company is working on developing a new customer order entry system. In the process of designing the new system, the team has identified the following data entity attributes: Invento ...

  • 4,153,160 Questions Asked
  • 13,132 Experts
  • 2,558,936 Questions Answered

Ask Experts for help!!

Looking for Assignment Help?

Start excelling in your Courses, Get help with Assignment

Write us your full requirement for evaluation and you will receive response within 20 minutes turnaround time.

Ask Now Help with Problems, Get a Best Answer

Why might a bank avoid the use of interest rate swaps even

Why might a bank avoid the use of interest rate swaps, even when the institution is exposed to significant interest rate

Describe the difference between zero coupon bonds and

Describe the difference between zero coupon bonds and coupon bonds. Under what conditions will a coupon bond sell at a p

Compute the present value of an annuity of 880 per year

Compute the present value of an annuity of $ 880 per year for 16 years, given a discount rate of 6 percent per annum. As

Compute the present value of an 1150 payment made in ten

Compute the present value of an $1,150 payment made in ten years when the discount rate is 12 percent. (Do not round int

Compute the present value of an annuity of 699 per year

Compute the present value of an annuity of $ 699 per year for 19 years, given a discount rate of 6 percent per annum. As