Need help on 2 SQL based questions [on hold]











up vote
-4
down vote

favorite














  1. 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



  2. Given the following table definitions, write a select statement to get the following values ClaimantName, 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











share|improve this question









New contributor




user3590637 is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.











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 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








  • 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















up vote
-4
down vote

favorite














  1. 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



  2. Given the following table definitions, write a select statement to get the following values ClaimantName, 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











share|improve this question









New contributor




user3590637 is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.











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 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








  • 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













up vote
-4
down vote

favorite









up vote
-4
down vote

favorite













  1. 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



  2. Given the following table definitions, write a select statement to get the following values ClaimantName, 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











share|improve this question









New contributor




user3590637 is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.













  1. 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



  2. Given the following table definitions, write a select statement to get the following values ClaimantName, 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






share|improve this question









New contributor




user3590637 is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.











share|improve this question









New contributor




user3590637 is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.









share|improve this question




share|improve this question








edited Nov 19 at 12:28









Lee Mac

2,90021036




2,90021036






New contributor




user3590637 is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.









asked Nov 19 at 12:26









user3590637

1




1




New contributor




user3590637 is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.





New contributor





user3590637 is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.






user3590637 is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.




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 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








  • 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




    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 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








  • 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

















active

oldest

votes






















active

oldest

votes













active

oldest

votes









active

oldest

votes






active

oldest

votes

Popular posts from this blog

404 Error Contact Form 7 ajax form submitting

How to know if a Active Directory user can login interactively

Refactoring coordinates for Minecraft Pi buildings written in Python