Question

In: Computer Science

I need to answer all 16 questions. Please do as many as you can. Please answer...

I need to answer all 16 questions. Please do as many as you can.

Please answer the following question of database management.
1. Describe the process of creating a table in SQL and the different data types you can use for fields.

2. What is the purpose of the WHERE clause in SQL? Which comparison operators can you use in a WHERE clause?
3. How do you write a compound condition in an SQL query? When is a compound condition true?

4. What is a computed field? How can you use one in an SQL query? How do you assign a name to a computed field?

6. How do you use the IN operator in an SQL query?

7. How do you sort data in SQL? When there is more than one sort key, how do you indicate which one is the major sort key? How do you sort data in descending order?


8. What are the SQL built-in functions? How do you use them in an SQL query?

9. What is a subquery? When is a subquery executed?


10. How do you group data in SQL? When you group data in SQL, are there any restrictions on the items that you can include in the SELECT clause? Explain.


11. How do you join tables in SQL?

12. In a complex join, how is the number of tables you wish to join related to the number of WHERE conditions?

13. How do you qualify the name of a field in an SQL query? When is it necessary to do so?

14. How do you take the union of two tables in SQL? What criteria must the tables meet to make a union possible?

15. Describe the three update commands in SQL.

16. How do you save the results of an SQL query as a table?

Solutions

Expert Solution

1. In SQL the table can be created using a command CREATE TABLE command.

Following is the format:

CREATE TABLE "table name"

( "column1" "datatype(size)",

"column2" "datatype(size)",

"column3" "datatype(size)"

);

Ex: Student table.

CREATE TABLE student(

id int(20),

name varchar(20),

address varchar(20)

);

Below are the few measures to be taken while creating a table:

  • Table names and column names should not be SQL reserved words.
  • Every statement should end with a semicolon(;).
  • column definition should end with a comma(,).
  • Should not forget open and close parenthesis.   

The datatypes we can use for fields are:  

i. Integer

ii. Real(floating point)

iii. Text(String or text)

For the combination of string and number we use varchar.

2.The SQL WHERE clause is used to specify a condition while fetching the data from a single table or by joining with multiple tables. ... The WHERE clause is not only used in the SELECT statement, but it is also used in the UPDATE, DELETE statement, etc.,

-->The comparison operators are;

>,>=,<,<=,=,<>(not equal).

3.To write a compound condition, one would use the operators AND and OR to connect two simple conditions. A compound condition is true when the simple condition is met, i.e. one wants all the results that exactly match a certain parameter or criteria.

4a).Computed Field:

i) A field who's data is retrieved from the data of other field.

ii)It is also known as calculated field.

iii) Computed values are not physically present in the database.

iv) The operations involved in this are addition, Subtraction, Multiplication and division.

4b) In order to find the top 1 value in the table we use one(1)

Ex: SELECT TOP 1 "column name"

FROM "Table name"

4c) To find the computed field, We need to first identify the field values and the operations that are used for calculating the computed field . SQL aliasing can be used o give a name to the computed field.

6.The SQL IN condition (sometimes called the IN operator) allows you to easily test if an expression matches any value in a list of values. It is used to help reduce the need for multiple OR conditions in a SELECT, INSERT, UPDATE, or DELETE statement.

8.COUNT,SUM,AVG,MAX,MIN are the built-in functions provided by Sql Server.

Hope your are satisfied with the answers. please give a like.


Related Solutions

Please I need answer for all four questions please. ONLY ANSWER IF YOU CAN BE ABLE...
Please I need answer for all four questions please. ONLY ANSWER IF YOU CAN BE ABLE TO ANSWER TO 4 QUESTIONS. I DONT REALLY NEED LONG ANSWERS. 1.Describe why your nested Virtual Machine has a different DHCP server from your HOST Virtual Machine. 2. Describe why you would set your VM up using the host-mode network. 3. What is the difference between physical core and logical processors 4. What is memory ballooning and how should it be used in virtualization?...
Please answer all of the questions in as much details as you can. You need at...
Please answer all of the questions in as much details as you can. You need at least 2-3 sentences to answer the question, 2-3 sentences to provide details and examples. 1. Why do researchers prefer to use the word gender rather than sex when referring to social or cultural categories? 2. Define human sexuality? What are some of the sources that may influence an individual’s value system? 3. List some of the beliefs and behaviors about sex and sexuality that...
Please answer all of the questions in as much details as you can. You need at...
Please answer all of the questions in as much details as you can. You need at least 2-3 sentences to answer the question, 2-3 sentences to provide details and examples. 1. Why do researchers prefer to use the word gender rather than sex when referring to social or cultural categories? 2. Define human sexuality? What are some of the sources that may influence an individual’s value system? 3. List some of the beliefs and behaviors about sex and sexuality that...
Please answer the below questions ( I need answers for all the below questions). Thank you...
Please answer the below questions ( I need answers for all the below questions). Thank you True or False Write true if the statement is true or false if the statement is false. _______ The heart consists mainly of muscle. _______ Blood pressure is highest in veins. _______ Atherosclerosis is the buildup of plaque inside arteries. _______ Platelets are blood cells that fight infections. _______ Peripheral gas exchange takes place in the lungs. _______ Food travels from the mouth to...
Please do not attempt to solve if you can not answer all the questions. THE ENERGY...
Please do not attempt to solve if you can not answer all the questions. THE ENERGY BAR INDUSTRY In 1986, PowerBar, a firm in Berkeley, California, single-handedly created the energy bar category. Positioned as an athletic energy food, it was distributed at bike shops and events that usually involved running or biking. The target segment was the athlete who needed an efficient, effective energy source. Six years later, seeking to provide an alternative to the sticky, dry nature of the...
I need an answer to all three questions, please. Q1: Which of the following was not...
I need an answer to all three questions, please. Q1: Which of the following was not a policy response to the Economic crisis associated with the COVID-19 Crisis? Select one: a. The Fed lowered the policy rate by roughly 1.5 percentage points to nearly zero. b. The U.S. Congress passed a roughly $3 Trillion economic stimulus package. c. The Commonwealth of Massachusetts relaxed the balanced budget rule in the State Constitution. d. The Fed introduced facilities to keep markets liquid...
PRASAD PLEASE DO NOT ANSWER THIS. YOU ARE ONLY ANSWERING 1. I NEED ALL 4. YOU...
PRASAD PLEASE DO NOT ANSWER THIS. YOU ARE ONLY ANSWERING 1. I NEED ALL 4. YOU HAVE ANSWERED MULTIPLE WRONG 1. Mike recently leased a car for $385 per month for 5 years. The first payment due today. If the APR is 7.32 percent compounded monthly, what is the value of the payments today? 2. You estimate that Valley, Inc. will increase its dividend at 4.6 percent for the foreseeable future. The firm recently distributed a $3.41 dividend and you...
please answer all 4 questions. i don't need a long answer. please explain them briefly and...
please answer all 4 questions. i don't need a long answer. please explain them briefly and correctly. Thank you in advance. 1. What does the term qualitative analysis mean? 2. The confirmatory reactions that identify nitrate and nitrite both produce brown NO2 gas. What criterion will you use to determine which anion produced the gas? 3. The confirmation reaction for the halides involves the addition of chlorine water. Describe how you will know which, if any, of the anions is...
please answer all 4 questions. I need brief and correct answers. thank you in advance. 1....
please answer all 4 questions. I need brief and correct answers. thank you in advance. 1. Why is it important to mix the solutions after adding the reagents? How is mixing done in this experiment? 2. What is the reason for rinsing the precipitates before further testing? 3. What two things are extremely important to remember when centrifuging? 4. Why is it possible to separate Cu+2 from Al+3 and Fe+3 with NH4OH but not with NaOH? (Hint, consider solubility properties.)
CAN YOU PLEASE ANSWER AS SOON AS POSSIBLE AND PLEASE ANSWER ALL QUESTIONS THANK YOU 1/...
CAN YOU PLEASE ANSWER AS SOON AS POSSIBLE AND PLEASE ANSWER ALL QUESTIONS THANK YOU 1/ What is one similarity and one difference between voluntary motor system that innervate the head versus voluntary motor system that innervate the body? 2/ Does olfactory bulb (direct) relay to primary sensory cortex via the thalamus? 3/ Write a short paragraph using the following terms: opiates; endorphins, pain relief. 4/ In your own words, explain one way in which neuroplasticity allows learning and memory...
ADVERTISEMENT
ADVERTISEMENT
ADVERTISEMENT