Answered step by step
Verified Expert Solution
Question
1 Approved Answer
Q1: Write down sql statements for following: a: Write down general format of the SQL statement for SELECT b: Write down general format of the
Q1: Write down sql statements for following: a: Write down general format of the SQL statement for "SELECT" b: Write down general format of the SQL statement for "INSERT" c: Write down general format of the SQL statement for "DELETE" d: You may need to drop an existing table. Write down genral format of the SQL statement for drop table "INSERT" Q2: We discussed this homework in our last class on Tuesday. This is a follow-up of last homework where every student was asked to create the 7 tables from the HR database into their allotted Group# and prefix the tablenames with their name. Example for Countries table a student named Xavier who let's say belongs to Group1, will create a tablename Xavier_Countries. Similarly create other remaining six tables starting with Xavier_. a) using "INSERT" sql statements, copy the data from HR tables into your tables created in your own GROUP database. b) Run "Select count(*) from your table, one by one, and record the number of rows for each table into your answer sheet. Tally the number of records to match with the number of records in the corresponding HR database tables. Report your SQL code you used to write the "INSERT" sql code Q3: Run SQLs "SELECT" statements to provide answer to following inquiries: a) Write a "SELECT" code against the HR database table "Countires" to provide the name of countries whose name starts with "U". Hint: Use WHERE clause with LIKE 'U%' (use of wild card %) b) Write a SQL statement to count the number of countries whose name starts with "A" c) Write SELECT code against "HR" database to provide the average of min_salary d) Write SELECT code against "HR" database to provide the average of max_salary Report your SQL code as well as the answers in an excel spredsheet Q1: Write down sql statements for following: a: Write down general format of the SQL statement for "SELECT" b: Write down general format of the SQL statement for "INSERT" c: Write down general format of the SQL statement for "DELETE" d: You may need to drop an existing table. Write down genral format of the SQL statement for drop table "INSERT" Q2: We discussed this homework in our last class on Tuesday. This is a follow-up of last homework where every student was asked to create the 7 tables from the HR database into their allotted Group# and prefix the tablenames with their name. Example for Countries table a student named Xavier who let's say belongs to Group1, will create a tablename Xavier_Countries. Similarly create other remaining six tables starting with Xavier_. a) using "INSERT" sql statements, copy the data from HR tables into your tables created in your own GROUP database. b) Run "Select count(*) from your table, one by one, and record the number of rows for each table into your answer sheet. Tally the number of records to match with the number of records in the corresponding HR database tables. Report your SQL code you used to write the "INSERT" sql code Q3: Run SQLs "SELECT" statements to provide answer to following inquiries: a) Write a "SELECT" code against the HR database table "Countires" to provide the name of countries whose name starts with "U". Hint: Use WHERE clause with LIKE 'U%' (use of wild card %) b) Write a SQL statement to count the number of countries whose name starts with "A" c) Write SELECT code against "HR" database to provide the average of min_salary d) Write SELECT code against "HR" database to provide the average of max_salary Report your SQL code as well as the answers in an excel spredsheet
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started