Need help on 2 SQL based questions [on hold]
up vote
-4
down vote
favorite
Given the following table definition, select all city names in descending order:
TABLE cities
id INTEGER NOT NULL PRIMARY KEY
name VARCHAR(30) NOT NULL
Given the following table definitions, write a
select
statement to get the following valuesClaimantName
,PolicyNumber
,UMR
,InsuredType
,Insurer
using joins:
TABLE Claims
ID INTEGER NOT NULL PRIMARY KEY
ClaimantName VARCHAR(30) NOT NULL
InsurerID INTEGER NOT NULL FOREIGN KEY
BrokerID INTEGER NOT NULL FOREIGN KEY
PolicyID INTEGER NOT NULL FOREIGN KEY
TABLE Policies
ID INTEGER NOT NULL PRIMARY KEY
PolicyNumber VARCHAR(30) NOT NULL
BinderID INTEGER NOT NULL FOREIGN KEY
UMR VARCHAR(30) NOT NULL
Insured Type VARCHAR(30) NOT NULL
TABLE Insurers
ID INTEGER NOT NULL PRIMARY KEY
CompanyName VARCHAR(30) NOT NULL
TABLE Binders
ID INTEGER NOT NULL PRIMARY KEY
BinderName VARCHAR(30) NOT NULL
CarrierID INTEGER NOT NULL FOREIGN KEY
TABLE Carrier
ID INTEGER NOT NULL PRIMARY KEY
CarrierName VARCHAR(30) NOT NULL
sql
New contributor
put on hold as too broad by jarlh, Gordon Linoff, a_horse_with_no_name, Andrew, gnat Nov 19 at 13:58
Please edit the question to limit it to a specific problem with enough detail to identify an adequate answer. Avoid asking multiple distinct questions at once. See the How to Ask page for help clarifying this question. If this question can be reworded to fit the rules in the help center, please edit the question.
|
show 2 more comments
up vote
-4
down vote
favorite
Given the following table definition, select all city names in descending order:
TABLE cities
id INTEGER NOT NULL PRIMARY KEY
name VARCHAR(30) NOT NULL
Given the following table definitions, write a
select
statement to get the following valuesClaimantName
,PolicyNumber
,UMR
,InsuredType
,Insurer
using joins:
TABLE Claims
ID INTEGER NOT NULL PRIMARY KEY
ClaimantName VARCHAR(30) NOT NULL
InsurerID INTEGER NOT NULL FOREIGN KEY
BrokerID INTEGER NOT NULL FOREIGN KEY
PolicyID INTEGER NOT NULL FOREIGN KEY
TABLE Policies
ID INTEGER NOT NULL PRIMARY KEY
PolicyNumber VARCHAR(30) NOT NULL
BinderID INTEGER NOT NULL FOREIGN KEY
UMR VARCHAR(30) NOT NULL
Insured Type VARCHAR(30) NOT NULL
TABLE Insurers
ID INTEGER NOT NULL PRIMARY KEY
CompanyName VARCHAR(30) NOT NULL
TABLE Binders
ID INTEGER NOT NULL PRIMARY KEY
BinderName VARCHAR(30) NOT NULL
CarrierID INTEGER NOT NULL FOREIGN KEY
TABLE Carrier
ID INTEGER NOT NULL PRIMARY KEY
CarrierName VARCHAR(30) NOT NULL
sql
New contributor
put on hold as too broad by jarlh, Gordon Linoff, a_horse_with_no_name, Andrew, gnat Nov 19 at 13:58
Please edit the question to limit it to a specific problem with enough detail to identify an adequate answer. Avoid asking multiple distinct questions at once. See the How to Ask page for help clarifying this question. If this question can be reworded to fit the rules in the help center, please edit the question.
4
Homework? What have you tried? Remember that if we do it for you, you won't learn much.
– jarlh
Nov 19 at 12:27
it was a quiz for a potential employer that was about JS but these 2 questions were tagged on at the end so i need abit of help understanding how to do them before i start to properly learn SQL
– user3590637
Nov 19 at 12:30
Hint for the first question:order by
, hint for the second questionjoin
– a_horse_with_no_name
Nov 19 at 12:32
thanks for the hints, im assuming ORDER BY NAME DESC; would work from what i can see
– user3590637
Nov 19 at 12:35
2
Why not simply create the tables and insert some data. Then it's easy to verify your queries.
– jarlh
Nov 19 at 12:51
|
show 2 more comments
up vote
-4
down vote
favorite
up vote
-4
down vote
favorite
Given the following table definition, select all city names in descending order:
TABLE cities
id INTEGER NOT NULL PRIMARY KEY
name VARCHAR(30) NOT NULL
Given the following table definitions, write a
select
statement to get the following valuesClaimantName
,PolicyNumber
,UMR
,InsuredType
,Insurer
using joins:
TABLE Claims
ID INTEGER NOT NULL PRIMARY KEY
ClaimantName VARCHAR(30) NOT NULL
InsurerID INTEGER NOT NULL FOREIGN KEY
BrokerID INTEGER NOT NULL FOREIGN KEY
PolicyID INTEGER NOT NULL FOREIGN KEY
TABLE Policies
ID INTEGER NOT NULL PRIMARY KEY
PolicyNumber VARCHAR(30) NOT NULL
BinderID INTEGER NOT NULL FOREIGN KEY
UMR VARCHAR(30) NOT NULL
Insured Type VARCHAR(30) NOT NULL
TABLE Insurers
ID INTEGER NOT NULL PRIMARY KEY
CompanyName VARCHAR(30) NOT NULL
TABLE Binders
ID INTEGER NOT NULL PRIMARY KEY
BinderName VARCHAR(30) NOT NULL
CarrierID INTEGER NOT NULL FOREIGN KEY
TABLE Carrier
ID INTEGER NOT NULL PRIMARY KEY
CarrierName VARCHAR(30) NOT NULL
sql
New contributor
Given the following table definition, select all city names in descending order:
TABLE cities
id INTEGER NOT NULL PRIMARY KEY
name VARCHAR(30) NOT NULL
Given the following table definitions, write a
select
statement to get the following valuesClaimantName
,PolicyNumber
,UMR
,InsuredType
,Insurer
using joins:
TABLE Claims
ID INTEGER NOT NULL PRIMARY KEY
ClaimantName VARCHAR(30) NOT NULL
InsurerID INTEGER NOT NULL FOREIGN KEY
BrokerID INTEGER NOT NULL FOREIGN KEY
PolicyID INTEGER NOT NULL FOREIGN KEY
TABLE Policies
ID INTEGER NOT NULL PRIMARY KEY
PolicyNumber VARCHAR(30) NOT NULL
BinderID INTEGER NOT NULL FOREIGN KEY
UMR VARCHAR(30) NOT NULL
Insured Type VARCHAR(30) NOT NULL
TABLE Insurers
ID INTEGER NOT NULL PRIMARY KEY
CompanyName VARCHAR(30) NOT NULL
TABLE Binders
ID INTEGER NOT NULL PRIMARY KEY
BinderName VARCHAR(30) NOT NULL
CarrierID INTEGER NOT NULL FOREIGN KEY
TABLE Carrier
ID INTEGER NOT NULL PRIMARY KEY
CarrierName VARCHAR(30) NOT NULL
sql
sql
New contributor
New contributor
edited Nov 19 at 12:28
Lee Mac
2,90021036
2,90021036
New contributor
asked Nov 19 at 12:26
user3590637
1
1
New contributor
New contributor
put on hold as too broad by jarlh, Gordon Linoff, a_horse_with_no_name, Andrew, gnat Nov 19 at 13:58
Please edit the question to limit it to a specific problem with enough detail to identify an adequate answer. Avoid asking multiple distinct questions at once. See the How to Ask page for help clarifying this question. If this question can be reworded to fit the rules in the help center, please edit the question.
put on hold as too broad by jarlh, Gordon Linoff, a_horse_with_no_name, Andrew, gnat Nov 19 at 13:58
Please edit the question to limit it to a specific problem with enough detail to identify an adequate answer. Avoid asking multiple distinct questions at once. See the How to Ask page for help clarifying this question. If this question can be reworded to fit the rules in the help center, please edit the question.
4
Homework? What have you tried? Remember that if we do it for you, you won't learn much.
– jarlh
Nov 19 at 12:27
it was a quiz for a potential employer that was about JS but these 2 questions were tagged on at the end so i need abit of help understanding how to do them before i start to properly learn SQL
– user3590637
Nov 19 at 12:30
Hint for the first question:order by
, hint for the second questionjoin
– a_horse_with_no_name
Nov 19 at 12:32
thanks for the hints, im assuming ORDER BY NAME DESC; would work from what i can see
– user3590637
Nov 19 at 12:35
2
Why not simply create the tables and insert some data. Then it's easy to verify your queries.
– jarlh
Nov 19 at 12:51
|
show 2 more comments
4
Homework? What have you tried? Remember that if we do it for you, you won't learn much.
– jarlh
Nov 19 at 12:27
it was a quiz for a potential employer that was about JS but these 2 questions were tagged on at the end so i need abit of help understanding how to do them before i start to properly learn SQL
– user3590637
Nov 19 at 12:30
Hint for the first question:order by
, hint for the second questionjoin
– a_horse_with_no_name
Nov 19 at 12:32
thanks for the hints, im assuming ORDER BY NAME DESC; would work from what i can see
– user3590637
Nov 19 at 12:35
2
Why not simply create the tables and insert some data. Then it's easy to verify your queries.
– jarlh
Nov 19 at 12:51
4
4
Homework? What have you tried? Remember that if we do it for you, you won't learn much.
– jarlh
Nov 19 at 12:27
Homework? What have you tried? Remember that if we do it for you, you won't learn much.
– jarlh
Nov 19 at 12:27
it was a quiz for a potential employer that was about JS but these 2 questions were tagged on at the end so i need abit of help understanding how to do them before i start to properly learn SQL
– user3590637
Nov 19 at 12:30
it was a quiz for a potential employer that was about JS but these 2 questions were tagged on at the end so i need abit of help understanding how to do them before i start to properly learn SQL
– user3590637
Nov 19 at 12:30
Hint for the first question:
order by
, hint for the second question join
– a_horse_with_no_name
Nov 19 at 12:32
Hint for the first question:
order by
, hint for the second question join
– a_horse_with_no_name
Nov 19 at 12:32
thanks for the hints, im assuming ORDER BY NAME DESC; would work from what i can see
– user3590637
Nov 19 at 12:35
thanks for the hints, im assuming ORDER BY NAME DESC; would work from what i can see
– user3590637
Nov 19 at 12:35
2
2
Why not simply create the tables and insert some data. Then it's easy to verify your queries.
– jarlh
Nov 19 at 12:51
Why not simply create the tables and insert some data. Then it's easy to verify your queries.
– jarlh
Nov 19 at 12:51
|
show 2 more comments
active
oldest
votes
active
oldest
votes
active
oldest
votes
active
oldest
votes
active
oldest
votes
4
Homework? What have you tried? Remember that if we do it for you, you won't learn much.
– jarlh
Nov 19 at 12:27
it was a quiz for a potential employer that was about JS but these 2 questions were tagged on at the end so i need abit of help understanding how to do them before i start to properly learn SQL
– user3590637
Nov 19 at 12:30
Hint for the first question:
order by
, hint for the second questionjoin
– a_horse_with_no_name
Nov 19 at 12:32
thanks for the hints, im assuming ORDER BY NAME DESC; would work from what i can see
– user3590637
Nov 19 at 12:35
2
Why not simply create the tables and insert some data. Then it's easy to verify your queries.
– jarlh
Nov 19 at 12:51