Questions
What are the assumptions and predictions of the pecking order theory? Why do empirical studies generally...

What are the assumptions and predictions of the pecking order theory? Why do empirical studies generally find in a negative abnormal stock return upon the announcement of an equity issue?

In: Finance

Using Marx’s theory of competition do you think that the U.S. is competitive or is there...

Using Marx’s theory of competition do you think that the U.S. is competitive or is there a new stage of monopoly capitalism? Start by explaining Marx’s view and then review the empirical evidence.

In: Economics

It has been argued in the finance literature that great majority of mergers lead to value...

It has been argued in the finance literature that great majority of mergers lead to value destruction. Citing empirical evidence, discuss whether you agree or disagree with this statement.

In: Finance

Python using sqllite3 package In this exercise, your task is to inspect the given database, which...

Python using sqllite3 package

In this exercise, your task is to inspect the given database, which is called 'chinook.db', as you can see from the testing code below in the example. We first would like to know how the logical schema of the database looks like, in order to work with it later in terms of reading from and writing to the database. Please also note that a software tool like "DB Browser for SQLite" can be used to inspect and modify an SQLite database file like 'chinook.db'.

To solve this exercise you have to write a function get_table_information_from_database(database_filename), which returns a dictionary that has all the available table names as its keys, and a list of the column names for the respective table as its values. The column names are the second entries in the record returned from the "PRAGMA table_info" SQL statement given below.

Regarding the structure of this code, you have to make sure that the Python sqlite3 package is first imported. Using the connect method from this package, a database connection can be opened. This connection uses the concept of a cursor object to send SQL statements to the database in the form of strings. In case the SQL string represents a query, the cursor.execute method returns a result containing the result of this query. This result is a list and can be inspected here in this question for the logical schema information.

The necessary SQL statements you need are:

  • "SELECT name FROM sqlite_master WHERE type='table'"
  • and for each table, identified by a string 'table_name': "PRAGMA table_info('table_name')"

Attention: Please ignore table names that start with the substring "sqlite" from the query result, since these are internal tables, which in general should not be used by an application!

Don't forget to close the database connection after you are finished accessing the database!

Please have a look at the examples in the lecture slides for lecture 15 to see examples of SQLite being used. Additionally, you may want to look up more information on the web page for Python's SQLite API here. SQL statements are simply strings, which can be concatenated using string literals and string variables.

Note: As always, it is a good idea to work on this example using your favourite IDE first (download the database file), before you enter it into coderunner. This way you can more easily debug your code!

For example:

Test Result
database_filename = 'chinook.db'
metadata_dictionary = get_table_information_from_database(database_filename)

for table in sorted(metadata_dictionary.keys()):
   print("{}: {}".format(table, metadata_dictionary[table]))
albums: ['AlbumId', 'Title', 'ArtistId']
artists: ['ArtistId', 'Name']
customers: ['CustomerId', 'FirstName', 'LastName', 'Company', 'Address', 'City', 'State', 'Country', 'PostalCode', 'Phone', 'Fax', 'Email', 'SupportRepId']
employees: ['EmployeeId', 'LastName', 'FirstName', 'Title', 'ReportsTo', 'BirthDate', 'HireDate', 'Address', 'City', 'State', 'Country', 'PostalCode', 'Phone', 'Fax', 'Email']
genres: ['GenreId', 'Name']
invoice_items: ['InvoiceLineId', 'InvoiceId', 'TrackId', 'UnitPrice', 'Quantity']
invoices: ['InvoiceId', 'CustomerId', 'InvoiceDate', 'BillingAddress', 'BillingCity', 'BillingState', 'BillingCountry', 'BillingPostalCode', 'Total']
media_types: ['MediaTypeId', 'Name']
playlist_track: ['PlaylistId', 'TrackId']
playlists: ['PlaylistId', 'Name']
tracks: ['TrackId', 'Name', 'AlbumId', 'MediaTypeId', 'GenreId', 'Composer', 'Milliseconds', 'Bytes', 'UnitPrice']

given start code

import sqlite3

def get_table_information_from_database(database_filename):
pass

In: Computer Science

Proponents of fixed exchange rates would find the most support for their position in which one...

Proponents of fixed exchange rates would find the most support for their position in which one of the following empirical results regarding the relationship between exchange rate variations and the volume of international trade? (Assume that the empirical tests adequately account for other factors that influence the volume of trade.)

Select one:

a. no discernible relationship between exchange rate variations and the volume of trade

b. a negative relationship between exchange rate variations and the volume of trade

c. a mildly positive relationship between exchange rate variations and the volume of trade

d. a strongly positive relationship between exchange rate variations and the volume of trade

In: Economics

The Clausius-Clapeyron equation and the Antoine equation. The vapor pressure of a liquid can be written...

The Clausius-Clapeyron equation and the Antoine equation. The vapor pressure of a liquid can be written in the empirical form known as the Antoine equation, ln (p / p ◦ ) = A1 − (A2 /(T + A3)) where A1, A2, and A3 are empirical constants determined from measurements, and T is the temperature in Kelvin.

(a) Starting with this equation, derive an equation for the enthalpy of vaporization as a function of temperature.

(b) For ethanol (l), A1 = 23.58, A2 = 3.67 × 103 , A3 = −46.702, and p ◦ = 1 Pa. Given that the standard pressure is 1 bar = 1.01325 × 105 Pa, what is the standard boiling temperature?

(c) Calculate ∆h at 298 K and at the standard boiling temperature.

In: Chemistry

Role of distributed database managment system in Finance Industry (Banking/ Investing / Insurance/... )

Role of distributed database managment system in Finance Industry (Banking/ Investing / Insurance/... )

In: Computer Science

True/False: A primary goal of a database system is to share data with multiple users

True/False:

A primary goal of a database system is to share data with multiple users

In: Computer Science

Discuss how database systems have revolutionised decision making and reporting practices.

Discuss how database systems have revolutionised decision making and reporting practices.

In: Accounting

Please write a summary of the Company (SWOT) (5Ps) for Netflix with the database. As detail...

Please write a summary of the Company (SWOT) (5Ps) for Netflix with the database. As detail as possible.

In: Operations Management