Question

In: Computer Science

Q1. What do you mean by A view in SQL language? Give an example? Q2. Explain...

Q1. What do you mean by A view in SQL language? Give an example?

Q2. Explain the role of SQL authorization mechanisms that allow to differentiate among the users of the database as far as the type of access they are permitted on various data values in the database?

Solutions

Expert Solution

Answer 1.

  • A view is a virtual table which is based on the result set of an SQL statement.
  • A view contains all rows of a table or few rows can be selected from the table.
  • A view can be created from one or many tables which depends on the written SQL query to create a view.
  • Example:
    • CREATE VIEW DEPARTMENTS_VIEW AS SELECT DepartmentName, DepartmentId FROM Departments.

Answer 2.

  • GRANT and REVOKE SQL statements are used to set the user privileges on a table or view.
  • The GRANT statement is used to grant specific privileges to users or to roles on particular tables or views.
  • The REVOKE statement is used to remove privileges and role grants. From table/view.
  • The grant and revoke privileges are:
    • System Privileges
      • CREATE
      • ALTER
      • DROP
    • Object Privileges
      • SELECT
      • EXECUTE
      • INSERT
      • UPDATE
      • DELETE
  • GRANT syntax:
    • GRANT privilege_name ON object_name TO {userName |PUBLIC |roleName} [WITH GRANT OPTION];
    • Explanation:
      • GRANT: To give grant permission/privilege.
      • privilege_name: Privilege granted to the user (i.e. CREATE, INSERT, DROP etc.).
      • object_name: Table or view name.
      • userName: Grants privilege to this user.
      • PUBLIC: Access rights to all (Optional).
      • roleName: Set of privileges combined (Optional).
      • WITH GRANT OPTION: To access grants to other users (Optional).
  • REVOKE syntax:
    • REVOKE privilege_name ON object_name FROM {userName |PUBLIC |roleName}
    • Explanation:
      • REVOKE: To remove permission/privilege.
      • privilege_name: Privilege to be removed.
      • object_name: Table or view name.
      • userName: Privilege removed for this user.
      • PUBLIC: Optional field.
      • roleName: Optional field.

Related Solutions

Q1.What is leverage ?. give an example. Q2. Explain the Importance of leverage?
Q1.What is leverage ?. give an example. Q2. Explain the Importance of leverage?
C(Q1, Q2) = 3,500 - 205Q1Q2 - (Q1)2 + (Q2)2 A. What do you need to...
C(Q1, Q2) = 3,500 - 205Q1Q2 - (Q1)2 + (Q2)2 A. What do you need to know from the equation above to see if there are Cost Complementarity? Are there Cost Complementarity? B. What is MC1(Q1,Q2) ? C. What is MC2(Q1,Q2) ? D. Are there economies of scope? Explain. E. What are the implications for a merger?
Q1)Write the syntax SQL DCL “GRANT” and and REVOKE Commands? Q2 ) Write SQL DCL Commands?...
Q1)Write the syntax SQL DCL “GRANT” and and REVOKE Commands? Q2 ) Write SQL DCL Commands? i. To give the user Ahmad permission to view and modify records in the table Employee. ii. To revoke the permission to view and modify the records in the table Employee.
1. Q1) What do you understand by terminal temperature different? Can it be negative? Explain. Q2)...
1. Q1) What do you understand by terminal temperature different? Can it be negative? Explain. Q2) A 50% reaction turbine is supplied with steam at 60 bar, 600 °C. the condenser pressure is 0.07 bar. If the reheat factor is assumed to be 1.04 and the stage efficiency is constant throughout at 80%. Calculate the steam flow required for a diagram power of 25 MW. 2.
Q1) Do you think that such a system of self-regulation is appropriate ? Q2 ) What...
Q1) Do you think that such a system of self-regulation is appropriate ? Q2 ) What sort of things could result in the statement and the account held in the books of the debtor showing different balances ?
Q1) Explain systematic approach. Q2) Based on your experience (example), provide one (1) example where you...
Q1) Explain systematic approach. Q2) Based on your experience (example), provide one (1) example where you used systematic approach. *please answer/provide comprehensive answer all by clearly and easy to read and understandable.. thanks..
            What do we mean when we say “a preferred size”? Explain and give an example.
            What do we mean when we say “a preferred size”? Explain and give an example.
what do capitalized and expensed mean? How do you determine which to use? give an example...
what do capitalized and expensed mean? How do you determine which to use? give an example of each. "Capitalized" & "Expensed"
Give an example of a confidence interval for the mean of a population when you do...
Give an example of a confidence interval for the mean of a population when you do not know the population standard deviation by describing the population, the variable, and how you would go about finding the interval. You may want to mention a sample size, a confidence level, and a possible interval.
Q1. Can you give three reasons to use derivatives? Explain Q2. An investor sells 10 futures...
Q1. Can you give three reasons to use derivatives? Explain Q2. An investor sells 10 futures contracts on day 1 for $ 500 each. The initial margin is 40% and the maintenance margin is 30%. If the pattern of prices is as given in the table below, work out the margin account of the investor for each day until the position is closed out on day 7. Suppose that: 1. The margin call restores the margin account to its maintenance...
ADVERTISEMENT
ADVERTISEMENT
ADVERTISEMENT