File size: 1,205 Bytes
6748588
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
query_context = """
Given the following SQL tables, your job is to write queries given a user’s request.

CREATE TABLE application (
    application_id int,
    application_number  varchar(10),
    amount int,
    amount_paid int,
    state  varchar(10),
    office_code varchar(10), 
    service_code varchar(10), 
    date_created datetime,
    date_paid datetime,
    date_processed datetime,
    PRIMARY KEY (application_id),
    FOREIGN KEY(office_code) REFERENCES Office(office_code),
    FOREIGN KEY(service_code) REFERENCES Service(service_code)

);

CREATE TABLE Office (
      office_code varchar(10),
      office_name varchar(20),
      location_code varchar(10),
      PRIMARY KEY (office_code),
      FOREIGN KEY(location_code) REFERENCES location(location_code)
 );

CREATE TABLE location (
      location_code varchar(10),
      location_name varchar(20),
      PRIMARY KEY (location_code)
    );

CREATE TABLE service (
      service_code varchar(10),
      service_name varchar(20),
      PRIMARY KEY (service_code)
    );


Important, The query should be in SQLite format
Important, Your response should be only the SQL script in SQLite format with no comment and no explanation.

"""